From 621cd379f56bd0854e63d7e62df23fbf5297b422 Mon Sep 17 00:00:00 2001 From: Adithya Nair Date: Sat, 1 Jun 2024 02:20:50 +0530 Subject: [PATCH] remove wallpaper downloader timer and make it a flake output --- extra-packages/scripts/getpaper/getpaper.sh | 2 +- flake.nix | 1 + home/wm/addon/default.nix | 1 - home/wm/addon/wallpaper.nix | 37 --------------------- 4 files changed, 2 insertions(+), 39 deletions(-) delete mode 100644 home/wm/addon/wallpaper.nix diff --git a/extra-packages/scripts/getpaper/getpaper.sh b/extra-packages/scripts/getpaper/getpaper.sh index 8574b65..ecf3dd7 100755 --- a/extra-packages/scripts/getpaper/getpaper.sh +++ b/extra-packages/scripts/getpaper/getpaper.sh @@ -19,7 +19,7 @@ fi CONFIG="$(cat "${CONFIG_FILE}")" -DIR="$1" +DIR="${1:-}" if [ -z "${DIR}" ]; then DIR="${XDG_PICTURES_DIR:-${HOME}/Pictures}/Wallpapers" echo "Warning: wallpaper directory not set. using fallback directory ${DIR}" >&2 diff --git a/flake.nix b/flake.nix index 82bc8e9..f7d3844 100644 --- a/flake.nix +++ b/flake.nix @@ -95,6 +95,7 @@ statix ]; }; + packages.getpaper = (import ./extra-packages pkgs).getpaper; } ); } diff --git a/home/wm/addon/default.nix b/home/wm/addon/default.nix index 8a71085..fecc2ed 100644 --- a/home/wm/addon/default.nix +++ b/home/wm/addon/default.nix @@ -8,6 +8,5 @@ ./hypridle.nix ./kanshi.nix ./wpaperd.nix - ./wallpaper.nix ]; } diff --git a/home/wm/addon/wallpaper.nix b/home/wm/addon/wallpaper.nix deleted file mode 100644 index 4a0b1d1..0000000 --- a/home/wm/addon/wallpaper.nix +++ /dev/null @@ -1,37 +0,0 @@ -{ config, extra-packages, ... }: -let - wallpaper-downloader = "${extra-packages.getpaper}/bin/getpaper"; -in -{ - systemd.user = { - services = { - getpaper = { - Unit = { - Description = "Wallpaper Downloader"; - After = [ "graphical-session.target" "gnome-keyring.service" ]; - Wants = "gnome-keyring.service"; - - }; - Service = { - Type = "oneshot"; - Restart = "on-failure"; - ExecStart = ''${wallpaper-downloader} "${config.xdg.userDirs.pictures}/Wallpapers"''; - }; - }; - }; - timers = { - getpaper = { - Unit = { - Description = "Wallpaper Downloader"; - }; - Install = { - WantedBy = [ "default.target" ]; - }; - Timer = { - OnCalendar = "00:00:00"; - Persistent = true; - }; - }; - }; - }; -}