Move environment variable defaults to initial variable declaration

Reduce the verbose syntax and use bash idioms instead.
This commit is contained in:
M.B. Christiansen 2022-10-10 11:10:06 +02:00
parent e0a0e9ce1c
commit 866aafc8cd
1 changed files with 3 additions and 7 deletions

10
kunst
View File

@ -9,9 +9,9 @@
VERSION=1.3.4 VERSION=1.3.4
COVER=/tmp/kunst.jpg COVER=/tmp/kunst.jpg
MUSIC_DIR=~/Music MUSIC_DIR="${KUNST_MUSIC_DIR:-~/Music}"
SIZE=250x250 SIZE="${KUNST_SIZE:-250x250}"
POSITION="+0+0" POSITION="${KUNST_POSITION:-+0+0}"
ONLINE_ALBUM_ART=false ONLINE_ALBUM_ART=false
PROG_NAME=$(basename "$0") PROG_NAME=$(basename "$0")
@ -212,10 +212,6 @@ main() {
} }
done done
[ "$KUNST_MUSIC_DIR" != "" ] && MUSIC_DIR="$KUNST_MUSIC_DIR"
[ "$KUNST_SIZE" != "" ] && SIZE="$KUNST_SIZE"
[ "$KUNST_POSITION" != "" ] && POSITION="$KUNST_POSITION"
# Flag to run some commands only once in the loop # Flag to run some commands only once in the loop
FIRST_RUN=true FIRST_RUN=true