From 928fa4d2cabac9fcfaadfcd58b44bc7dd53c1870 Mon Sep 17 00:00:00 2001 From: Adithya Nair Date: Sun, 21 Apr 2024 22:46:14 +0530 Subject: [PATCH] run swww-daemon on graphical.target --- home/wm/addon/default.nix | 1 + home/wm/addon/swww.nix | 15 +++++++++++++++ packages/scripts/chpaper.sh | 1 - 3 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 home/wm/addon/swww.nix diff --git a/home/wm/addon/default.nix b/home/wm/addon/default.nix index 7d29324..e0829cc 100644 --- a/home/wm/addon/default.nix +++ b/home/wm/addon/default.nix @@ -6,5 +6,6 @@ ./kanshi.nix ./swayidle.nix ./swaylock.nix + ./swww.nix ]; } diff --git a/home/wm/addon/swww.nix b/home/wm/addon/swww.nix new file mode 100644 index 0000000..113e08c --- /dev/null +++ b/home/wm/addon/swww.nix @@ -0,0 +1,15 @@ +{ pkgs, ... }: { + systemd.user.services.swww-daemon = { + Unit = { + Description = "Solution for Wayland Wallpaper Woes"; + Documentation = "https://github.com/LGFae/swww"; + PartOf = [ "graphical-session.target" ]; + After = [ "graphical-session-pre.target" ]; + }; + Service = { + ExecStart = "${pkgs.swww}/bin/swww-daemon"; + Restart = "on-failure"; + KillMode = "mixed"; + }; + }; +} diff --git a/packages/scripts/chpaper.sh b/packages/scripts/chpaper.sh index 75c5df2..242cb40 100755 --- a/packages/scripts/chpaper.sh +++ b/packages/scripts/chpaper.sh @@ -16,6 +16,5 @@ random_paper() { fi } -swww query || swww init convert "$(random_paper)" /tmp/wallpaper.jpg && swww img --transition-step 2 --transition-type random --transition-duration 1 "/tmp/wallpaper.jpg"