You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

32 lines
491 B

  1. #!/bin/bash
  2. SOUND=/usr/local/share/sounds/static.ogg
  3. if [ ! -f "$SOUND" ]; then
  4. echo "File '$SOUND' not found." >&2
  5. exit 1
  6. fi
  7. function events() {
  8. swaymsg -m -t subscribe "['workspace']"
  9. }
  10. function daemon() {
  11. printf "p" # PAUSE
  12. while [[ true ]]; do
  13. read
  14. printf " " # PLAY
  15. while read -t 0.1; do
  16. sleep 0.1
  17. done
  18. printf "p" # PAUSE
  19. done
  20. }
  21. function static() {
  22. mplayer -loop 0 $SOUND
  23. }
  24. events | daemon | static