pub-solar-os/modules/sway/swayidle.service.nix

22 lines
581 B
Nix
Raw Normal View History

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";
2022-01-12 16:39:16 +00:00
Environment = "PATH=/run/current-system/sw/bin:${pkgs.sway}/bin";
2021-05-30 19:10:28 +00:00
ExecStart = ''${pkgs.swayidle}/bin/swayidle -w \
2022-05-01 15:04:29 +00:00
timeout 150 'swaymsg "output * dpms off"' \
timeout 300 'systemctl hibernate' \
2021-05-30 19:10:28 +00:00
'';
};
Install = {
WantedBy = [ "sway-session.target" ];
};
}