diff --git a/config/sway/pipboy.conf b/config/sway/pipboy.conf index 43dd87c..e3f5d48 100644 --- a/config/sway/pipboy.conf +++ b/config/sway/pipboy.conf @@ -38,4 +38,6 @@ exec "mako" # example Welcome message exec "sleep 2; notify-send 'Welcome!' 'Your Pip-Boy is ready to be used.' --icon=dialog-information" +# Sound daemon +exec "worskpace_sounds_daemon" diff --git a/usr/local/bin/workspace_sounds_daemon b/usr/local/bin/workspace_sounds_daemon new file mode 100755 index 0000000..1909670 --- /dev/null +++ b/usr/local/bin/workspace_sounds_daemon @@ -0,0 +1,31 @@ +#!/bin/bash + +SOUND=/usr/local/share/sounds/static.ogg + +if [ ! -f "$SOUND" ]; then + echo "File '$SOUND' not found." >&2 + exit 1 +fi + +function events() { + swaymsg -m -t subscribe "['workspace']" +} + +function daemon() { + printf "p" # PAUSE + while [[ true ]]; do + read + printf " " # PLAY + while read -t 0.1; do + sleep 0.1 + done + printf "p" # PAUSE + done +} + +function static() { + mplayer -loop 0 $SOUND +} + +events | daemon | static + diff --git a/usr/local/share/sounds/static.ogg b/usr/local/share/sounds/static.ogg new file mode 100644 index 0000000..882ff2c Binary files /dev/null and b/usr/local/share/sounds/static.ogg differ