From 36a5cd3686e3c490ad0b01b30f3f3de2364e56ba Mon Sep 17 00:00:00 2001 From: Suleyman Farajli Date: Tue, 28 Oct 2025 15:14:41 +0400 Subject: fix(swall): unlink the wallpaper symlink when clearing the wallpaper --- scripts/gui/swall | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'scripts/gui') diff --git a/scripts/gui/swall b/scripts/gui/swall index 6b56057..7628fff 100755 --- a/scripts/gui/swall +++ b/scripts/gui/swall @@ -18,8 +18,11 @@ EOF exit 0 } + check_program "xwallpaper" +SYMLINK="${XDG_CONFIG_HOME:-$HOME/.config}/wallpaper/current" + if [ "${#}" = 0 ]; then input="${XDG_DATA_HOME:-$HOME/.local/share}/wallpapers" elif [ "${#}" != 1 ] && [ "${#}" != 2 ]; then @@ -28,7 +31,9 @@ fi while getopts "hcld:" option; do case "${option}" in - c) run --reload-compositor "xwallpaper --clear" ;; + c) + unlink "${SYMLINK}" + run --reload-compositor "xwallpaper --clear" ;; d) input="${OPTARG}" ;; @@ -60,7 +65,6 @@ fi [ -z "${image}" ] && err "No image file found" -SYMLINK="${XDG_CONFIG_HOME:-$HOME/.config}/wallpaper/current" mkdir -p "$(dirname "${SYMLINK}")" && \ ln -sf "${image}" "${SYMLINK}" && \ run "xwallpaper --zoom ${image}" "${image}" -- cgit v1.2.3