aboutsummaryrefslogtreecommitdiff
path: root/wallpaper/setRandomWP.sh
diff options
context:
space:
mode:
authorInigoGutierrez <inigogf.95@gmail.com>2022-09-20 13:54:01 +0200
committerInigoGutierrez <inigogf.95@gmail.com>2022-09-20 13:54:01 +0200
commit48cec0cfbf1a9b27d4e8d11f7cf2cf66e48362d3 (patch)
tree00b3ca57b5b5bd70228cd769375aa150a4719ebf /wallpaper/setRandomWP.sh
parent2cd81ede4a0a6b540cf370c4ef222277b8b867a6 (diff)
downloadscripts-48cec0cfbf1a9b27d4e8d11f7cf2cf66e48362d3.tar.gz
scripts-48cec0cfbf1a9b27d4e8d11f7cf2cf66e48362d3.zip
Implemented wallpaper history navigation and organized wallpaper scripts.
Diffstat (limited to 'wallpaper/setRandomWP.sh')
-rwxr-xr-xwallpaper/setRandomWP.sh9
1 files changed, 9 insertions, 0 deletions
diff --git a/wallpaper/setRandomWP.sh b/wallpaper/setRandomWP.sh
new file mode 100755
index 0000000..218e68b
--- /dev/null
+++ b/wallpaper/setRandomWP.sh
@@ -0,0 +1,9 @@
+#!/bin/sh
+
+# Sets a random image as wallpaper and soft-links it from home folder.
+
+wpsFolder="$CONFIG_FOLDER_RANDOMWP"
+[ -z "$wpsFolder" ] && dunstify '$CONFIG_FOLDER_RANDOMWP env variable not set.' && exit 0
+[ ! -d "$wpsFolder" ] && dunstify "'$CONFIG_FOLDER_RANDOMWP' folder does not exist." && exit 0
+wpFile="$(find "$CONFIG_FOLDER_RANDOMWP" | shuf -n 1)"
+wpPointer.sh "$wpFile"