From 866aafc8cd62ca809c98c18e5d6dc4fa9a45f03b Mon Sep 17 00:00:00 2001 From: "M.B. Christiansen" Date: Mon, 10 Oct 2022 11:10:06 +0200 Subject: [PATCH] Move environment variable defaults to initial variable declaration Reduce the verbose syntax and use bash idioms instead. --- kunst | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/kunst b/kunst index 03558fe..1b11af6 100755 --- a/kunst +++ b/kunst @@ -9,9 +9,9 @@ VERSION=1.3.4 COVER=/tmp/kunst.jpg -MUSIC_DIR=~/Music -SIZE=250x250 -POSITION="+0+0" +MUSIC_DIR="${KUNST_MUSIC_DIR:-~/Music}" +SIZE="${KUNST_SIZE:-250x250}" +POSITION="${KUNST_POSITION:-+0+0}" ONLINE_ALBUM_ART=false PROG_NAME=$(basename "$0") @@ -212,10 +212,6 @@ main() { } 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 FIRST_RUN=true