summaryrefslogtreecommitdiffstats
path: root/set-background.sh
diff options
context:
space:
mode:
authorFlorian Pritz <f-p@gmx.at>2009-03-12 16:31:19 +0100
committerFlorian Pritz <f-p@gmx.at>2009-03-12 16:31:19 +0100
commit4288846de96725d4050cfd7641f30ef979916490 (patch)
tree11f3abe88c2ae8a4ceb9c2fe61eedcc2180f3e28 /set-background.sh
parent726df9003dd78bfab19967c3c72d057dd55dcaca (diff)
downloadbin-4288846de96725d4050cfd7641f30ef979916490.tar.gz
bin-4288846de96725d4050cfd7641f30ef979916490.tar.xz
symlinks absolute path
Slim dies if it can't find the background image, but it won't find it if the symlink is relative.
Diffstat (limited to 'set-background.sh')
-rwxr-xr-xset-background.sh5
1 files changed, 4 insertions, 1 deletions
diff --git a/set-background.sh b/set-background.sh
index 811157a..e21fbea 100755
--- a/set-background.sh
+++ b/set-background.sh
@@ -23,7 +23,10 @@ if [ "$1" = "" ] || [ "$1" = "-h" ]; then
exit 1
fi
-FILE=$1
+cd "$(dirname "$1")"
+
+FILE="$(pwd)/$(basename "$1")"
+
if [ -f $FILE ]; then
echo "feh --bg-center ${FILE}" > "$HOME/.fehbg";
rm "$HOME/backgrounds/current_bg";