aboutsummaryrefslogtreecommitdiff
path: root/setRandomBG.sh
diff options
context:
space:
mode:
authorInigoGutierrez <inigogf.95@gmail.com>2020-12-12 14:34:50 +0100
committerInigoGutierrez <inigogf.95@gmail.com>2020-12-12 14:34:50 +0100
commit8b1f6ba1f5c8df81646fb64597026747ba4d3d87 (patch)
tree1ddc1fd898599195efd40ac0d4952432cd408c25 /setRandomBG.sh
parent8cb589fa44926b341e71373ed8f815528cfb67cc (diff)
downloadscripts-8b1f6ba1f5c8df81646fb64597026747ba4d3d87.tar.gz
scripts-8b1f6ba1f5c8df81646fb64597026747ba4d3d87.zip
Now setRandomBG.sh creates a softlink to the wallpaper at ~.
Diffstat (limited to 'setRandomBG.sh')
-rwxr-xr-xsetRandomBG.sh6
1 files changed, 4 insertions, 2 deletions
diff --git a/setRandomBG.sh b/setRandomBG.sh
index 1bba002..d7c5669 100755
--- a/setRandomBG.sh
+++ b/setRandomBG.sh
@@ -1,8 +1,10 @@
#!/bin/sh
-# Sets a random image as wallpaper.
+# Sets a random image as wallpaper and soft-links it from home folder.
bgsFolder="$CONFIG_FOLDER_RANDOMBG"
[ -z "$bgsFolder" ] && dunstify '$CONFIG_FOLDER_RANDOMBG env variable not set.' && exit 0
[ ! -d "$bgsFolder" ] && dunstify "'$CONFIG_FOLDER_RANDOMBG' folder does not exist." && exit 0
-feh --bg-max "$(ls -d "$CONFIG_FOLDER_RANDOMBG"/* | shuf -n 1)"
+wpFile="$(ls -d "$CONFIG_FOLDER_RANDOMBG"/* | shuf -n 1)"
+feh --bg-max "$wpFile"
+ln -sf "$wpFile" "${HOME}/wp"