Install swww-daemon as a systemd unit instead of using hyprctl

This commit is contained in:
Evie Litherland-Smith 2024-12-27 06:44:18 +00:00
parent 563f398571
commit c0e31d7690
2 changed files with 24 additions and 14 deletions

View file

@ -149,8 +149,6 @@
"${config.wayland.windowManager.hyprland.finalPackage}/bin/hyprctl setcursor ${config.gtk.cursorTheme.name} ${toString config.gtk.cursorTheme.size}" "${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" "${pkgs.libsForQt5.polkit-kde-agent}/libexec/polkit-kde-authentication-agent-1"
"PASSWORD_STORE_DIR=/dev/null ${pkgs.protonmail-bridge}/bin/protonmail-bridge -n" "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" "sleep 5; ${pkgs.dex}/bin/dex -a"
]; ];
gestures.workspace_swipe = true; gestures.workspace_swipe = true;

View file

@ -24,7 +24,31 @@ let
''; '';
in in
{ {
home.packages = with pkgs; [ swww ];
systemd.user = { 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 = { timers.dynamic-wallpaper = {
Install.WantedBy = [ "timers.target" ]; Install.WantedBy = [ "timers.target" ];
Timer = { Timer = {
@ -32,17 +56,5 @@ in
Unit = "dynamic-wallpaper.service"; 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 ];
} }