2021-05-30 19:10:28 +00:00
|
|
|
pkgs:
|
|
|
|
{
|
|
|
|
Unit = {
|
|
|
|
Description = "Idle manager for Wayland";
|
|
|
|
Documentation = [ "man:swayidle(1)" ];
|
|
|
|
BindsTo = [ "graphical-session.target" ];
|
|
|
|
Wants = [ "graphical-session-pre.target" ];
|
|
|
|
After = [ "graphical-session-pre.target" ];
|
|
|
|
};
|
|
|
|
Service = {
|
|
|
|
Type = "simple";
|
2021-11-29 13:50:46 +00:00
|
|
|
Environment = "PATH=/run/current-system/sw/bin:${pkgs.sway}/bin:${pkgs.swaylock}/bin:${pkgs.swaylock-bg}/bin";
|
2021-05-30 19:10:28 +00:00
|
|
|
ExecStart = ''${pkgs.swayidle}/bin/swayidle -w \
|
|
|
|
timeout 600 'swaylock-bg' \
|
|
|
|
timeout 900 'swaymsg "output * dpms off"' \
|
|
|
|
resume 'swaymsg "output * dpms on"' \
|
|
|
|
before-sleep 'swaylock-bg'
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
Install = {
|
|
|
|
WantedBy = [ "sway-session.target" ];
|
|
|
|
};
|
|
|
|
}
|