tileos-settings-qtile/usr/share/qtile/scripts/idle-inhibit
Sunderland93 08680646bb Inhibit idle by stop swayidle.service
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
2024-07-23 23:25:29 +04:00

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