]> Freerunner's - dotfiles.git/commitdiff
hypr: script to apply rnd wallpaper with hyprpaper
authorAndre Ramnitz <tux.rising@gmail.com>
Sun, 27 Apr 2025 01:01:21 +0000 (03:01 +0200)
committerAndre Ramnitz <tux.rising@gmail.com>
Sun, 27 Apr 2025 01:01:21 +0000 (03:01 +0200)
dot-local/bin/rndhyprpaper [new file with mode: 0755]

diff --git a/dot-local/bin/rndhyprpaper b/dot-local/bin/rndhyprpaper
new file mode 100755 (executable)
index 0000000..1af87ab
--- /dev/null
@@ -0,0 +1,11 @@
+#!/usr/bin/env bash
+
+WALLPAPER_DIR="$HOME/Bilder/Wallpapers-simple"
+CURRENT_WALL=$(hyprctl hyprpaper listloaded)
+
+# Get a random wallpaper that is not the current one
+WALLPAPER=$(find "$WALLPAPER_DIR" -type f ! -name "$(basename "$CURRENT_WALL")" | shuf -n 1)
+
+# Apply the selected wallpaper
+hyprctl hyprpaper reload ,"$WALLPAPER"
+