2023-10-07 14:45:42 +00:00
|
|
|
{
|
|
|
|
pkgs,
|
2024-09-04 20:28:41 +00:00
|
|
|
config,
|
2023-10-07 14:45:42 +00:00
|
|
|
...
|
2024-09-04 20:28:41 +00:00
|
|
|
}: with pkgs; ''
|
2024-08-18 22:22:59 +00:00
|
|
|
# Set shut down, restart and locking features
|
2023-10-07 14:45:42 +00:00
|
|
|
''
|
2024-08-18 22:22:59 +00:00
|
|
|
+ (
|
2024-09-04 20:28:41 +00:00
|
|
|
if config.pub-solar.core.hibernation.enable
|
2024-08-18 22:22:59 +00:00
|
|
|
then ''
|
|
|
|
set $mode_system (e)xit, (l)ock, (h)ibernate, (r)eboot, (Shift+s)hutdown
|
|
|
|
''
|
|
|
|
else ''
|
|
|
|
set $mode_system (e)xit, (l)ock, (r)eboot, (Shift+s)hutdown
|
|
|
|
''
|
|
|
|
)
|
|
|
|
+ ''
|
|
|
|
bindsym $mod+0 mode "$mode_system"
|
2023-10-07 14:45:42 +00:00
|
|
|
|
2024-08-18 22:22:59 +00:00
|
|
|
mode "$mode_system" {
|
|
|
|
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
|
|
|
''
|
2024-08-18 22:22:59 +00:00
|
|
|
+ (
|
2024-09-04 20:28:41 +00:00
|
|
|
if config.pub-solar.core.hibernation.enable
|
2024-08-18 22:22:59 +00:00
|
|
|
then ''
|
|
|
|
bindsym h exec ${systemd}/bin/systemctl hibernate, mode "default"
|
|
|
|
''
|
|
|
|
else ""
|
|
|
|
)
|
|
|
|
+ ''
|
|
|
|
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
|
|
|
|
2024-08-18 22:22:59 +00:00
|
|
|
# exit system mode: "Enter" or "Escape"
|
|
|
|
bindsym Return mode "default"
|
|
|
|
bindsym Escape mode "default"
|
|
|
|
}
|
|
|
|
''
|