From 782ace88f3cf0a26f3f3016867295a7d18fe72f2 Mon Sep 17 00:00:00 2001 From: Christian Colglazier Date: Sun, 31 May 2020 11:31:46 -0400 Subject: [PATCH] Audio startup functions --- scripts/system-start-audio.sh | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) 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