27 lines
683 B
Nix
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"];
|
|
};
|
|
}
|