diff --git a/debian/changelog b/debian/changelog index c16cdaa..d23d538 100644 --- a/debian/changelog +++ b/debian/changelog @@ -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 Sat, 25 Nov 2023 23:23:30 +0400 + tileos-settings-qtile (0.4~tileos) unstable; urgency=medium * Add basic clipboard widget diff --git a/etc/skel/.config/qtile/config.py b/etc/skel/.config/qtile/config.py index ab7f729..7158064 100644 --- a/etc/skel/.config/qtile/config.py +++ b/etc/skel/.config/qtile/config.py @@ -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( diff --git a/usr/share/qtile/scripts/idle-inhibit b/usr/share/qtile/scripts/idle-inhibit new file mode 100755 index 0000000..638401d --- /dev/null +++ b/usr/share/qtile/scripts/idle-inhibit @@ -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 +