From c0e31d769080e593b578f6f3ab7602b5f1ecb707 Mon Sep 17 00:00:00 2001 From: Evie Litherland-Smith Date: Fri, 27 Dec 2024 06:44:18 +0000 Subject: [PATCH] Install swww-daemon as a systemd unit instead of using hyprctl --- system/home/hyprland.nix | 2 -- system/home/swww.nix | 36 ++++++++++++++++++++++++------------ 2 files changed, 24 insertions(+), 14 deletions(-) diff --git a/system/home/hyprland.nix b/system/home/hyprland.nix index bcd7fa3e..ad8619bf 100644 --- a/system/home/hyprland.nix +++ b/system/home/hyprland.nix @@ -149,8 +149,6 @@ "${config.wayland.windowManager.hyprland.finalPackage}/bin/hyprctl setcursor ${config.gtk.cursorTheme.name} ${toString config.gtk.cursorTheme.size}" "${pkgs.libsForQt5.polkit-kde-agent}/libexec/polkit-kde-authentication-agent-1" "PASSWORD_STORE_DIR=/dev/null ${pkgs.protonmail-bridge}/bin/protonmail-bridge -n" - "${pkgs.swww}/bin/swww-daemon" - "sleep 5; systemctl --user start dynamic-wallpaper.service" "sleep 5; ${pkgs.dex}/bin/dex -a" ]; gestures.workspace_swipe = true; diff --git a/system/home/swww.nix b/system/home/swww.nix index 3acb8671..b3081696 100644 --- a/system/home/swww.nix +++ b/system/home/swww.nix @@ -24,7 +24,31 @@ let ''; in { + home.packages = with pkgs; [ swww ]; systemd.user = { + services = { + swww-daemon = { + Unit = { + Description = "SWWW Daemon"; + Wants = [ "graphical-session.target" ]; + After = [ "graphical-session.target" ]; + }; + Service.ExecStart = "${pkgs.swww}/bin/swww-daemon"; + Install.WantedBy = [ "default.target" ]; + }; + dynamic-wallpaper = { + Unit = { + Description = "Change wallpaper based on time of day"; + Wants = [ "swww-daemon.service" ]; + After = [ "swww-daemon.service" ]; + }; + Service = { + Type = "oneshot"; + ExecStart = "${dynamicWallpaper}/bin/dynamic-wallpaper"; + }; + Install.WantedBy = [ "default.target" ]; + }; + }; timers.dynamic-wallpaper = { Install.WantedBy = [ "timers.target" ]; Timer = { @@ -32,17 +56,5 @@ in Unit = "dynamic-wallpaper.service"; }; }; - services.dynamic-wallpaper = { - Unit = { - Description = "Change wallpaper based on time of day"; - Wants = [ "graphical-session.target" ]; - After = [ "graphical-session.target" ]; - }; - Service = { - Type = "oneshot"; - ExecStart = "${dynamicWallpaper}/bin/dynamic-wallpaper"; - }; - }; }; - home.packages = with pkgs; [ swww ]; }