pub-solar-os/modules/sway/config/config.d/mode_system.conf.nix

22 lines
749 B
Nix
Raw Normal View History

{ psCfg, ... }: ''
2022-08-14 17:59:01 +00:00
# Set shut down, restart and locking features
set $mode_system (e)xit, (h)ibernate, (r)eboot, (Shift+s)hutdown
bindsym $mod+0 mode "$mode_system"
mode "$mode_system" {
bindsym e exec swaymsg exit, mode "default"
'' + (if psCfg.core.hibernation.enable then ''
2022-08-14 17:59:01 +00:00
bindsym h exec systemctl hibernate, mode "default"
'' else "")
2022-08-14 17:59:01 +00:00
+ (if !psCfg.paranoia.enable then ''
bindsym l exec swaylock-bg, mode "default"
bindsym s exec systemctl suspend, mode "default"
'' else "") + ''
2022-08-14 17:59:01 +00:00
bindsym r exec systemctl reboot, mode "default"
bindsym Shift+s exec systemctl poweroff, mode "default"
2022-08-14 17:59:01 +00:00
# exit system mode: "Enter" or "Escape"
bindsym Return mode "default"
bindsym Escape mode "default"
}
''