Add idle inhibitor, add more options to clipboard widget
This commit is contained in:
parent
a7d960847b
commit
ebb076d8f3
3 changed files with 64 additions and 1 deletions
8
debian/changelog
vendored
8
debian/changelog
vendored
|
@ -1,3 +1,11 @@
|
|||
tileos-settings-qtile (0.5~tileos) unstable; urgency=medium
|
||||
|
||||
* Small fixes
|
||||
* Added idle inhibitor
|
||||
* Added more options to clipboard manager
|
||||
|
||||
-- Aleksey Samoilov <samoilov.lex@gmail.com> Sat, 25 Nov 2023 23:23:30 +0400
|
||||
|
||||
tileos-settings-qtile (0.4~tileos) unstable; urgency=medium
|
||||
|
||||
* Add basic clipboard widget
|
||||
|
|
|
@ -208,7 +208,24 @@ screens = [
|
|||
border_width = [0, 0, 2, 0],
|
||||
)
|
||||
],
|
||||
mouse_callbacks={"Button1": lambda: qtile.cmd_spawn("/usr/share/qtile/scripts/clipboard.sh --list")},
|
||||
mouse_callbacks={"Button1": lambda: qtile.cmd_spawn("/usr/share/qtile/scripts/clipboard.sh --list"),
|
||||
"Button2": lambda: qtile.cmd_spawn("rm -f ~/.cache/cliphist/db"),
|
||||
"Button3": lambda: qtile.cmd_spawn("/usr/share/qtile/scripts/clipboard.sh --del")
|
||||
},
|
||||
),
|
||||
widget.Spacer(length = 8),
|
||||
# Idle inhibitor
|
||||
widget.GenPollText(
|
||||
update_interval=1,
|
||||
func=lambda: subprocess.check_output(os.path.expanduser("/usr/share/qtile/scripts/idle-inhibit")).decode(),
|
||||
foreground = colors[5],
|
||||
decorations=[
|
||||
BorderDecoration(
|
||||
colour = colors[5],
|
||||
border_width = [0, 0, 2, 0],
|
||||
)
|
||||
],
|
||||
mouse_callbacks={'Button1': lambda: qtile.spawn(os.path.expanduser("/usr/share/qtile/scripts/idle-inhibit toggle"), shell=True)}
|
||||
),
|
||||
widget.Spacer(length = 8),
|
||||
widget.CPU(
|
||||
|
|
38
usr/share/qtile/scripts/idle-inhibit
Executable file
38
usr/share/qtile/scripts/idle-inhibit
Executable file
|
@ -0,0 +1,38 @@
|
|||
#!/bin/bash
|
||||
|
||||
# Qtile swayidle toggle
|
||||
function toggle {
|
||||
if pgrep "swayidle" > /dev/null
|
||||
then
|
||||
pkill swayidle
|
||||
notify-send -r 5556 -u normal " Swayidle Inactive"
|
||||
else
|
||||
cd /tmp
|
||||
grim screen.png
|
||||
# Delete existing image
|
||||
rm screen-out.png
|
||||
#Adds a blur and vignette
|
||||
ffmpeg -i screen.png -vf "gblur=sigma=10, vignette=PI/5" -c:a copy screen-out.png
|
||||
swayidle \
|
||||
timeout 5 'qtile cmd-obj -o core -f hide_cursor' resume 'qtile cmd-obj -o core -f unhide_cursor' \
|
||||
timeout 300 'swaylock -f -i screen-out.png' \
|
||||
timeout 600 'wlopm --off \*' resume 'wlopm --on \*' &
|
||||
notify-send -r 5556 -u normal " Swayidle Active"
|
||||
fi
|
||||
}
|
||||
|
||||
case $1 in
|
||||
toggle)
|
||||
toggle
|
||||
;;
|
||||
*)
|
||||
if pgrep "swayidle" > /dev/null
|
||||
then
|
||||
icon=""
|
||||
else
|
||||
icon=""
|
||||
fi
|
||||
printf "%s" "$icon "
|
||||
;;
|
||||
esac
|
||||
|
Loading…
Add table
Reference in a new issue