From 81879cf9ed89e121797d1d9ddead57d7247fc038 Mon Sep 17 00:00:00 2001 From: TravonteD Date: Mon, 14 Oct 2019 08:27:05 -0400 Subject: [PATCH 1/6] set the default position to the what the window manager decides --- kunst | 1 + 1 file changed, 1 insertion(+) diff --git a/kunst b/kunst index e144c14..834e8a3 100755 --- a/kunst +++ b/kunst @@ -11,6 +11,7 @@ VERSION=1.2.4 COVER=/tmp/kunst.jpg MUSIC_DIR=~/Music/ SIZE=250x250 +POSITION="+0+0" show_help() { From eacde3a34066e799699bb78770ab1518d26c9bc5 Mon Sep 17 00:00:00 2001 From: TravonteD Date: Mon, 14 Oct 2019 08:27:37 -0400 Subject: [PATCH 2/6] add "position to the command line argurments and environment variables --- kunst | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/kunst b/kunst index 834e8a3..b129a6e 100755 --- a/kunst +++ b/kunst @@ -32,7 +32,7 @@ show_help() { # Parse the arguments -options=$(getopt -o h --long size:,music_dir:,version,silent,help -- "$@") +options=$(getopt -o h --long position:,size:,music_dir:,version,silent,help -- "$@") eval set -- "$options" while true; do @@ -41,6 +41,10 @@ while true; do shift; SIZE=$1 ;; + --position) + shift; + POSITION=$1 + ;; --music_dir) shift; MUSIC_DIR=$1 @@ -183,6 +187,7 @@ main() { [[ $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 From f584b99fb0a164c008dc07038626d90a6f194c43 Mon Sep 17 00:00:00 2001 From: TravonteD Date: Mon, 14 Oct 2019 08:28:04 -0400 Subject: [PATCH 3/6] pass the position to sxiv on initialization --- kunst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kunst b/kunst index b129a6e..95e0080 100755 --- a/kunst +++ b/kunst @@ -215,7 +215,7 @@ main() { FIRST_RUN=false # Display the album art using sxiv - sxiv -g $SIZE -b $COVER -N "Kunst" & + sxiv -g $SIZE$POSITION -b $COVER -N "Kunst" & # Save the process ID so that we can kill # sxiv when the user exits the script From 7e09c522df25d9d5c350fea33e8a861042a41de1 Mon Sep 17 00:00:00 2001 From: TravonteD Date: Tue, 15 Oct 2019 06:56:19 -0400 Subject: [PATCH 4/6] add help for the position argument --- kunst | 1 + 1 file changed, 1 insertion(+) diff --git a/kunst b/kunst index 95e0080..3413ebd 100755 --- a/kunst +++ b/kunst @@ -25,6 +25,7 @@ show_help() { echo "optional arguments:" echo " -h, --help show this help message and exit" echo " --size what size to display the album art in" + echo " --position where the album art should be located" echo " --music_dir the music directory which MPD plays from" echo " --silent dont show the output" echo " --version show the version of kunst you are using" From a8a70a7eb93094bae451b9182859adb1f15bdb05 Mon Sep 17 00:00:00 2001 From: TravonteD Date: Tue, 15 Oct 2019 07:00:01 -0400 Subject: [PATCH 5/6] add position to the README and phrase what it does better --- README.md | 4 ++++ kunst | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 14317a3..241de70 100644 --- a/README.md +++ b/README.md @@ -59,6 +59,7 @@ Download and display album art or display embedded album art optional arguments: -h, --help show this help message and exit --size what size to display the album art in + --position The position where the album art should be displayed --music_dir the music directory which MPD plays from --silent dont show the output --version show the version of kunst you are using @@ -78,6 +79,9 @@ You can configure `kunst` through environment variables. # The size of the album art to be displayed export KUNST_SIZE="250x250" +# The position where the album art should be displayed +export KUNST_POSITION="+0+0" + # Where your music is located export KUNST_MUSIC_DIR="/home/username/Music/" ``` diff --git a/kunst b/kunst index 3413ebd..bd945a4 100755 --- a/kunst +++ b/kunst @@ -25,7 +25,7 @@ show_help() { echo "optional arguments:" echo " -h, --help show this help message and exit" echo " --size what size to display the album art in" - echo " --position where the album art should be located" + echo " --position The position where the album art should be displayed" echo " --music_dir the music directory which MPD plays from" echo " --silent dont show the output" echo " --version show the version of kunst you are using" From 3da911a6a007c7b04a3b4e6ab1ab51664b56d695 Mon Sep 17 00:00:00 2001 From: TravonteD Date: Tue, 15 Oct 2019 07:01:37 -0400 Subject: [PATCH 6/6] add position to the top level help line --- kunst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kunst b/kunst index bd945a4..97da38b 100755 --- a/kunst +++ b/kunst @@ -15,7 +15,7 @@ POSITION="+0+0" show_help() { - echo "usage: kunst [-h] [--size "px"] [--music_dir "path/to/dir"] [--silent] [--version]" + echo "usage: kunst [-h] [--size "px"] [--position "+x+y"][--music_dir "path/to/dir"] [--silent] [--version]" echo " " echo "┬┌─┬ ┬┌┐┌┌─┐┌┬┐" echo "├┴┐│ ││││└─┐ │"