You are not logged in.
@loutch
Let's go back to my 'percentage' line:
percentage=$(echo "scale=1;$current*100/15 + 0.5" | bc | awk '{print int($1)}')Your last screenshot shows 01:55 on the left and 04:04 on the right.
If we convert to seconds, that's 115 seconds (60+55) on the left and 244 seconds (4x60+4) on the right.
It would look like this in my percentage line:
$ echo "scale=1;115*100/244 + 0.5" | bc | awk '{print int($1)}'
47That's the correct result.
You know I can't test, but try adding "percentage" to the script:
...
else
percentage=$(echo "scale=1;$POS*100/$TOTAL + 0.5" | bc | awk '{print int($1)}')
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 $percentage
# echo $length
# echo $position
# echo $positionTime
# echo $lengthTime Last edited by marens (2025-11-02 18:24:50)
If people would know how little brain is ruling the world, they would die of fear.
Offline
Re
For my part, I took the opposite approach.
I took Bleys' conky and tinkered with it until it picked up Spotify in progress .
For now, I have everything except the cover art.
For that, I'm using Madh93's script.
All of this gives me the following result.
I still don't understand how now.lua manages to make the exbar the right length.
Thanks again, I'll take a look at your part of the script.
@+
Last edited by loutch (2025-11-02 19:59:15)
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
Thanks again, I'll take a look at your part of the script.
Let's first go back to your execbar here:
https://forums.bunsenlabs.org/viewtopic … 43#p146743
Replace:
${execbar 2, 250 expr 100 \* $(audtool --current-song-output-length-seconds) \/ $(audtool --current-song-length-seconds)}with:
${if_match "${exec qdbus org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.freedesktop.DBus.Properties.Get org.mpris.MediaPlayer2.Player Metadata | grep "^mpris:length" | awk '{print $2}'}" != "0"}\
${execbar 2,250 exec echo "scale=1;$(qdbus org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.freedesktop.DBus.Properties.Get org.mpris.MediaPlayer2.Player Position)*100/$(qdbus org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.freedesktop.DBus.Properties.Get org.mpris.MediaPlayer2.Player Metadata | grep "^mpris:length" | awk '{print $2}') + 0.5" | bc | awk '{print int($1)}'}\
${else}${execbar 2,250 exec echo '0.05'}${endif}I hope there are no typos. ![]()
Last edited by marens (2025-11-03 03:12:00)
If people would know how little brain is ruling the world, they would die of fear.
Offline
Hello
Sorry don't work
this in console & this
sh: 1: Syntax error: end of file unexpected (expecting ")")
conky: reading exec value failed (perhaps it's not the correct format?)
sh: 1: Syntax error: end of file unexpected (expecting ")")
conky: reading exec value failed (perhaps it's not the correct format?)
sh: 1: Syntax error: end of file unexpected (expecting ")")
conky: reading exec value failed (perhaps it's not the correct format?)
sh: 1: Syntax error: end of file unexpected (expecting ")")
conky: reading exec value failed (perhaps it's not the correct format?)
............ect ...without it's okay , no errors in terminal.
@+
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
I hope there are no typos.
As expected. ![]()
If people would know how little brain is ruling the world, they would die of fear.
Offline
Try in the terminal when conky is running (the song is playing):
echo "scale=1;$(qdbus org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.freedesktop.DBus.Properties.Get org.mpris.MediaPlayer2.Player Position)*100/$(qdbus org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.freedesktop.DBus.Properties.Get org.mpris.MediaPlayer2.Player Metadata | grep "^mpris:length" | awk '{print $2}') + 0.5" | bc | awk '{print int($1)}'It should be the percentage for the execbar.
If people would know how little brain is ruling the world, they would die of fear.
Offline
Re
work great in terminal & in conky .
Made a script & run it in conky with this command.
execbar 2,164 ~/.conky/conky-spotify/scripts/marens_bare.shMANY TANKS
@+
Last edited by loutch (2025-11-03 16:20:29)
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
^ Very nice, but not finished yet.
When the song doesn't play, then we have to divide by zero.
That's not possible.
We have to work around that in the script.
The script should look like this:
#!/bin/bash
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 [[ "$total" != "0" ]]; then
percentage=$(echo "scale=1;$(qdbus org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.freedesktop.DBus.Properties.Get org.mpris.MediaPlayer2.Player Position)*100/$(qdbus org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.freedesktop.DBus.Properties.Get org.mpris.MediaPlayer2.Player Metadata | grep "^mpris:length" | awk '{print $2}') + 0.5" | bc | awk '{print int($1)}')
echo $percentage
else
echo '0.05'
fiThe command echo '0.05' is a little trick to make the execbar work properly. ![]()
EDIT
You know I can't test it, but this is also possible:
if [[ "$total" != "" ]]; thenLast edited by marens (2025-11-03 18:46:29)
If people would know how little brain is ruling the world, they would die of fear.
Offline
Re
Oki-doki.
@+
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
MarkW wrote:Someone needs to point quick screenshot to another image hosting service
Your frustration with the Imgur/UK situation is well understood.
But that "someone" would have to:1) find a suitable replacement service with an API that accepts anonymous uploads
1a) check that no forum members have had issues with that service
2) write a new upload script to use it and put it in an upgraded bunsen-utilities
3) change the menu entry to use that script
4) push a bunsen-configs upgrade which invites users to import the new menu fileAll this, while in the final stages of getting the new Carbon iso ready.
Meanwhile, all we can do right now is ask users to upload their screenshots to some other service than Imgur. Many people are already doing this.
...and hope that maybe the situation will resolve itself
...or fear that the same issue will come to affect all image upload services
Just in case anyone missed it, the standard BL image upload utilities now use imgbb not imgur.
https://forums.bunsenlabs.org/viewtopic.php?id=9581
...elevator in the Brain Hotel, broken down but just as well...
( a boring Japan blog (currently paused), now on Bluesky, there's also some GitStuff )
Offline