Browse Source

pulse2jack: Add the option to use a user-selected config file

The pulse configuration file is selected from, in order:
- An environment variable
  - CADENCE_PULSE2JACK_PLAY/CADENCE_PULSE2JACK_PLAYREC
- A file
  - ~/.config/Cadence/pulse2jack/play[+rec].pa
- The original default file
  - $INSTALL_PREFIX/share/cadence/pulse2jack/play[+rec].pa

This is a partial solution for #234
pull/308/head
meadowmint 3 years ago
parent
commit
6d65f3ad74
1 changed files with 14 additions and 2 deletions
  1. +14
    -2
      data/cadence-pulse2jack

+ 14
- 2
data/cadence-pulse2jack View File

@@ -68,11 +68,23 @@ exit

-p|--p|--play)
PLAY_ONLY="yes"
FILE=$INSTALL_PREFIX/share/cadence/pulse2jack/play.pa
if test -n "${CADENCE_PULSE2JACK_PLAY}"; then
FILE="$CADENCE_PULSE2JACK_PLAY"
elif test -f ~/.config/Cadence/pulse2jack/play.pa; then
FILE=~/.config/Cadence/pulse2jack/play.pa
else
FILE=$INSTALL_PREFIX/share/cadence/pulse2jack/play.pa
fi
;;

*)
FILE=$INSTALL_PREFIX/share/cadence/pulse2jack/play+rec.pa
if test -n "${CADENCE_PULSE2JACK_PLAYREC}"; then
FILE="$CADENCE_PULSE2JACK_PLAYREC"
elif test -f ~/.config/Cadence/pulse2jack/play+rec.pa; then
FILE=~/.config/Cadence/pulse2jack/play+rec.pa
else
FILE=$INSTALL_PREFIX/share/cadence/pulse2jack/play+rec.pa
fi
;;
esac



Loading…
Cancel
Save