Skip to content

Commit 16be056

Browse files
authored
Fix kill command syntax in set_wallpaper script (varietywalls#802)
* Fix kill command syntax in set_wallpaper script `kill` was failing in cases when multiple `swaybg` instances were running simultaneously, because it was receiving a string of PIDs as a single argument. Removing the double quotes makes it effectively end any and all `swaybg` processes. Running processes were accumulating due to this fault, making this a chinken-and-egg problem. Solved, anyway. * Loop on multiple swaybg processes Refactor PID handling to support multiple processes using a loop, in order to comply to shellcheck SC2046. * Fix syntax errors in set_wallpaper script
1 parent b454cc6 commit 16be056

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

data/scripts/set_wallpaper

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,10 @@ elif [ "$DE" == "sway" ]; then
245245
swaybg -i "$WP" -m fill &
246246
if [ -n "$PID" ]; then
247247
sleep 1
248-
kill "$PID" 2>/dev/null
248+
read -r -a PID <<< "$PID"
249+
for each_pid in "${PID[@]}"; do
250+
kill "$each_pid" 2>/dev/null
251+
done
249252
fi
250253
else
251254
swaymsg output "*" bg "$WP" fill 2>/dev/null

0 commit comments

Comments
 (0)