2024-08-19 10:38:46 +00:00
|
|
|
{ pkgs, psCfg, ... }:
|
2023-11-10 18:48:06 +00:00
|
|
|
{
|
|
|
|
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 = ''
|
2023-11-11 14:43:09 +00:00
|
|
|
${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'
|
2023-11-10 18:48:06 +00:00
|
|
|
'';
|
|
|
|
};
|
|
|
|
Install = {
|
|
|
|
WantedBy = [ "sway-session.target" ];
|
|
|
|
};
|
|
|
|
}
|