fix(swayidle): fix idle commands
This commit is contained in:
parent
eeac4793c2
commit
a93bea38ee
|
@ -2,14 +2,18 @@
|
|||
, lib
|
||||
, config
|
||||
, ... }: with lib; mkIf config.passthrough.gui {
|
||||
services.swayidle = {
|
||||
services.swayidle = let
|
||||
sway = config.wayland.windowManager.sway.package;
|
||||
swaymsg = "${sway}/bin/swaymsg";
|
||||
swaylock = "${config.programs.swaylock.package}/bin/swaylock";
|
||||
in {
|
||||
enable = true;
|
||||
systemdTarget = "sway-session.target";
|
||||
timeouts = [
|
||||
{ timeout = 600; command = "swaymsg 'output * dpms off'"; resumeCommand = "swaymsg 'output * dpms on'"; }
|
||||
{ timeout = 600; command = "${swaymsg} 'output * dpms off'"; resumeCommand = "${swaymsg} 'output * dpms on'"; }
|
||||
];
|
||||
events = [
|
||||
{ event = "before-sleep"; command = "${pkgs.swaylock-effects}/bin/swaylock -f --grace 0"; }
|
||||
{ event = "before-sleep"; command = "${swaylock} -f --grace 0"; }
|
||||
];
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in a new issue