mirror of
https://github.com/nmasur/dotfiles
synced 2024-11-23 01:05:38 +00:00
fix: i3 lock on sleep
This commit is contained in:
parent
ec4dcbd3a6
commit
490c78714f
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
let
|
let
|
||||||
|
|
||||||
lockCmd = ''exec i3lock --nofork --color "${config.gui.colorscheme.base00}"'';
|
lockCmd = ''i3lock --nofork --color "${config.gui.colorscheme.base00}"'';
|
||||||
|
|
||||||
in {
|
in {
|
||||||
|
|
||||||
@ -124,7 +124,7 @@ in {
|
|||||||
"${modifier}+Shift+r" = "restart";
|
"${modifier}+Shift+r" = "restart";
|
||||||
"${modifier}+Shift+q" = ''
|
"${modifier}+Shift+q" = ''
|
||||||
exec "i3-nagbar -t warning -m 'You pressed the exit shortcut. Do you really want to exit i3? This will end your X session.' -B 'Yes, exit i3' 'i3-msg exit'"'';
|
exec "i3-nagbar -t warning -m 'You pressed the exit shortcut. Do you really want to exit i3? This will end your X session.' -B 'Yes, exit i3' 'i3-msg exit'"'';
|
||||||
"${modifier}+Shift+x" = lockCmd;
|
"${modifier}+Shift+x" = "exec ${lockCmd}";
|
||||||
|
|
||||||
# Window options
|
# Window options
|
||||||
"${modifier}+q" = "kill";
|
"${modifier}+q" = "kill";
|
||||||
@ -238,6 +238,19 @@ in {
|
|||||||
extraConfig = "";
|
extraConfig = "";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
systemd.services.lock = {
|
||||||
|
description = "Lock the screen on resume from suspend";
|
||||||
|
before = [ "sleep.target" "suspend.target" ];
|
||||||
|
serviceConfig = {
|
||||||
|
User = config.user;
|
||||||
|
Type = "forking";
|
||||||
|
Environment = "DISPLAY=:0";
|
||||||
|
ExecStart = ''
|
||||||
|
${pkgs.i3lock}/bin/i3lock --color "${config.gui.colorscheme.base00}"'';
|
||||||
|
};
|
||||||
|
wantedBy = [ "sleep.target" "suspend.target" ];
|
||||||
|
};
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user