randwall 1.1 KB

1234567891011121314151617181920212223242526272829303132333435
  1. #!/usr/bin/env bash
  2. # Initialize swww daemon if not running
  3. if ! pgrep -x "swww-daemon" >/dev/null; then
  4. swww-daemon &
  5. sleep 1
  6. fi
  7. # Set wallpaper based on hostname
  8. case "$(hostname)" in
  9. "main")
  10. # Get all outputs and set random wallpapers with transitions
  11. swaymsg -t get_outputs -r | jq -r ".[].name" | while read -r output; do
  12. random_wallpaper=$(find ~/Pictures/* -type f | shuf -n 1)
  13. swww img "$random_wallpaper" --outputs "$output" --transition-type center --transition-step 120 --transition-fps 144 &
  14. done
  15. ;;
  16. "fw")
  17. # # Set specific wallpaper for fw host
  18. # swww img "$HOME/Pictures/hwtioswoamne1.jpeg" --transition-type center --transition-step 120 --transition-fps 144
  19. # ;;
  20. #
  21. # Get all outputs and set random wallpapers with transitions
  22. swaymsg -t get_outputs -r | jq -r ".[].name" | while read -r output; do
  23. random_wallpaper=$(find ~/Pictures/* -type f | shuf -n 1)
  24. swww img "$random_wallpaper" --outputs "$output" --transition-type center --transition-step 120 --transition-fps 144 &
  25. done
  26. ;;
  27. *)
  28. echo "Unknown hostname: $(hostname)"
  29. exit 1
  30. ;;
  31. esac
  32. wait