summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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";