aboutsummaryrefslogtreecommitdiff
path: root/setwll
diff options
context:
space:
mode:
authoriceyrazor <iceyrazor@mailfence.com>2026-05-24 02:06:58 -0500
committericeyrazor <iceyrazor@mailfence.com>2026-05-24 02:06:58 -0500
commit5b935bd395ed7401f0a1ad92d119c9d594f2796d (patch)
treed2f1359d566c87a9986e191e06c8edecaa4766cf /setwll
parent9572c2996509059d658bb393c215dd0afa90b827 (diff)
some posix changesHEADmain
new themes
Diffstat (limited to 'setwll')
-rwxr-xr-xsetwll31
1 files changed, 16 insertions, 15 deletions
diff --git a/setwll b/setwll
index 6f512ba..67e99a8 100755
--- a/setwll
+++ b/setwll
@@ -1,6 +1,6 @@
-#!/bin/bash
+#!/bin/sh
# may be moved to theme setter
-cd "$(dirname "$0")"
+cd "$(dirname "$0")" || exit
listwalls=0
unload=0
@@ -8,7 +8,7 @@ secondary=""
primary=""
all=""
-while getopts "h?lup:s:a:" opt; do
+while getopts "hlup:s:a:" opt; do
case "$opt" in
h)
printf -- "-l list wallpapers
@@ -31,13 +31,14 @@ add scripts to wallpaper_scripts for easier switching\n"
;;
a) all="$OPTARG"
;;
+ *) break ;;
esac
done
shift $((OPTIND-1))
[ "${1:-}" = "--" ] && shift
-if [ $listwalls == 1 ]; then
+if [ $listwalls = 1 ]; then
ls ./wallpaper_scripts
exit 0
fi
@@ -51,7 +52,7 @@ if [ -z "$primary" ]; then
primary="$(./wallpaper_scripts/default-primary.sh)"
else
if [ -f "./wallpaper_scripts/$primary.sh" ]; then
- primary="$(./wallpaper_scripts/$primary.sh)"
+ primary="$(./wallpaper_scripts/"$primary.sh")"
fi
fi
@@ -59,36 +60,36 @@ if [ -z "$secondary" ]; then
secondary="$(./wallpaper_scripts/default-secondary.sh)"
else
if [ -f "./wallpaper_scripts/$secondary.sh" ]; then
- secondary="$(./wallpaper_scripts/$secondary.sh)"
+ secondary="$(./wallpaper_scripts/"$secondary".sh)"
fi
fi
if [ "$WAYLAND_DISPLAY" ]; then
- if [ "$XDG_CURRENT_DESKTOP" == "sway:wlroots" ]; then
+ if [ "$XDG_CURRENT_DESKTOP" = "sway:wlroots" ]; then
PID=$(pidof swaybg)
- swaybg -o HDMI-A-1 -i "$primary" -m fill -o DP-1 -i "$secondary" -m fill & disown
+ swaybg -o HDMI-A-1 -i "$primary" -m fill -o DP-1 -i "$secondary" -m fill &
sleep 0.4s
- kill $PID
+ kill "$PID"
else
current_wal="$(hyprctl hyprpaper listactive | grep HDMI-A-1 | sed 's/HDMI-A-1 = //')"
- hyprctl hyprpaper preload $primary
+ hyprctl hyprpaper preload "$primary"
hyprctl hyprpaper wallpaper "HDMI-A-1,$primary"
- if [ $unload == 1 ]; then
+ if [ $unload = 1 ]; then
hyprctl hyprpaper unload "$current_wal"
fi
current_wal="$(hyprctl hyprpaper listactive | grep DP-1 | sed 's/DP-1 = //')"
- hyprctl hyprpaper preload $secondary
+ hyprctl hyprpaper preload "$secondary"
hyprctl hyprpaper wallpaper "DP-1,$secondary"
- if [ $unload == 1 ]; then
+ if [ $unload = 1 ]; then
hyprctl hyprpaper unload "$current_wal"
fi
fi
else
if [ -z "$1" ]; then
- nitrogen --head=0 --set-zoom-fill $primary
+ nitrogen --head=0 --set-zoom-fill "$primary"
- nitrogen --head=1 --set-zoom-fill $secondary
+ nitrogen --head=1 --set-zoom-fill "$secondary"
fi
fi