diff --git a/data/cadence b/data/cadence index c16d8a3..50d2ae4 100755 --- a/data/cadence +++ b/data/cadence @@ -1,16 +1,16 @@ -#!/bin/bash +#!/bin/sh # Check if already running -PROCS=`ps -f -u $USER | grep /share/cadence/src/cadence.py | grep python` +PROCS=$(ps -f -u $USER | grep /share/cadence/src/cadence.py | grep python) if [ x"$PROCS" != x"" ]; then # One instance only - PROC=`echo "$PROCS" | head -n 1` + PROC=$(echo "$PROCS" | head -n 1) # Get PID - PID=`echo "$PROC" | awk '{printf$2}'` + PID=$(echo "$PROC" | awk '{printf$2}') # Last check, just to make sure if [ x"$PID" != x"" ]; then diff --git a/data/cadence-aloop-daemon b/data/cadence-aloop-daemon index 9cc5851..2975c1d 100755 --- a/data/cadence-aloop-daemon +++ b/data/cadence-aloop-daemon @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/sh if [ -f /usr/bin/python3 ]; then PYTHON=/usr/bin/python3 diff --git a/data/cadence-jacksettings b/data/cadence-jacksettings index b1ca676..d562bc7 100755 --- a/data/cadence-jacksettings +++ b/data/cadence-jacksettings @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/sh if [ -f /usr/bin/python3 ]; then PYTHON=/usr/bin/python3 diff --git a/data/cadence-logs b/data/cadence-logs index 27cd3c3..34cae80 100755 --- a/data/cadence-logs +++ b/data/cadence-logs @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/sh if [ -f /usr/bin/python3 ]; then PYTHON=/usr/bin/python3 diff --git a/data/cadence-pulse2jack b/data/cadence-pulse2jack index 5266cb9..038e1a0 100755 --- a/data/cadence-pulse2jack +++ b/data/cadence-pulse2jack @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/sh # Script to bridge/start pulseaudio into JACK mode INSTALL_PREFIX="X-PREFIX-X" @@ -12,7 +12,7 @@ fi if [ ! -f ~/.pulse/client.conf ]; then echo "autospawn = no" > ~/.pulse/client.conf else - if (! cat ~/.pulse/client.conf | grep "autospawn = no" > /dev/null); then + if ! grep "autospawn = no" < ~/.pulse/client.conf > /dev/null; then sed -i '/autospawn =/d' ~/.pulse/client.conf echo "autospawn = no" >> ~/.pulse/client.conf fi @@ -24,19 +24,19 @@ if [ ! -f ~/.pulse/daemon.conf ]; then echo "rlimit-rttime = -1" >> ~/.pulse/daemon.conf echo "exit-idle-time = -1" >> ~/.pulse/daemon.conf else - if (! cat ~/.pulse/daemon.conf | grep "default-sample-format = float32le" > /dev/null); then + if ! grep "default-sample-format = float32le" < ~/.pulse/daemon.conf > /dev/null; then sed -i '/default-sample-format = /d' ~/.pulse/daemon.conf echo "default-sample-format = float32le" >> ~/.pulse/daemon.conf fi - if (! cat ~/.pulse/daemon.conf | grep "realtime-scheduling = yes" > /dev/null); then + if ! grep "realtime-scheduling = yes" < ~/.pulse/daemon.conf > /dev/null; then sed -i '/realtime-scheduling = /d' ~/.pulse/daemon.conf echo "realtime-scheduling = yes" >> ~/.pulse/daemon.conf fi - if (! cat ~/.pulse/daemon.conf | grep "rlimit-rttime = -1" > /dev/null); then + if ! grep "rlimit-rttime = -1" < ~/.pulse/daemon.conf > /dev/null; then sed -i '/rlimit-rttime =/d' ~/.pulse/daemon.conf echo "rlimit-rttime = -1" >> ~/.pulse/daemon.conf fi - if (! cat ~/.pulse/daemon.conf | grep "exit-idle-time = -1" > /dev/null); then + if ! grep "exit-idle-time = -1" < ~/.pulse/daemon.conf > /dev/null; then sed -i '/exit-idle-time =/d' ~/.pulse/daemon.conf echo "exit-idle-time = -1" >> ~/.pulse/daemon.conf fi @@ -80,8 +80,8 @@ esac IsPulseAudioRunning() { - PROCESS=`ps -u $USER | grep pulseaudio` - if [ "$PROCESS" == "" ]; then + PROCESS=$(ps -u $USER | grep pulseaudio) + if [ "$PROCESS" = "" ]; then false else true @@ -90,7 +90,7 @@ IsPulseAudioRunning() if (IsPulseAudioRunning); then { - if (`jack_lsp | grep "PulseAudio JACK Sink:" > /dev/null`); then + if jack_lsp | grep "PulseAudio JACK Sink:" > /dev/null; then { echo "PulseAudio is already running and bridged to JACK" } @@ -98,7 +98,7 @@ if (IsPulseAudioRunning); then { echo "PulseAudio is already running, bridge it..." - if [ "$PLAY_ONLY" == "yes" ]; then + if [ "$PLAY_ONLY" = "yes" ]; then { pactl load-module module-jack-sink > /dev/null pacmd set-default-source jack_in > /dev/null @@ -118,7 +118,7 @@ if (IsPulseAudioRunning); then } else { - if (`pulseaudio --daemonize --high-priority --realtime --exit-idle-time=-1 --file=$FILE -n`); then + if pulseaudio --daemonize --high-priority --realtime --exit-idle-time=-1 --file=$FILE -n > /dev/null 2>&1; then echo "Initiated PulseAudio successfully!" else echo "Failed to initialize PulseAudio!" diff --git a/data/cadence-pulse2loopback b/data/cadence-pulse2loopback index 9232346..1778fb3 100755 --- a/data/cadence-pulse2loopback +++ b/data/cadence-pulse2loopback @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/sh # Script to bridge/start pulseaudio into loopback mode INSTALL_PREFIX="X-PREFIX-X" @@ -12,7 +12,7 @@ fi if [ ! -f ~/.pulse/client.conf ]; then echo "autospawn = no" > ~/.pulse/client.conf else - if (! cat ~/.pulse/client.conf | grep "autospawn = no" > /dev/null); then + if ! grep "autospawn = no" < ~/.pulse/client.conf > /dev/null; then sed -i '/autospawn =/d' ~/.pulse/client.conf echo "autospawn = no" >> ~/.pulse/client.conf fi @@ -24,19 +24,19 @@ if [ ! -f ~/.pulse/daemon.conf ]; then echo "rlimit-rttime = -1" >> ~/.pulse/daemon.conf echo "exit-idle-time = -1" >> ~/.pulse/daemon.conf else - if (! cat ~/.pulse/daemon.conf | grep "default-sample-format = float32le" > /dev/null); then + if ! grep "default-sample-format = float32le" < ~/.pulse/daemon.conf > /dev/null; then sed -i '/default-sample-format = /d' ~/.pulse/daemon.conf echo "default-sample-format = float32le" >> ~/.pulse/daemon.conf fi - if (! cat ~/.pulse/daemon.conf | grep "realtime-scheduling = yes" > /dev/null); then + if ! grep "realtime-scheduling = yes" < ~/.pulse/daemon.conf > /dev/null; then sed -i '/realtime-scheduling = /d' ~/.pulse/daemon.conf echo "realtime-scheduling = yes" >> ~/.pulse/daemon.conf fi - if (! cat ~/.pulse/daemon.conf | grep "rlimit-rttime = -1" > /dev/null); then + if ! grep "rlimit-rttime = -1" < ~/.pulse/daemon.conf > /dev/null; then sed -i '/rlimit-rttime =/d' ~/.pulse/daemon.conf echo "rlimit-rttime = -1" >> ~/.pulse/daemon.conf fi - if (! cat ~/.pulse/daemon.conf | grep "exit-idle-time = -1" > /dev/null); then + if ! grep "exit-idle-time = -1" < ~/.pulse/daemon.conf > /dev/null; then sed -i '/exit-idle-time =/d' ~/.pulse/daemon.conf echo "exit-idle-time = -1" >> ~/.pulse/daemon.conf fi @@ -77,8 +77,8 @@ esac IsPulseAudioRunning() { - PROCESS=`ps -u $USER | grep pulseaudio` - if [ "$PROCESS" == "" ]; then + PROCESS=$(ps -u $USER | grep pulseaudio) + if [ "$PROCESS" = "" ]; then false else true @@ -98,7 +98,7 @@ if (IsPulseAudioRunning); then } else { - if (`pulseaudio --daemonize --high-priority --realtime --exit-idle-time=-1 --file=$FILE -n`); then + if pulseaudio --daemonize --high-priority --realtime --exit-idle-time=-1 --file=$FILE -n > /dev/null 2>&1; then echo "Initiated PulseAudio successfully!" else echo "Failed to initialize PulseAudio!" diff --git a/data/cadence-render b/data/cadence-render index 7a70122..8fe32e6 100755 --- a/data/cadence-render +++ b/data/cadence-render @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/sh if [ -f /usr/bin/python3 ]; then PYTHON=/usr/bin/python3 diff --git a/data/cadence-session-start b/data/cadence-session-start index bf35e68..51b1c9b 100755 --- a/data/cadence-session-start +++ b/data/cadence-session-start @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/sh if [ -f /usr/bin/python3 ]; then PYTHON=/usr/bin/python3 @@ -8,7 +8,7 @@ fi INSTALL_PREFIX="X-PREFIX-X" -if [ "$1"x == "--system-start-by-x11-startup"x ]; then +if [ "$1"x = "--system-start-by-x11-startup"x ]; then # called via $STARTUP in 21cadence-session-inject $PYTHON $INSTALL_PREFIX/share/cadence/src/cadence_session_start.py --system-start & shift @@ -17,7 +17,7 @@ if [ "$1"x == "--system-start-by-x11-startup"x ]; then else exec x-session-manager fi -elif [ "$1"x == "--maybe-system-start"x ]; then +elif [ "$1"x = "--maybe-system-start"x ]; then # called via autostart cadence-session-start.desktop # this will check if jack is already running before trying to restart things exec $PYTHON $INSTALL_PREFIX/share/cadence/src/cadence_session_start.py --system-start-desktop