sway: cleaned up random wallpaper script

This commit is contained in:
Aly Raffauf 2024-04-26 16:52:36 -04:00
parent aef572f922
commit 55f5b50754

View file

@ -12,14 +12,13 @@
if [ -d "$directory" ]; then if [ -d "$directory" ]; then
while true; do while true; do
for pid in ''${OLD_PIDS[@]}; do for pid in ''${OLD_PIDS[@]}; do
kill $pid kill $pid
done done
OLD_PIDS=() OLD_PIDS=()
monitor=`${config.wayland.windowManager.sway.package}/bin/swaymsg -t get_outputs -p | grep Output | awk '{print $2}'` monitor=`${config.wayland.windowManager.sway.package}/bin/swaymsg -t get_outputs -p | grep Output | awk '{print $2}'`
for m in ''${monitor[@]}; do for m in ''${monitor[@]}; do
random_background=$(ls $directory/*.{png,jpg} | shuf -n 1) random_background=$(ls $directory/*.{png,jpg} | shuf -n 1)
${pkgs.swaybg}/bin/swaybg -o $m -i $random_background & ${pkgs.swaybg}/bin/swaybg -o $m -i $random_background &