From 1dc4024973a0844fb03cbf6e84103f4dbce1d1a7 Mon Sep 17 00:00:00 2001 From: Anthony Rodriguez Date: Fri, 27 Dec 2024 23:15:57 +0100 Subject: [PATCH] home-manager/programs/hypridle: set systemd service correctly for uwsm --- config/home-manager/programs/hypr/idle.nix | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/config/home-manager/programs/hypr/idle.nix b/config/home-manager/programs/hypr/idle.nix index a71e70f..12e7ddb 100644 --- a/config/home-manager/programs/hypr/idle.nix +++ b/config/home-manager/programs/hypr/idle.nix @@ -1,6 +1,8 @@ { inputs, pkgs, + lib, + config, ... }: { services.hypridle = { @@ -33,4 +35,21 @@ ]; }; }; + # needed when using uwsm as the session manager + systemd.user.services."hypridle" = lib.mkForce { + Unit = { + Description = "Hyprland's Idle Daemon"; + After = "graphical-session.target"; + X-Restart-Triggers = ["${config.xdg.configFile."hypr/hypridle.conf".source}"]; + }; + Service = { + Type = "exec"; + ExecStart = lib.getExe pkgs.hypridle; + Restart = "on-failure"; + Slice = "background-graphical.slice"; + }; + Install = { + WantedBy = ["graphical-session.target"]; + }; + }; }