You are not logged in.
Offline
Hello
Schade .
I had to enlarge my conky quote because Lao-Tzu makes great sentences
https://thumbs2.imgbox.com/82/31/qUTpY8ng_t.png
@+
Avec @olgmen, cela fonctionnerait (il n'a qu'un seul script lua au lieu de cinq). ![]()
It would work with @olgmen (he only has one lua script instead of five).
Offline
marens wrote:@unklar
It looks nice.
Check the bottom outer line.
There is no empty space between the image and the outer line.I know that there has never been empty space. Not even in 2017. And I don't know why.
Sorry, I only now fully understood that. ![]()
I made 1600x800 instead of 887 because the font bothers me. ![]()
Offline
^ You probably found a new girlfriend and fell in love again.
I hope your wife isn't reading this. ![]()
If people would know how little brain is ruling the world, they would die of fear.
Offline
Hello
Conky spotify look like my old mageia 5 audacious skin .
Original from Madh93 here:
https://github.com/Madh93/conky-spotify … /README.md
For the moment work great just ad convert to have a real png cover album because i'm using a lua script .
@+
Last edited by loutch (2025-10-28 20:09:04)
Linuxmint 22.1 Xia xfce & mageia 9 XFCE on ssd hp pavilion g7
Xubuntu 18.04 lts & 24.04 lts on ASUS Rog STRIX
Offline
Hello
Well, friends, I would like to add to my conky-spotify
the position
a progress bar
the total duration
of the track being played
as on my conky audacious
I found this, but it gives me a strange figure for the total duration of this track: 3:21, i have 201866000
echo `dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.freedesktop.DBus.Properties.Get string:'org.mpris.MediaPlayer2.Player' string:'Metadata'|egrep -A 2 "length"|egrep -v "length"|egrep -v "array"|cut -b 43-|cut -d '"' -f 1|egrep -v ^$` > $HOME/.conky/conky-spotify/duree Here that must be look like this (it's a fake)
Many tanks .
@+
Linuxmint 22.1 Xia xfce & mageia 9 XFCE on ssd hp pavilion g7
Xubuntu 18.04 lts & 24.04 lts on ASUS Rog STRIX
Offline
If people would know how little brain is ruling the world, they would die of fear.
Offline
You're only interested in this part:
https://gist.github.com/rdschmidt/8c04a … e-mpris-sh
I don't have the dependencies installed (urlencode, qdbus) and I can't help you, but first you need to define the player (line 8).
For example:
Player="audacious"I think you already have this part (artist, title, cover) and you can remove it:
TEMP=$(qdbus org.mpris.MediaPlayer2.$Player /org/mpris/MediaPlayer2 org.freedesktop.DBus.Properties.Get org.mpris.MediaPlayer2.Player Metadata | grep "artist:")
artist=${TEMP##*:}
TEMP=$(qdbus org.mpris.MediaPlayer2.$Player /org/mpris/MediaPlayer2 org.freedesktop.DBus.Properties.Get org.mpris.MediaPlayer2.Player Metadata | grep "title:")
title=${TEMP##*:}
COVER=$(qdbus org.mpris.MediaPlayer2.$Player /org/mpris/MediaPlayer2 org.freedesktop.DBus.Properties.Get org.mpris.MediaPlayer2.Player Metadata | grep "artUrl:")
str="'"
if [ -n "$COVER" -a $position -ge 1 ]; then
if [ "$Player" == "vlc" ]; then
uri=$(urlencode -d "$COVER")
COVER=${uri#*//}
convert "$COVER" '/tmp/tmp.png'
else
convert "${COVER#*//}" '/tmp/tmp.png'
fi
fiGood luck!
If people would know how little brain is ruling the world, they would die of fear.
Offline
Re
Tanks for helping .
I don't use any player , it's spotify application .
@+
Linuxmint 22.1 Xia xfce & mageia 9 XFCE on ssd hp pavilion g7
Xubuntu 18.04 lts & 24.04 lts on ASUS Rog STRIX
Offline
^ Replace "audacious" with "spotify" and try adding mpris.sh to conky-spotify/scripts:
#!/bin/bash
Player="spotify"
if [ $(ps -C $Player -o pid=) ]; then
convertsec()
{
x=`expr $1 / 1000000`
s=`expr $x % 60`
x=`expr $x / 60`
m=`expr $x % 60`
printf "%02d:%02d\n" $m $s
}
POS=$(qdbus org.mpris.MediaPlayer2.$Player /org/mpris/MediaPlayer2 org.freedesktop.DBus.Properties.Get org.mpris.MediaPlayer2.Player Position)
TOTAL=$(qdbus org.mpris.MediaPlayer2.$Player /org/mpris/MediaPlayer2 org.freedesktop.DBus.Properties.Get org.mpris.MediaPlayer2.Player Metadata | grep "^mpris:length" | awk '{print $2}')
if [ -z $TOTAL ]
then
positionTime="00:00"
lengthTime="00:00"
length="stopped"
position=1
else
positionTime=$(convertsec $POS)
lengthTime=$(convertsec $TOTAL)
length=$(($TOTAL/1000000))
position=$(($POS/1000000))
fi
vol=$(qdbus org.mpris.MediaPlayer2.$Player /org/mpris/MediaPlayer2 org.freedesktop.DBus.Properties.Get org.mpris.MediaPlayer2.Player Volume)
echo $length";"$position";"$artist";"$title";"$positionTime";"$lengthTime";"$vol
fi
exit 01) Run conky-spotify
2) Terminal (once):
$ bash $OME/path/to/script/mpris.shDo you have everything you need?
Last edited by marens (2025-11-01 19:08:00)
If people would know how little brain is ruling the world, they would die of fear.
Offline
Re
I found something that works almost the same as yours.
conkyrc
${voffset -24}${font :size=10}
${alignc}SPOTIFY ${execi 1 ~/.conky/conky-spotify/scripts/cover.sh} $font ${voffset -2}
${goto 15}${exec ~/.conky/conky-spotify/scripts/position.sh} ${goto 300}${color ffffff}${exec ~/.conky/conky-spotify/scripts/duree.sh}\
${goto 42}${voffset 2}${color ffffff}${execbar 2, 250 expr 100 \* $(audtool --current-song-output-length-seconds) \/ $(audtool --current-song-length-seconds)}
${if_match "${execi 2 sed -n '1p' $HOME/.conky/conky-spotify/current/current.txt}" == ""}${lua fDrawImage ~/.conky/conky-spotify/pub1.png 20 30 90 90}
${else}${lua fDrawImage ~/.conky/conky-spotify/current/current.png 20 30 90 90}${endif}
${voffset 6}${font :size=10}
${alignc -20}${exec ~/.conky/conky-spotify/scripts/artist.sh}$font
${voffset 10}
${alignc}${exec ~/.conky/conky-spotify/scripts/album.sh}
${alignc}${exec ~/.conky/conky-spotify/scripts/title.sh | fmt -w 100 | sed -n '1p'}
${alignc}${exec ~/.conky/conky-spotify/scripts/title.sh | fmt -w 100 | sed -n '2p'}
${lua fDrawImage ~/.conky/RadioTray_NG/images/tahoe/prev.png 130 45 28 28}
${lua fDrawImage ~/.conky/RadioTray_NG/images/tahoe/pause.png 160 45 28 28}
${lua fDrawImage ~/.conky/RadioTray_NG/images/tahoe/play.png 190 45 28 28}
${lua fDrawImage ~/.conky/RadioTray_NG/images/tahoe/next.png 220 45 28 28}position.sh
#!/bin/bash
convertsec()
{
x=`expr $1 / 1000000`
s=`expr $x % 60`
x=`expr $x / 60`
m=`expr $x % 60`
printf "%02d:%02d\n" $m $s
}
POS=$(qdbus org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.freedesktop.DBus.Properties.Get org.mpris.MediaPlayer2.Player Position)
TOTAL=$(qdbus org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.freedesktop.DBus.Properties.Get org.mpris.MediaPlayer2.Player Metadata | grep "^mpris:length" | awk '{print $2}')
if [ -z $TOTAL ]
then
positionTime="00:00"
lengthTime="00:00"
length="stopped"
position=1
else
positionTime=$(convertsec $POS)
lengthTime=$(convertsec $TOTAL)
length=$(($TOTAL/1000000))
position=$(($POS/1000000))
fi
vol=$(qdbus org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.freedesktop.DBus.Properties.Get org.mpris.MediaPlayer2.Player Volume)
echo $positionTime duree.sh
#!/bin/bash
convertsec()
{
x=`expr $1 / 1000000`
s=`expr $x % 60`
x=`expr $x / 60`
m=`expr $x % 60`
printf "%02d:%02d\n" $m $s
}
POS=$(qdbus org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.freedesktop.DBus.Properties.Get org.mpris.MediaPlayer2.Player Position)
TOTAL=$(qdbus org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.freedesktop.DBus.Properties.Get org.mpris.MediaPlayer2.Player Metadata | grep "^mpris:length" | awk '{print $2}')
if [ -z $TOTAL ]
then
positionTime="00:00"
lengthTime="00:00"
length="stopped"
position=1
else
positionTime=$(convertsec $POS)
lengthTime=$(convertsec $TOTAL)
length=$(($TOTAL/1000000))
position=$(($POS/1000000))
fi
vol=$(qdbus org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.freedesktop.DBus.Properties.Get org.mpris.MediaPlayer2.Player Volume)
echo $lengthTime give this
All I have to do now is figure out how to do the bar.
@+
Last edited by loutch (2025-11-01 20:11:58)
Linuxmint 22.1 Xia xfce & mageia 9 XFCE on ssd hp pavilion g7
Xubuntu 18.04 lts & 24.04 lts on ASUS Rog STRIX
Offline
All I have to do now is figure out how to do the bar.
We've already done something similar.
Start here:
https://forums.bunsenlabs.org/viewtopic … 28#p144528
This is the end:
https://forums.bunsenlabs.org/viewtopic … 90#p144590
If you read all the posts in between, I think you will find the solution easily.
Last edited by marens (2025-11-02 01:00:40)
If people would know how little brain is ruling the world, they would die of fear.
Offline
In Debian 13, the packages to be installed are:
gridsite-clients qdbus-qt5 (there is no/ longer gridsite-client and qdbus)
lua5.1 must also be installed for fDrawImage.
There is a syntax error in mpris.sh. At least that's what the terminal tells me.
It should be right here:
Player=$audacious
if [ $(ps -C $Player -o pid=) ]; then <===
convertsec() man ps is so extensive and I don't understand which argument has to be placed after ...pid=....
This gives me the same image as @loutch: https://forums.bunsenlabs.org/viewtopic … 38#p146738
The pid itself from the player is set in /tmp. What's missing is tmp.png.
@marens, can you take a look at the pid? ![]()
Offline
I'm sorry, @unklar.
I saw that script when I was making a radiotray-ng.
I never tried to use it.
@rdschmidt (Bleys) is a member of the Linux Mint forums.
Here is that thread:
https://forums.linuxmint.com/viewtopic.php?t=414132
@loutch has an account there.
If people would know how little brain is ruling the world, they would die of fear.
Offline
@loutch
This line is wrong:
${goto 42}${voffset 2}${color ffffff}${execbar 2, 250 expr 100 \* $(audtool --current-song-output-length-seconds) \/ $(audtool --current-song-length-seconds)}The audtool command is for audacious.
If people would know how little brain is ruling the world, they would die of fear.
Offline
Re
I know is just to have any line in conky .
Well, I have a start. My bar works up to 1 minute 40 seconds, which is equivalent to 100 seconds.
So now I just need to figure out how to divide the total value of seconds so that it stays within the range of 0 to 100.
25s
52s
1:55 mn nothing
@+
Last edited by loutch (2025-11-02 14:05:21)
Linuxmint 22.1 Xia xfce & mageia 9 XFCE on ssd hp pavilion g7
Xubuntu 18.04 lts & 24.04 lts on ASUS Rog STRIX
Offline
^ Look at the 'percentage' line here:
https://forums.bunsenlabs.org/viewtopic … 56#p144556
percentage=$(echo "scale=1;$current*100/15 + 0.5" | bc | awk '{print int($1)}')I multiplied $current*100, then divided by the maximum value (15).
Then I round the result with awk.
If people would know how little brain is ruling the world, they would die of fear.
Offline
I'm sorry, @unklar.
I saw that script when I was making a radiotray-ng.
I never tried to use it.@rdschmidt (Bleys) is a member of the Linux Mint forums.
Here is that thread:
https://forums.linuxmint.com/viewtopic.php?t=414132
WOW!
Thank you very much for this link.
It broadens my horizons regarding audacious. ![]()
Thank you!
Offline
Re
i found something in this script
#!/bin/bash
convertsec()
{
x=`expr $1 / 1000000`
s=`expr $x % 60`
x=`expr $x / 60`
m=`expr $x % 60`
printf "%02d:%02d\n" $m $s
}
POS=$(qdbus org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.freedesktop.DBus.Properties.Get org.mpris.MediaPlayer2.Player Position)
TOTAL=$(qdbus org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.freedesktop.DBus.Properties.Get org.mpris.MediaPlayer2.Player Metadata | grep "^mpris:length" | awk '{print $2}')
if [ -z $TOTAL ]
then
positionTime="00:00"
lengthTime="00:00"
length="stopped"
position=1
else
positionTime=$(convertsec $POS)
lengthTime=$(convertsec $TOTAL)
length=$(($TOTAL/1000000))
position=$(($POS/1000000)) # ←←←←←← here
fi
vol=$(qdbus org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.freedesktop.DBus.Properties.Get org.mpris.MediaPlayer2.Player Volume)
# echo $length
echo $position
# echo $positionTime
# echo $lengthTime I think this is where i need to find the formula for this value to remain below 100.
@+
Last edited by loutch (2025-11-02 15:28:27)
Linuxmint 22.1 Xia xfce & mageia 9 XFCE on ssd hp pavilion g7
Xubuntu 18.04 lts & 24.04 lts on ASUS Rog STRIX
Offline