summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSuleyman Farajli <suleyman@farajli.net>2025-10-28 15:14:41 +0400
committerSuleyman Farajli <suleyman@farajli.net>2025-10-28 15:14:41 +0400
commit36a5cd3686e3c490ad0b01b30f3f3de2364e56ba (patch)
tree27825f76c25adbc72c676db385331ebe12da5134
parent79ab2d2fb11cdc3d7ac3d6c8edd00004fed04253 (diff)
fix(swall): unlink the wallpaper symlink when clearing the wallpaper
-rwxr-xr-xscripts/gui/swall8
1 files changed, 6 insertions, 2 deletions
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}"