diff --git a/scripts/system-start-audio.sh b/scripts/system-start-audio.sh index cdc6101..5f37541 100644 --- a/scripts/system-start-audio.sh +++ b/scripts/system-start-audio.sh @@ -11,7 +11,7 @@ function fixPulse() { PULSE="$(alsamixer 2>&1 | killall alsamixer)" if [[ $PULSE == *'Connection refused'* ]]; then echo 'Fixing Pulseaudio' - pulseaudio -k + killPulse pulseaudio -D fixPulse else @@ -19,6 +19,15 @@ function fixPulse() { fi } +# Start up programs that use audio +function launchi3() { + if [ -z "$skipi3" ]; then + echo Opening i3wm sound workspaces + sleep .1 && i3-msg 'workspace 10; exec google-play-music-desktop-player' + sleep .1 && i3-msg 'workspace 5; exec firefox' + fi +} + # arg parser for arg in "$@" do @@ -44,9 +53,4 @@ fixPulse sh ~/.config/scripts/start-es-8.sh sh ~/.config/scripts/start-es-9.sh -# Start up programs that use audio -if [ -z "$skipi3" ]; then - echo Opening i3wm sound workspaces - sleep .1 && i3-msg 'workspace 10; exec google-play-music-desktop-player' - sleep .1 && i3-msg 'workspace 5; exec firefox' -fi +launchi3