os/modules/graphical/sway/swayidle.service.nix
teutat3s 9da43e427e
Some checks failed
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is failing
wip: migrate to flake-parts
2024-01-06 10:46:10 +01:00

27 lines
683 B
Nix

{
pkgs,
psCfg,
...
}: {
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";
ExecStart = ''
${pkgs.swayidle}/bin/swayidle -w \
timeout 300 '${pkgs.swaylock-bg}/bin/swaylock-bg' \
timeout 600 '${pkgs.sway}/bin/swaymsg "output * dpms off"' \
resume '${pkgs.sway}/bin/swaymsg "output * dpms on"' \
before-sleep '${pkgs.swaylock-bg}/bin/swaylock-bg'
'';
};
Install = {
WantedBy = ["sway-session.target"];
};
}