summaryrefslogtreecommitdiff
path: root/.local/bin
diff options
context:
space:
mode:
Diffstat (limited to '.local/bin')
-rwxr-xr-x.local/bin/randomwall17
1 files changed, 17 insertions, 0 deletions
diff --git a/.local/bin/randomwall b/.local/bin/randomwall
new file mode 100755
index 0000000..fee4482
--- /dev/null
+++ b/.local/bin/randomwall
@@ -0,0 +1,17 @@
+#!/bin/bash
+WALL_DIR="$HOME/pix/wallpapers/onedarkwallpapers/"
+NEW_WALL=$(find "$WALL_DIR" -type f | shuf -n 1)
+
+if ! pgrep -x hyprpaper >/dev/null; then
+ # hyprpaper not running → write config and start it
+ cat > ~/.config/hypr/hyprpaper.conf <<EOF
+preload = $NEW_WALL
+wallpaper = ,$NEW_WALL
+EOF
+ hyprpaper &
+else
+ # hyprpaper is running → just update it live
+ hyprctl hyprpaper preload "$NEW_WALL"
+ hyprctl hyprpaper wallpaper ",$NEW_WALL"
+fi
+