cover im dir des scripts immer !

This commit is contained in:
dewomser 2022-06-19 20:06:47 +02:00
parent cf139503d3
commit 1af0c44bc2
2 changed files with 6 additions and 3 deletions

View file

@ -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

View file

@ -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