diff options
author | Franck Cuny <franck@fcuny.net> | 2022-02-13 13:06:07 -0800 |
---|---|---|
committer | Franck Cuny <franck@fcuny.net> | 2022-02-13 13:06:07 -0800 |
commit | edb0fa477009492930f19d9aa20752a7dc6261e5 (patch) | |
tree | 04fb45d51ffcb9c57ffbcf242f32584cb3e937cd /users/fcuny/desktop | |
parent | sway: run swayidle and waybar via systemd (diff) | |
download | world-edb0fa477009492930f19d9aa20752a7dc6261e5.tar.gz |
sway: need custom unit file for swayidle
I don't have access to https://github.com/nix-community/home-manager/pull/2610 yet.
Diffstat (limited to '')
-rw-r--r-- | users/fcuny/desktop/sway/sway-idle.nix | 23 |
1 files changed, 17 insertions, 6 deletions
diff --git a/users/fcuny/desktop/sway/sway-idle.nix b/users/fcuny/desktop/sway/sway-idle.nix index 7db37bf..8583a3b 100644 --- a/users/fcuny/desktop/sway/sway-idle.nix +++ b/users/fcuny/desktop/sway/sway-idle.nix @@ -1,11 +1,22 @@ { pkgs, config, ... }: { - services.swayidle = { - enable = true; - timeouts = [{ - timeout = 300; - command = "${pkgs.swaylock}/bin/swaylock -fF -c 1D2021"; - }]; + # https://github.com/nix-community/home-manager/pull/2610 + # won't be needed for ever + systemd.user.services.swayidle = { + Unit.PartOf = [ "sway-session.target" ]; + Install.WantedBy = [ "sway-session.target" ]; + + Service = { + Environment = "PATH=${pkgs.bash}/bin:${config.wayland.windowManager.sway.package}/bin"; + ExecStart = '' + ${pkgs.swayidle}/bin/swayidle -w \ + timeout 300 "${pkgs.swaylock}/bin/swaylock -f -c FFFFEA" \ + timeout 300 'swaymsg "output * dpms off"' \ + resume 'swaymsg "output * dpms on"' \ + before-sleep "${pkgs.swaylock}/bin/swaylock -f -c FFFFEA" + ''; + Restart = "on-failure"; + }; }; } |