From 84255161ce73b47511875c0f5d83c932394fff91 Mon Sep 17 00:00:00 2001 From: Asocia Date: Sun, 22 Aug 2021 11:41:54 +0300 Subject: [PATCH] Simplify the script --- scripts/dynamic-wallpaper.sh | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/scripts/dynamic-wallpaper.sh b/scripts/dynamic-wallpaper.sh index caa6d64..6fbf894 100755 --- a/scripts/dynamic-wallpaper.sh +++ b/scripts/dynamic-wallpaper.sh @@ -22,11 +22,7 @@ else fi path="$wallpaper_set/$num.$format" echo "path: $path" -if [[ (-L "$path") ]]; then - actual_file=$(readlink -f $path) -else - actual_file=$path -fi +actual_file=$(readlink -f $path) set_wallpaper() { wal -st -i $1 --backend=haishoku @@ -36,7 +32,5 @@ set_wallpaper() { } # if the current wallpaper is different than the previous one, set it -if [[ $(< ~/.last_wallpaper_path) != "$actual_file" ]]; then - set_wallpaper $path -fi +[[ $(< ~/.last_wallpaper_path) != "$actual_file" ]] && set_wallpaper $actual_file echo "$actual_file" > ~/.last_wallpaper_path