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
Hello guys
I need your help again.
Normally, to launch multiple Lua scripts, I use this:
require 'cairo'
function conky_loader_lua()
usrhome = os.getenv("HOME")
dofile (usrhome ..".conky/Mimod-white/scripts/image.lua")
dofile (usrhome ..".conky/Mimod-white/scripts/rings.lua
conky_main_post_ring_stats()
end& in conky that
lua_load = '$HOME/.conky/Mimod-white/scripts/loader.lua',
lua_draw_hook_pre = 'loader_lua',
So I did that, but it doesn't work.
I've racked my brains, but I can't figure it out.
Normaly in conky for just the image.lua
lua_load = '~/.conky/Mimod-white/scripts/image.lua',& here the right think for Mimod-white
lua_load = '~/.conky/Mimod-white/scripts/rings.lua',
lua_draw_hook_post = 'ring_stats',But nothing work .
i'm sure ther ie a little mess but i can't find it .
Many tanks .
@+
Edit
it's good i made 2 conky (first right conky Mimod & second for weather) & create any launcher for these .
#!/bin/bash
PROG_NAME1="conky -c /home/$USER/.conky/Mimod-white/Mimod-white.conf" # Nom du programme à démarrer/arrêter.
PROG_NAME2="conky -c /home/$USER/.conky/Mimod-white/Mimod-white1.conf" # Nom du programme à démarrer/arrêter.
PROCESSPID1=$(pgrep -f /home/$USER/.conky/Mimod-white/Mimod-white.conf) # Récupère le PID du processus.
PROCESSPID2=$(pgrep -f /home/$USER/.conky/Mimod-white/Mimod-white1.conf) # Récupére le PID du processus.
if [[ "$PROCESSPID1" != "" && "$PROCESSPID2" != "" ]]; then # Si les deux processus existe alors on le(s) kill.
kill $PROCESSPID1 && echo "Stop $PROG_NAME1 (PID: $PROCESSPID1)"
kill $PROCESSPID2 && echo "Stop $PROG_NAME2 (PID: $PROCESSPID2)"
else # Si aucun processus on démarre le programme.
kill $PROCESSPID1
$PROG_NAME1 &
echo "Start $PROG_NAME1"
kill $PROCESSPID2
$PROG_NAME2 &
echo "Start $PROG_NAME2"
if [[ "$PROCESSPID1" == "" || "$PROCESSPID2" == "" ]]; then # Si un des processus n'existe pas alors on le(s) kill.
kill $PROCESSPID1 && echo "Stop $PROG_NAME1 (PID: $PROCESSPID1)"
kill $PROCESSPID2 && echo "Stop $PROG_NAME2 (PID: $PROCESSPID2)"
echo "Il y a eu un souci au lancement tout a été coupé"
fi
fi@+
Last edited by loutch (2025-11-17 15:59:35)
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
- le terminal envoie-t-il un message d'erreur?
- quelle version conky ?
- est Wayland dans le jeu ?
-----
- does the terminal issue an error message?
- which conky version?
-is wayland in the game?
Offline
Re
terminal
conky -c $HOME/.conky/Mimod-white/Mimod-white.conf
conky: desktop window (c00044) is subwindow of root window (4b9)
conky: window type - normal
conky: drawing to created window (0x2c00002)
conky: drawing to double buffer
conky: llua_load: /home/romuald/.conky/Mimod-white/loader.lua:8: unfinished string near '".conky/Mimod-white/scripts/rings.lua'
conky: forked to background, pid is 3502707
romuald@RogStrix:~$
conky: llua_do_call: function conky_loader_lua execution failed: attempt to call a nil value
conky: llua_do_call: function conky_loader_lua execution failed: attempt to call a nil value
conky: llua_do_call: function conky_loader_lua execution failed: attempt to call a nil value
conky: llua_do_call: function conky_loader_lua execution failed: attempt to call a nil value
conky: llua_do_call: function conky_loader_lua execution failed: attempt to call a nil value
conky: llua_do_call: function conky_loader_lua execution failed: attempt to call a nil value
conky: llua_do_call: function conky_loader_lua execution failed: attempt to call a nil value
conky: llua_do_call: function conky_loader_lua execution failed: attempt to call a nil valueversion
conky -v
conky 1.19.6 compiled 2024-04-01 for Linux x86_64
Compiled in features:
System config file: /etc/conky/conky.conf
Package library path: /usr/lib/conky
General:
* math
* hddtemp
* portmon
* IPv6
* IRC
* Curl
* RSS
* ICal
* iconv
* wireless
* support for IBM/Lenovo notebooks
* nvidia
* builtin default configuration
* old configuration syntax
* Imlib2
* OSS mixer support
* apcupsd
* iostats
* ncurses
* Internationalization support
* PulseAudio
Lua bindings:
* Cairo
* Imlib2
* RSVG
X11:
* Xdamage extension
* Xinerama extension (virtual display)
* Xshape extension (click through)
* XDBE (double buffer extension)
* Xft
* ARGB visual
* Own window
* Mouse evenets
Music detection:
* Audacious
* CMUS
* MPD
* MOC
Default values:
* Netdevice: eno1
* Local configfile: $HOME/.conkyrc
* Localedir: /usr/share/locale
* Maximum netdevices: 256
* Maximum text size: 16384
* Size text buffer: 256No wayland .
@+
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
Re
Ich habe ein wenig am Lua-Launcher gearbeitet.
Jetzt habe ich keine Fehler mehr im Terminal.
Das Wettersymbol wird angezeigt, ebenso wie das Netzwerk-Skript, aber dieses funktioniert nicht.
![]()
----------------------------------------
Worked a little on the Lua launcher.
Now I no longer have any errors in the terminal.
The weather icon is displayed, as well as the network script, but the latter is not working.
@+
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
terminal
conky: llua_load: /home/romuald/.conky/Mimod-white/loader.lua:8: unfinished string near '".conky/Mimod-white/scripts/rings.lua'lua_loader
dofile (usrhome ..".conky/Mimod-white/scripts/rings.luail manque
")----
it is missing ![]()
Offline
Re
Oups ,
Same thing weather icons & network line are visible but this line don't work .
@+
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
Re
Ich habe ein wenig am Lua-Launcher gearbeitet.
Jetzt habe ich keine Fehler mehr im Terminal.
Das Wettersymbol wird angezeigt, ebenso wie das Netzwerk-Skript, aber dieses funktioniert nicht.
https://thumbs2.imgbox.com/f0/64/jyXK09qV_t.png
----------------------------------------
Worked a little on the Lua launcher.Now I no longer have any errors in the terminal.
The weather icon is displayed, as well as the network script, but the latter is not working.
@+
Is this available in other languages? Including my favourite language.
Offline
Re
Ich habe ein wenig am Lua-Launcher gearbeitet.
Jetzt habe ich keine Fehler mehr im Terminal.
Das Wettersymbol wird angezeigt, ebenso wie das Netzwerk-Skript, aber dieses funktioniert nicht.
https://thumbs2.imgbox.com/f0/64/jyXK09qV_t.png
----------------------------------------
Worked a little on the Lua launcher.Now I no longer have any errors in the terminal.
The weather icon is displayed, as well as the network script, but the latter is not working.
@+
Je ne vois pas ce qui ne va pas dans cette image...
----
I can't see what's wrong with the picture...
Offline