Benjamin Bädorf
4c0991c7e1
Hibernation is now a core option: ``` pub-solar.core.hibernation.enable = true; ``` And there's a paranoia mode, that keeps the disk encrypted as much as possible by enabling hibernation and removing the options for sleep, screen locking. Idle locking now hibernates, and it does it on very short notice.
22 lines
736 B
Nix
22 lines
736 B
Nix
{ psCfg, ... }: ''
|
|
# 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.allow-hibernation then ''
|
|
bindsym h exec systemctl hibernate, mode "default"
|
|
'' else "")
|
|
+ (if !psCfg.paranoia.enable then ''
|
|
bindsym l exec swaylock-bg, mode "default"
|
|
bindsym s exec systemctl suspend, mode "default"
|
|
'' else "") + ''
|
|
bindsym r exec systemctl reboot, mode "default"
|
|
bindsym Shift+s exec systemctl poweroff, mode "default"
|
|
|
|
# exit system mode: "Enter" or "Escape"
|
|
bindsym Return mode "default"
|
|
bindsym Escape mode "default"
|
|
}
|
|
''
|