From 1ab2f91d3fc975e34cde400e709e68f90817633b Mon Sep 17 00:00:00 2001 From: Philippe Troin Date: Sun, 22 Mar 2020 13:18:15 -0700 Subject: [PATCH] Fix indentation and white-space. --- pajackconnect | 46 +++++++++++++++++++++++----------------------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/pajackconnect b/pajackconnect index b172683..7fb062a 100755 --- a/pajackconnect +++ b/pajackconnect @@ -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: @@ -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 @@ -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 @@ -103,7 +103,7 @@ function restart() { echo already run >>"$pajack_dir/pajack.log" fi fi -} + } function start() { # if command-line option start is given @@ -137,7 +137,7 @@ 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 @@ -145,7 +145,7 @@ function stop() { 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 @@ -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 }