2023-10-07 14:45:42 +00:00
|
|
|
{
|
|
|
|
pkgs,
|
|
|
|
psCfg,
|
|
|
|
...
|
2024-03-21 12:20:31 +00:00
|
|
|
}: with pkgs;
|
2023-10-07 14:45:42 +00:00
|
|
|
''
|
|
|
|
# Set shut down, restart and locking features
|
|
|
|
''
|
|
|
|
+ (
|
|
|
|
if psCfg.core.hibernation.enable
|
|
|
|
then ''
|
2024-03-21 12:20:31 +00:00
|
|
|
set $mode_system (e)xit, (l)ock, (h)ibernate, (r)eboot, (Shift+s)hutdown
|
2023-10-07 14:45:42 +00:00
|
|
|
''
|
|
|
|
else ''
|
2024-03-21 12:20:31 +00:00
|
|
|
set $mode_system (e)xit, (l)ock, (r)eboot, (Shift+s)hutdown
|
2023-10-07 14:45:42 +00:00
|
|
|
''
|
|
|
|
)
|
|
|
|
+ ''
|
|
|
|
bindsym $mod+0 mode "$mode_system"
|
|
|
|
|
|
|
|
mode "$mode_system" {
|
2024-03-21 12:20:31 +00:00
|
|
|
bindsym e exec ${sway}/bin/swaymsg exit, mode "default"
|
|
|
|
bindsym l exec ${swaylock-bg}/bin/swaylock-bg, mode "default"
|
2023-10-07 14:45:42 +00:00
|
|
|
''
|
|
|
|
+ (
|
|
|
|
if psCfg.core.hibernation.enable
|
|
|
|
then ''
|
2024-03-21 12:20:31 +00:00
|
|
|
bindsym h exec ${systemd}/bin/systemctl hibernate, mode "default"
|
2023-10-07 14:45:42 +00:00
|
|
|
''
|
|
|
|
else ""
|
|
|
|
)
|
|
|
|
+ ''
|
2024-03-21 12:20:31 +00:00
|
|
|
bindsym r exec ${systemd}/bin/systemctl reboot, mode "default"
|
|
|
|
bindsym Shift+s exec ${systemd}/bin/systemctl poweroff, mode "default"
|
2023-10-07 14:45:42 +00:00
|
|
|
|
|
|
|
# exit system mode: "Enter" or "Escape"
|
|
|
|
bindsym Return mode "default"
|
|
|
|
bindsym Escape mode "default"
|
|
|
|
}
|
|
|
|
''
|