Audio startup functions

This commit is contained in:
Christian Colglazier 2020-05-31 11:31:46 -04:00
parent d672031ad0
commit 782ace88f3

View File

@ -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