fix swayidle

This commit is contained in:
Leonardo Eugênio 2022-12-05 12:49:30 -03:00
parent a5c383ed14
commit 468a0d2850
2 changed files with 2 additions and 2 deletions

View file

@ -18,7 +18,7 @@ let
systemctl suspend
'';
_sway_idle_toggle = pkgs.writeShellScriptBin "_sway_idle_toggle" ''
if pidof swayidle > /dev/null; then
if systemctl --user status swayidle > /dev/null; then
systemctl --user stop swayidle.service
else
systemctl --user start swayidle.service

View file

@ -88,7 +88,7 @@ in {
"sway/language" = { format = "{short} {variant}"; };
"custom/caffeine" = {
format = "{}";
exec = "pidof swayidle > /dev/null && echo || echo ";
exec = "systemctl --user status swayidle > /dev/null && echo || echo ";
on-click = "_sway_idle_toggle";
interval = 1;
tooltip = false;