Skip to content

Commit

Permalink
Fix indentation and white-space.
Browse files Browse the repository at this point in the history
  • Loading branch information
F-i-f committed Mar 22, 2020
1 parent fb9260e commit 1ab2f91
Showing 1 changed file with 23 additions and 23 deletions.
46 changes: 23 additions & 23 deletions pajackconnect
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@
#
# in the field labelled “Execute script after Shutdown”.
#
# for use jack without pulseaudio, add in Qjackctl setting window
# in the serverpath field 'pasuspender -- ' before 'jackd', save settings
# as "No Pulse" for example. Remove 'pasuspender -- ',
# and save settings as 'Pulse'. Now you can select from the
# for use jack without pulseaudio, add in Qjackctl setting window
# in the serverpath field 'pasuspender -- ' before 'jackd', save settings
# as "No Pulse" for example. Remove 'pasuspender -- ',
# and save settings as 'Pulse'. Now you can select from the
# Qjackctl setting window, if you would start jack with or without pulse.
#
# References:
Expand All @@ -39,12 +39,12 @@
# overall script formating by Hermann Meyer
# added possibility to run jack with suspend pulse by Hermann Meyer
# added save and restore previous used pulseaudio ports by Hermann Meyer
# added reload pulse jack modules after resume from suspend
# added reload pulse jack modules after resume from suspend
# (needs to be called by a systemd.service file) by Hermann Meyer
#-


# variable to fetch pasuspender status
# variable to fetch pasuspender status
p=`ps ax | grep '[p]asuspender'`
if [ "${XDG_RUNTIME_DIR-}" != "" ]
then
Expand All @@ -66,17 +66,17 @@ function restart() {
#echo "pasuspender is active"
exit 0
else
# check if pulse jack modules are loaded
jc=`pacmd list | grep jack-sink`
# check if jack is running
ja=`pidof jackd | wc -w`
# check if pulseaudio is running
pa=`pidof pulseaudio | wc -w`
# write results to log file
date +%H:%M:%S >>"$pajack_dir/pajack.log"
echo 'jack-sink =' $jc >>"$pajack_dir/pajack.log"
echo 'jack =' $ja >>"$pajack_dir/pajack.log"
echo 'pulse =' $pa >>"$pajack_dir/pajack.log"
# check if pulse jack modules are loaded
jc=`pacmd list | grep jack-sink`
# check if jack is running
ja=`pidof jackd | wc -w`
# check if pulseaudio is running
pa=`pidof pulseaudio | wc -w`
# write results to log file
date +%H:%M:%S >>"$pajack_dir/pajack.log"
echo 'jack-sink =' $jc >>"$pajack_dir/pajack.log"
echo 'jack =' $ja >>"$pajack_dir/pajack.log"
echo 'pulse =' $pa >>"$pajack_dir/pajack.log"
if [[ ! "$jc" =~ "jack" ]] && [[ "$ja" == "1" ]]; then
# if pulseaudio didn't run, let's try start it
if [[ ! "$pa" == "1" ]]; then
Expand All @@ -103,7 +103,7 @@ function restart() {
echo already run >>"$pajack_dir/pajack.log"
fi
fi
}
}

function start() {
# if command-line option start is given
Expand Down Expand Up @@ -137,15 +137,15 @@ function start() {
function stop() {
# if command-line option stop is given
# again, check if pasuspender waiting for jack, if not, unload the pulse
# jack module and reload the module-suspend-on-idle.
# jack module and reload the module-suspend-on-idle.
if [[ ! "$p" =~ "jackd" ]]; then
#echo "pasuspender is NOT active"
pacmd unload-module module-jack-sink
pacmd unload-module module-jack-source
pacmd load-module module-suspend-on-idle
else
# if pasuspender waiting for jack, add a timeout to pasuspender
# to allow a smooth reset action afterward.
# to allow a smooth reset action afterward.
#echo "pasuspender is active"
pasuspender -- sleep 5 &
fi
Expand All @@ -158,12 +158,12 @@ function reset() {
#echo "pasuspender is active"
exit 0
else
# fetch the previous saved pulse audio ports and set them back
# fetch the previous saved pulse audio ports and set them back
# as default ports for pulseaudio. Done.
sink=`cat "$pajack_dir"/pasinkj`
source=`cat "$pajack_dir"/pasourcej`
pacmd set-default-sink $sink
pacmd set-default-source $source
pacmd set-default-sink $sink
pacmd set-default-source $source
#echo "pasuspender is NOT active"
fi
}
Expand Down

0 comments on commit 1ab2f91

Please sign in to comment.