Qtile had limited support for the wp-idle-inhibit protocol so wayland-idle-inhibit doesn't work as expected. We can inhibit idle by stopping swayidle.service
29 lines
509 B
Bash
Executable file
29 lines
509 B
Bash
Executable file
#!/bin/bash
|
|
|
|
# Qtile idle-inhibitor toggle
|
|
function toggle {
|
|
if pgrep -f "swayidle" > /dev/null
|
|
then
|
|
systemctl --user stop swayidle.service
|
|
notify-send -r 5556 -u normal " Screensaver Disabled"
|
|
else
|
|
systemctl --user start swayidle.service
|
|
notify-send -r 5556 -u normal " Screensaver Enabled"
|
|
fi
|
|
}
|
|
|
|
case $1 in
|
|
toggle)
|
|
toggle
|
|
;;
|
|
*)
|
|
if pgrep -f "swayidle" > /dev/null
|
|
then
|
|
icon=""
|
|
else
|
|
icon=""
|
|
fi
|
|
printf "%s" "$icon"
|
|
;;
|
|
esac
|
|
|