Fix swayidle, lock, waybar menu
This commit is contained in:
parent
a7f5b9de2a
commit
612e5e35c0
|
@ -1,6 +1,13 @@
|
|||
{ psCfg, ... }: ''
|
||||
{ pkgs, psCfg, ... }: ''
|
||||
# Set shut down, restart and locking features
|
||||
'' + (if psCfg.core.hibernation.enable && !psCfg.paranoia.enable then ''
|
||||
set $mode_system (e)xit, (h)ibernate, (l)ock, (s)uspend, (r)eboot, (Shift+s)hutdown
|
||||
'' else if psCfg.paranoia.enable then ''
|
||||
set $mode_system (e)xit, (h)ibernate, (r)eboot, (Shift+s)hutdown
|
||||
'' else ''
|
||||
set $mode_system (e)xit, (l)ock, (s)uspend, (r)eboot, (Shift+s)hutdown
|
||||
'')
|
||||
+ ''
|
||||
bindsym $mod+0 mode "$mode_system"
|
||||
mode "$mode_system" {
|
||||
bindsym e exec swaymsg exit, mode "default"
|
||||
|
@ -8,7 +15,7 @@
|
|||
bindsym h exec systemctl hibernate, mode "default"
|
||||
'' else "")
|
||||
+ (if !psCfg.paranoia.enable then ''
|
||||
bindsym l exec swaylock-bg, mode "default"
|
||||
bindsym l exec ${pkgs.swaylock-bg}/bin/swaylock-bg, mode "default"
|
||||
bindsym s exec systemctl suspend, mode "default"
|
||||
'' else "") + ''
|
||||
bindsym r exec systemctl reboot, mode "default"
|
||||
|
|
|
@ -98,7 +98,7 @@ in
|
|||
xdg.configFile."sway/config.d/theme.conf".source = ./config/config.d/theme.conf;
|
||||
xdg.configFile."sway/config.d/gaps.conf".source = ./config/config.d/gaps.conf;
|
||||
xdg.configFile."sway/config.d/custom-keybindings.conf".source = ./config/config.d/custom-keybindings.conf;
|
||||
xdg.configFile."sway/config.d/mode_system.conf".text = import ./config/config.d/mode_system.conf.nix { inherit psCfg; };
|
||||
xdg.configFile."sway/config.d/mode_system.conf".text = import ./config/config.d/mode_system.conf.nix { inherit pkgs psCfg; };
|
||||
xdg.configFile."sway/config.d/applications.conf".source = ./config/config.d/applications.conf;
|
||||
xdg.configFile."sway/config.d/systemd.conf".source = ./config/config.d/systemd.conf;
|
||||
};
|
||||
|
|
|
@ -9,14 +9,14 @@
|
|||
};
|
||||
Service = {
|
||||
Type = "simple";
|
||||
Environment = "PATH=/run/current-system/sw/bin:${pkgs.sway}/bin";
|
||||
ExecStart = ''${pkgs.swayidle}/bin/swayidle -w \
|
||||
Environment = "PATH=/run/current-system/sw/bin:${pkgs.sway}/bin:${pkgs.swaylock-bg}/bin:${pkgs.swayidle}/bin";
|
||||
ExecStart = ''swayidle -w \
|
||||
after-resume 'swaymsg "output * dpms on"' \
|
||||
before-sleep '${pkgs.swaylock-bg}/bin/swaylock-bg' '' + (if psCfg.paranoia.enable then '' \
|
||||
before-sleep 'swaylock-bg' '' + (if psCfg.paranoia.enable then '' \
|
||||
timeout 120 'swaymsg "output * dpms off"' resume 'swaymsg "output * dpms on"' \
|
||||
timeout 150 'systemctl hibernate'
|
||||
'' else '' \
|
||||
timeout 600 '${pkgs.swaylock-bg}/bin/swaylock-bg' \
|
||||
timeout 600 'swaylock-bg' \
|
||||
timeout 900 'swaymsg "output * dpms off"' resume 'swaymsg "output * dpms on"'
|
||||
'');
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue