Skip to content

Commit

Permalink
nixos/hypridle: check XDG_SESSION_DESKTOP as well
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnRTitor committed Nov 12, 2024
1 parent 7bcef72 commit 0021223
Showing 1 changed file with 15 additions and 9 deletions.
24 changes: 15 additions & 9 deletions nixos/modules/services/wayland/hypridle.nix
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,21 @@ in

systemd = {
packages = [ cfg.package ];
user.services.hypridle.wantedBy = [ "graphical-session.target" ];
# Essential package needed for the service to run properly
user.services.hypridle.path = [
config.programs.hyprland.package
config.programs.hyprlock.package
pkgs.procps
];
# Should only be started if a Hyprland session is active
user.services.hypridle.unitConfig.ConditionPathIsDirectory = "/run/user/%U/hypr";

user.services.hypridle = {
wantedBy = [ "graphical-session.target" ];

# Essential package needed for the service to run properly
path = [
config.programs.hyprland.package
config.programs.hyprlock.package
pkgs.procps
];

# Should only be started if a Hyprland session is active
unitConfig.ConditionPathIsDirectory = "/run/user/%U/hypr";
unitConfig.ConditionEnvironment = "XDG_SESSION_DESKTOP=Hyprland";

This comment has been minimized.

Copy link
@Vladimir-csp

Vladimir-csp Nov 12, 2024

This would work only if XDG_SESSION_DESKTOP is set and only if it is set to Hyprland. Uwsm does that (it takes the first item of XDG_CURRENT_DESKTOP), but other solutions may not.

};
};
};

Expand Down

0 comments on commit 0021223

Please sign in to comment.