From df93b8f1f4f8f57ef3ab7ca735becf190074b031 Mon Sep 17 00:00:00 2001 From: Christoph Urlacher Date: Thu, 13 Nov 2025 21:11:03 +0100 Subject: [PATCH] Modules/Hyprland: Ensure hypr-utils only start on hyprland session --- home/modules/hyprland/autostart.nix | 1 + home/modules/hyprland/default.nix | 24 ++++++++++-------------- home/modules/hyprpanel/default.nix | 2 +- 3 files changed, 12 insertions(+), 15 deletions(-) diff --git a/home/modules/hyprland/autostart.nix b/home/modules/hyprland/autostart.nix index 82f6b41c..cdf2cb29 100644 --- a/home/modules/hyprland/autostart.nix +++ b/home/modules/hyprland/autostart.nix @@ -13,6 +13,7 @@ builtins.concatLists [ "hyprctl setcursor ${config.home.pointerCursor.name} ${builtins.toString config.home.pointerCursor.size}" "hyprsunset --identity" + "hyprpanel" # HACK: Hyprland doesn't set the xwayland/x11 keymap correctly "setxkbmap -layout ${hyprland.keyboard.layout} -variant ${hyprland.keyboard.variant} -option ${hyprland.keyboard.option} -model pc104" diff --git a/home/modules/hyprland/default.nix b/home/modules/hyprland/default.nix index 6cdc4e33..17649577 100644 --- a/home/modules/hyprland/default.nix +++ b/home/modules/hyprland/default.nix @@ -113,20 +113,6 @@ in { programs = { hyprlock = import ./hyprlock.nix {inherit config hyprland color;}; - - # TODO: IMV shouldn't be part of the hyprland module - imv = { - enable = true; - settings = { - options = { - background = "${color.hex.base}"; - overlay = true; - overlay_font = "${color.font}:12"; - overlay_background_color = "${color.hex.accent}"; - overlay_text_color = "${color.hex.accentText}"; - }; - }; - }; }; services = { @@ -136,6 +122,16 @@ in { hyprpaper = import ./hyprpaper.nix {inherit config hyprland color;}; }; + # Make sure the units only start when using Hyprland + systemd.user.services.dunst.Unit.After = lib.mkIf hyprland.dunst.enable (lib.mkForce ["hyprland-session.target"]); + systemd.user.services.dunst.Unit.PartOf = lib.mkIf hyprland.dunst.enable (lib.mkForce ["hyprland-session.target"]); + systemd.user.services.hypridle.Install.WantedBy = lib.mkForce ["hyprland-session.target"]; + systemd.user.services.hypridle.Unit.After = lib.mkForce ["hyprland-session.target"]; + systemd.user.services.hypridle.Unit.PartOf = lib.mkForce ["hyprland-session.target"]; + systemd.user.services.hyprpaper.Install.WantedBy = lib.mkForce ["hyprland-session.target"]; + systemd.user.services.hyprpaper.Unit.After = lib.mkForce ["hyprland-session.target"]; + systemd.user.services.hyprpaper.Unit.PartOf = lib.mkForce ["hyprland-session.target"]; + wayland.windowManager.hyprland = { enable = true; package = inputs.hyprland.packages.${pkgs.system}.hyprland; diff --git a/home/modules/hyprpanel/default.nix b/home/modules/hyprpanel/default.nix index 10d4fafd..317adf29 100644 --- a/home/modules/hyprpanel/default.nix +++ b/home/modules/hyprpanel/default.nix @@ -13,7 +13,7 @@ in { config = lib.mkIf hyprpanel.enable { programs.hyprpanel = { enable = true; - systemd.enable = true; + systemd.enable = false; settings = { #