2022-10-01 21:12:48 +00:00
|
|
|
{
|
|
|
|
pkgs,
|
|
|
|
psCfg,
|
|
|
|
...
|
|
|
|
}:
|
|
|
|
''
|
2022-08-14 17:59:01 +00:00
|
|
|
# Set shut down, restart and locking features
|
2022-10-01 21:12:48 +00:00
|
|
|
''
|
|
|
|
+ (
|
2024-01-06 09:46:10 +00:00
|
|
|
if psCfg.core.hibernation.enable
|
2022-10-01 21:12:48 +00:00
|
|
|
then ''
|
|
|
|
set $mode_system (e)xit, (h)ibernate, (l)ock, (s)uspend, (r)eboot, (Shift+s)hutdown
|
|
|
|
''
|
|
|
|
else ''
|
|
|
|
set $mode_system (e)xit, (l)ock, (s)uspend, (r)eboot, (Shift+s)hutdown
|
|
|
|
''
|
|
|
|
)
|
|
|
|
+ ''
|
2022-08-14 17:59:01 +00:00
|
|
|
bindsym $mod+0 mode "$mode_system"
|
2024-01-06 09:46:10 +00:00
|
|
|
|
2022-08-14 17:59:01 +00:00
|
|
|
mode "$mode_system" {
|
2024-01-06 09:46:10 +00:00
|
|
|
bindsym e exec swaymsg exit, mode "default"
|
2022-08-24 16:43:11 +00:00
|
|
|
''
|
|
|
|
+ (
|
|
|
|
if psCfg.core.hibernation.enable
|
|
|
|
then ''
|
2022-10-01 21:12:48 +00:00
|
|
|
bindsym h exec systemctl hibernate, mode "default"
|
2022-08-14 15:10:30 +00:00
|
|
|
''
|
|
|
|
else ""
|
|
|
|
)
|
2024-01-06 09:46:10 +00:00
|
|
|
+ ''
|
2022-10-01 21:12:48 +00:00
|
|
|
bindsym l exec ${pkgs.swaylock-bg}/bin/swaylock-bg, mode "default"
|
|
|
|
bindsym s exec systemctl suspend, mode "default"
|
2024-01-06 09:46:10 +00:00
|
|
|
bindsym r exec systemctl reboot, mode "default"
|
|
|
|
bindsym Shift+s exec systemctl poweroff, mode "default"
|
2022-08-14 15:10:30 +00:00
|
|
|
|
2024-01-06 09:46:10 +00:00
|
|
|
# exit system mode: "Enter" or "Escape"
|
|
|
|
bindsym Return mode "default"
|
|
|
|
bindsym Escape mode "default"
|
|
|
|
}
|
2022-08-14 15:10:30 +00:00
|
|
|
''
|