From 1af0c44bc2d7f61577c31f7a890cf4829a4f129a Mon Sep 17 00:00:00 2001 From: dewomser Date: Sun, 19 Jun 2022 20:06:47 +0200 Subject: [PATCH] cover im dir des scripts immer ! --- README.md | 2 +- tweet_music | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index f671130..11d4631 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ Pushes Metatags of Audio-Players VLC or Clementine to your Mastodon account Needs Linux/KDE with mpris, Bash,Toot -Toot must be authorized at the Mastodon instance +Toot must be authorized at the Mastodon instance. ## tweet_music diff --git a/tweet_music b/tweet_music index c9d1c1f..3445255 100755 --- a/tweet_music +++ b/tweet_music @@ -1,6 +1,9 @@ #!/bin/bash #//config +BASEDIR=$(readlink -f "$0" | xargs dirname) + + function urldecode() { : "${*//+/ }"; echo -e "${_//%/\\x}"; } clementine=$(qdbus org.mpris.MediaPlayer2.clementine /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.PlaybackStatus) vlc=$(qdbus org.mpris.MediaPlayer2.vlc /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.PlaybackStatus) @@ -26,7 +29,7 @@ readarray -t a <<< "$(qdbus org.mpris.MediaPlayer2.$player /org/mpris/MediaPlaye #//Bild kopieren lolo1=$(urldecode "${a[0]}") -convert "$lolo1" -gravity south -background YellowGreen -splice 0x18 -annotate +0+2 'Die Tweet_Music-App ist vom @dewomser' cover.jpg +convert "$lolo1" -gravity south -background YellowGreen -splice 0x18 -annotate +0+2 'Die Tweet_Music-App ist vom @dewomser' "$BASEDIR"/cover.jpg #cp "$lolo1" "$PWD"/cover.jpg @@ -48,7 +51,7 @@ mis=$($twurlp -u $user -H upload.twitter.com "/1.1/media/upload.json" -d "comman # jq -r macht das jetzt mis="${mis:1: -1}" #//hochladen -$twurlp -u $user -H upload.twitter.com "/1.1/media/upload.json" -d "command=APPEND&media_id=$mis&segment_index=0" --file cover.jpg --file-field "media" | jq . +$twurlp -u $user -H upload.twitter.com "/1.1/media/upload.json" -d "command=APPEND&media_id=$mis&segment_index=0" --file "$BASEDIR"/cover.jpg --file-field "media" | jq . #//finalisieren