From 3ba35bc532e7e54c32460f1e85c63caa27dd6116 Mon Sep 17 00:00:00 2001 From: Daniil Tsivinsky Date: Wed, 20 Oct 2021 12:22:51 +0300 Subject: [PATCH] Check if path provided by user is relative --- bin/set-wallpaper | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/bin/set-wallpaper b/bin/set-wallpaper index bff411a..85d7b28 100755 --- a/bin/set-wallpaper +++ b/bin/set-wallpaper @@ -32,6 +32,10 @@ if [[ "$arg" == "--restore" ]] ; then set_wallpaper $path else + if [[ "$arg" == ./* ]] ; then + arg="$PWD/$arg" + fi + echo "$arg" > $HOME/.wallpaper echo "Saved $arg as a wallpaper but you need to run 'set-wallpaper --restore'"