sway: use caffeinated instead of disabling swayidle

This commit is contained in:
Leonardo Eugênio 2025-06-17 13:04:57 -03:00
parent 9f4328a73a
commit cc6110dcac
No known key found for this signature in database
GPG key ID: 2F8F21CE8721456B
7 changed files with 57 additions and 18 deletions

View file

@ -154,6 +154,7 @@ in
wl-clipboard
wtype
wl-crosshair
caffeinated
grim
satty

View file

@ -19,7 +19,7 @@ let
'';
_suspend = pkgs.writeShellScriptBin "_suspend" ''
${pkgs.sway}/bin/swaymsg mode default
systemctl --user start swayidle.service
pkill caffeinated || true
systemctl suspend
'';
@ -143,7 +143,7 @@ let
system_binds = {
"--locked Ctrl+${mod}+z" = "exec ${_suspend}/bin/_suspend";
"${mod}+Alt+c" = "exec ${pkgs._sway_idle_toggle}/bin/_sway_idle_toggle";
"${mod}+Alt+c" = "exec pkill caffeinated || exec caffeinated";
};
screenshot_binds = {

View file

@ -3,12 +3,10 @@
osConfig,
pkgs,
lib,
font,
...
}:
let
inherit (config.my)
key
theme
accent
font
@ -170,8 +168,8 @@ in
};
"custom/caffeine" = {
format = "{}";
exec = "systemctl --user status swayidle > /dev/null && echo 󰒲 || echo 󰒳";
on-click = "${pkgs._sway_idle_toggle}/bin/_sway_idle_toggle";
exec = "pgrep caffeinated > /dev/null && echo '󰒳' || echo '󰒲' ";
on-click = "pkill caffeinated || exec caffeinated";
interval = 1;
tooltip = false;
};