sway: Lock before sleeping

This commit is contained in:
Geoffrey Frogeye 2025-05-29 22:49:23 +02:00
parent cbc43f838b
commit d645ace45c

View file

@ -264,15 +264,20 @@ in
''; '';
}; };
}; };
frogeye.desktop.i3.bindmodes = { frogeye.desktop.i3.bindmodes =
let
lock = "${pkgs.procps}/bin/pkill -USR1 swayidle";
in
{
"[L] Vérouillage [E] Déconnexion [S] Veille [H] Hibernation [R] Redémarrage [P] Extinction" = { "[L] Vérouillage [E] Déconnexion [S] Veille [H] Hibernation [R] Redémarrage [P] Extinction" = {
bindings = { bindings = {
"l" = "exec --no-startup-id ${pkgs.procps}/bin/pkill -USR1 swayidle, mode default"; "l" = "exec --no-startup-id ${lock}, mode default";
"e" = "exit, mode default"; "e" = "exit, mode default";
# TODO Sometimes, exit gets stuck on terminal. Restarting greetd helps. # TODO Sometimes, exit gets stuck on terminal. Restarting greetd helps.
"s" = "s" =
"exec --no-startup-id ${pkgs.systemd}/bin/systemctl suspend --check-inhibitors=no, mode default"; "exec --no-startup-id ${lock}, exec --no-startup-id ${pkgs.systemd}/bin/systemctl suspend --check-inhibitors=no, mode default";
"h" = "exec --no-startup-id ${pkgs.systemd}/bin/systemctl hibernate, mode default"; "h" =
"exec --no-startup-id ${lock}, exec --no-startup-id ${pkgs.systemd}/bin/systemctl hibernate, mode default";
"r" = "exec --no-startup-id ${pkgs.systemd}/bin/systemctl reboot, mode default"; "r" = "exec --no-startup-id ${pkgs.systemd}/bin/systemctl reboot, mode default";
"p" = "exec --no-startup-id ${pkgs.systemd}/bin/systemctl poweroff -i, mode default"; "p" = "exec --no-startup-id ${pkgs.systemd}/bin/systemctl poweroff -i, mode default";
}; };