os/modules/graphical/sway/config/config.d/mode_system.conf.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

40 lines
1,001 B
Nix
Raw Normal View History

{
pkgs,
config,
...
}: with pkgs; ''
2024-08-18 22:22:59 +00:00
# Set shut down, restart and locking features
''
2024-08-18 22:22:59 +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"
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"
''
2024-08-18 22:22:59 +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"
2024-08-18 22:22:59 +00:00
# exit system mode: "Enter" or "Escape"
bindsym Return mode "default"
bindsym Escape mode "default"
}
''