You are not logged in.
Hello
No, nothing serious, just some blood leaking into my skull and compressing my brain.
After a few treatments it's better, but it's still knocking.
Let's talk about conky.
Another config like weewx Now which one to choose
@+
Last edited by loutch (2024-06-13 09:05:41)
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 wish you good health because that is the most important thing.
Another config like weewx Now which one to choose
Yes indeed.
They both look great and it's not easy to decide.
P.S.
I think the moon image looks better if you use the moongiant conky script.
If people would know how little brain is ruling the world, they would die of fear.
Offline
Hello
Here's some coding to help me forget my headache since i got home from hospital. It's accuweatherAPI. Look like Weewx
https://i.postimg.cc/zy62SQGN/Capture-d-cran-2024-06-10-11-20-48.png
@+
That sux mate, get well soon !
I guess that I would get headaches from codings on my end !
My Linux installs are as in my music; it s on Metal
Offline
Get well soon loutch.
Debian 12 Beardog, SoxDog and still a Conky 1.9er
Offline
Hello
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
RadioTray NG
@loutch made a RadioTray NG conky script a long time ago.
I found his script on another forum and I'm not sure if it's the latest one.
That script works great, Googlebot sometimes doesn't find the right image, but that's to be expected.
Anyway, I decided to see if I could adjust it since I always listen to RadioTray NG.
I think I improved a few things:
1) Fixed error:
Warning: User-Agent string does not contain "Lynx" or "L_y_n_x"!
2) His script creates two images that change very often (every ten seconds Conky starts the script). Now we only have one image until the song changes.
3) I replaced Googlebot-Image/1.0 with GoogleOther-Image/1.0.
GoogleOther-Image is the version of GoogleOther optimized for fetching publicly accessible image URLs. It goes under the User agent tokens; GoogleOther-Image and GoogleOther and uses the full user agent string GoogleOther-Image/1.0.
4) I added headphones (when the radio was disabled).
Of course, you can try if you use RadioTray NG.
You need to install lynx:
$ sudo apt install lynx
Create a ~/.conky/RadioTray_NG folder.
Open the folder and create the mpris-radiotray-ng file (script) inside:
#!/bin/bash
#créé par loutch
#2018-12-27 modifier par TeoBigusGeekus et loutch pour radiotray-ng et conky 1.10
#2021-02-20 modifier par nic80 et loutch
#qdbus com.github.radiotray_ng /com/github/radiotray_ng com.github.radiotray_ng.get_player_state | grep artist |sed 's/^.*" \: "//' |sed 's/",.*$//' > artiste_titre.txt
pacmd list-sink-inputs | grep -A 2 'Radiotray-NG' | awk 'END{print}' | awk -F'"' '{print $2}' | awk -F' - ' '{print $1}' > $HOME/.conky/RadioTray_NG/cover
#qdbus com.github.radiotray_ng /com/github/radiotray_ng com.github.radiotray_ng.get_player_state | grep title |sed 's/^.*" \: "//' |sed 's/",.*$//' >> artiste_titre.txt
pacmd list-sink-inputs | grep -A 2 'Radiotray-NG' | awk 'END{print}' | awk -F'"' '{print $2}' | awk -F' - ' '{print $2}' >> $HOME/.conky/RadioTray_NG/cover
cover1=$(sed -n '1p' $HOME/.conky/RadioTray_NG/cover)
cover2=$(sed -n '2p' $HOME/.conky/RadioTray_NG/cover)
cover3=$(sed -n '1p' $HOME/.conky/RadioTray_NG/cover-old)
cover4=$(sed -n '2p' $HOME/.conky/RadioTray_NG/cover-old)
if [[ "$cover1" == "$cover3" && "$cover2" == "$cover4" ]]; then
exit 0
else
cp $HOME/.conky/RadioTray_NG/cover $HOME/.conky/RadioTray_NG/cover-old
art=$(cat $HOME/.conky/RadioTray_NG/cover)
lynx --source -useragent="Lynx; GoogleOther-Image/1.0" "www.google.com/search?q=$art\&tbm=isch" | perl -pe 's!.*<img .* src="([^"]*)".*!$1!' > $HOME/.conky/RadioTray_NG/radiotray_ng
sed -i 's/^.* http\:/http\:/' $HOME/.conky/RadioTray_NG/radiotray_ng
sed -i '/gstatic/!d' $HOME/.conky/RadioTray_NG/radiotray_ng
if [[ "$cover1" == "" && "$cover2" == "" ]]; then
cp $HOME/.conky/RadioTray_NG/headphone.png $HOME/.conky/RadioTray_NG/radiotray_ng.png
else
radiotray_ng=$(cat $HOME/.conky/RadioTray_NG/radiotray_ng)
lynx -dump "$radiotray_ng" > $HOME/.conky/RadioTray_NG/radiotray_ng.png
fi
fi
#convert miniatureGoogleImage pochette.png
Make the script executable.
Download headphone.png and copy/paste into the ~/.conky/RadioTray_NG folder.
I created in the same folder RadioTray_NG conky with the usual configuration (like accuweather or moongiant):
${texeci 10 bash $HOME/.conky/RadioTray_NG/mpris-radiotray-ng}\
${image $HOME/.conky/RadioTray_NG/radiotray_ng.png -p 0,0 -s 128x128}
Done.
If @loutch feels better (hopefully) it would be interesting to see some parallel testing.
Thanks to:
Last edited by marens (2024-06-21 17:15:10)
If people would know how little brain is ruling the world, they would die of fear.
Offline
@loutch
This is your pochette.sh script (from 2021) that I found on another forum:
#!/bin/bash
#créé par loutch
#2018-12-27 modifier par TeoBigusGeekus et loutch pour radiotray-ng et conky 1.10
#2021-02-20 modifier par nic80 et loutch
qdbus com.github.radiotray_ng /com/github/radiotray_ng com.github.radiotray_ng.get_player_state | grep artist |sed 's/^.*" \: "//' |sed 's/",.*$//' > artiste_titre.txt
qdbus com.github.radiotray_ng /com/github/radiotray_ng com.github.radiotray_ng.get_player_state | grep title |sed 's/^.*" \: "//' |sed 's/",.*$//' >> artiste_titre.txt
titre=$(cat artiste_titre.txt)
lynx --source -useragent="Googlebot-Image/1.0" "www.google.com/search?q=$titre\&tbm=isch" | perl -pe 's!.*<img .* src="([^"]*)".*!$1!' > lienMiniaturefile
sed -i 's/^.* http\:/http\:/' lienMiniaturefile
sed -i '/gstatic/!d' lienMiniaturefile
lienMiniature=$(cat lienMiniaturefile)
lynx -dump "$lienMiniature" > miniatureGoogleImage
convert miniatureGoogleImage pochette.png
Here I kept all your basic settings and tried to improve them a bit.
pochette.sh
#!/bin/bash
#créé par loutch
#2018-12-27 modifier par TeoBigusGeekus et loutch pour radiotray-ng et conky 1.10
#2021-02-20 modifier par nic80 et loutch
qdbus com.github.radiotray_ng /com/github/radiotray_ng com.github.radiotray_ng.get_player_state | grep artist |sed 's/^.*" \: "//' |sed 's/",.*$//' > artiste_titre.txt
qdbus com.github.radiotray_ng /com/github/radiotray_ng com.github.radiotray_ng.get_player_state | grep title |sed 's/^.*" \: "//' |sed 's/",.*$//' >> artiste_titre.txt
## Marens
ligne1=$(sed -n '1p' artiste_titre.txt)
ligne2=$(sed -n '2p' artiste_titre.txt)
ligne3=$(sed -n '1p' artiste_titre_ex.txt)
ligne4=$(sed -n '2p' artiste_titre_ex.txt)
if [[ "$ligne1" == "$ligne3" && "$ligne2" == "$ligne4" ]]; then
exit 0
else
cp artiste_titre.txt artiste_titre_ex.txt
## la fin Marens
titre=$(cat artiste_titre.txt)
lynx --source -useragent="Lynx; Googlebot-Image/1.0" "www.google.com/search?q=$titre\&tbm=isch" | perl -pe 's!.*<img .* src="([^"]*)".*!$1!' > lienMiniaturefile
sed -i 's/^.* http\:/http\:/' lienMiniaturefile
sed -i '/gstatic/!d' lienMiniaturefile
lienMiniature=$(cat lienMiniaturefile)
## Marens
#lynx -dump "$lienMiniature" > miniatureGoogleImage
lynx -dump "$lienMiniature" > pochette.png
#convert miniatureGoogleImage pochette.png
fi
## la fin Marens
The first time you run conky from the terminal, you will get an error:
sed: can't read artiste_titre_ex.txt: No such file or directory
This happens because the file artiste_titre_ex.txt has not been created yet.
Just restart conky (from terminal) and no more errors.
Now look at your HOME folder.
We've avoided constant downloads (every 8s) and now have just one image.
The image pochette.png only changes when a new song appears.
P.S.
I don't have dbus installed but I tested the script with pacmd and it works as expected.
If people would know how little brain is ruling the world, they would die of fear.
Offline
RadioTray NG
After a few days of testing, which I did very easily because I always listen to RadioTray NG, I have my opinion.
Conclusion
All of the above scripts work quite well.
More precisely, as much as possible.
Explanation
How many times have you searched for an image on Google and immediately got the best one?
Yes, that can be a problem.
If you listen to radio stations that play only big hits and world-famous bands (artists), then the possibility that our scripts will work very well increases.
Otherwise, sometimes you can get a strange result (image), but luckily a new song is coming soon.
Note *
The most important thing is that this way you can create a script for each media player.
If people would know how little brain is ruling the world, they would die of fear.
Offline
Note *
The most important thing is that this way you can create a script for each media player.
Unfortunately, this is not entirely true.
The pacmd list-sink-inputs command does not always provide the ability to get titles and artists.
Tried Audacious and VLC but no data (title, artist).
I already wrote before that only Parole works well for me:
https://forums.bunsenlabs.org/viewtopic … 52#p134152
It was also confirmed in this case.
I started the Parole player and just replaced the commands for RadioTray NG with:
pacmd list-sink-inputs | grep media.artist | awk -F'"' '{print $2}' > $HOME/.conky/RadioTray_NG/cover
pacmd list-sink-inputs | grep media.title | awk -F'"' '{print $2}' >> $HOME/.conky/RadioTray_NG/cover
I love listening to old blues artists who aren't world famous and this was a great test for the script.
Honestly, I got more than expected because the result is excellent.
This has been tested (again):
These are some of the results:
Indeed many look better than in FM (Nautilus).
Anyway, it was very interesting testing.
Last edited by marens (2024-06-25 00:04:20)
If people would know how little brain is ruling the world, they would die of fear.
Offline
RadioTrayNG - Now Playing
This is my new script that searches for an image (album_art.png) when listening to RadioTrayNG.
The script is located in the same folder as the previous one (~/.conky/RadioTray_NG)
I'm not using Google to search for images this time.
mpris-radiotray-ng2:
#!/bin/bash
test1=$(pacmd list-sink-inputs | grep -A 2 'Radiotray-NG' | awk 'END{print}' | awk -F'"' '{print $2}' | awk -F' - ' '{print $1}')
test2=$(pacmd list-sink-inputs | grep -A 2 'Radiotray-NG' | awk 'END{print}' | awk -F'"' '{print $2}' | awk -F' - ' '{print $2}')
if [[ "$test1" == "$(sed -n '1p' $HOME/.conky/RadioTray_NG/cover-old)" && "$test2" == "$(sed -n '2p' $HOME/.conky/RadioTray_NG/cover-old)" ]]; then
exit 0
fi
echo $test1 > $HOME/.conky/RadioTray_NG/cover
echo $test2 >> $HOME/.conky/RadioTray_NG/cover
cp $HOME/.conky/RadioTray_NG/cover $HOME/.conky/RadioTray_NG/cover-old
if [[ "$test1" == "" && "$test2" == "" ]]; then
cp $HOME/.conky/RadioTray_NG/headphone.png $HOME/.conky/RadioTray_NG/album_art.png
else
artist=$(sed -n '1p' $HOME/.conky/RadioTray_NG/cover-old | sed 's/ /%20/g' | sed -e 's/$/%20-&/' | tr '[A-Z]' '[a-z]')
song=$(sed -n '2p' $HOME/.conky/RadioTray_NG/cover-old | sed 's/ /%20/g' | sed -e 's/$/\&size=medium&/' | sed 's/^/%20&/' | tr '[A-Z]' '[a-z]')
curl -H 'User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:80.0) Gecko/20100101 Firefox/80.0' -o $HOME/.conky/RadioTray_NG/image "https://aaaas.deno.dev?query=$artist$song"
album_art=$(sed -n '1p' $HOME/.conky/RadioTray_NG/image | sed 's/{"image"://g' | sed 's/}//g' | sed -e 's/.*"\(.*\)".*/\1/')
curl "$album_art" --output $HOME/.conky/RadioTray_NG/album_art.png
fi
Note *
Don't forget to make the script executable.
Conky:
${texeci 10 bash $HOME/.conky/RadioTray_NG/mpris-radiotray-ng2}\
${image $HOME/.conky/RadioTray_NG/album_art.png -p 0,0 -s 128x128}
EDIT
You can find the latest version of the radiotray-ng script here:
https://forums.bunsenlabs.org/viewtopic … 38#p140138
Last edited by marens (2025-07-08 22:44:20)
If people would know how little brain is ruling the world, they would die of fear.
Offline
RadioTrayNG - Now Playing
When a radio station broadcasts promo messages or advertisements, of course we don't have an album art image.
Although our source has several hundreds of thousands of album covers, it may happen that the album cover image is not available.
This will never happen if you only listen to big hits and world famous bands (artists) unlike me.
So I improved my script a bit and tried to predict these possibilities.
mpris-radiotray-ng2:
#!/bin/bash
test1=$(pacmd list-sink-inputs | grep -A 2 'Radiotray-NG' | awk 'END{print}' | sed -e 's/^[ \t]*//' | sed 's/media.title = "//' | sed 's/"//g' | awk -F' - ' '{print $1}' | sed 's/\\//g' | sed 's/é/e/g')
test2=$(pacmd list-sink-inputs | grep -A 2 'Radiotray-NG' | awk 'END{print}' | sed -e 's/^[ \t]*//' | sed 's/media.title = "//' | sed 's/"//g' | awk -F' - ' '{print $2}' | sed 's/\\//g')
if [[ "$test1" == "$(sed -n '1p' $HOME/.conky/RadioTray_NG/cover-old)" && "$test2" == "$(sed -n '2p' $HOME/.conky/RadioTray_NG/cover-old)" ]]; then
exit 0
fi
echo $test1 > $HOME/.conky/RadioTray_NG/cover
echo $test2 >> $HOME/.conky/RadioTray_NG/cover
cp $HOME/.conky/RadioTray_NG/cover $HOME/.conky/RadioTray_NG/cover-old
if [[ "$test1" == "" && "$test2" == "" ]]; then
cp $HOME/.conky/RadioTray_NG/headphone.png $HOME/.conky/RadioTray_NG/album_art.png
else
artist=$(sed -n '1p' $HOME/.conky/RadioTray_NG/cover-old | sed 's/ /%20/g' | sed -e 's/$/%20-&/' | tr '[A-Z]' '[a-z]')
song=$(sed -n '2p' $HOME/.conky/RadioTray_NG/cover-old | sed 's/ /%20/g' | sed -e 's/$/\&size=medium&/' | sed 's/^/%20&/' | tr '[A-Z]' '[a-z]')
curl -H 'User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:80.0) Gecko/20100101 Firefox/80.0' -o $HOME/.conky/RadioTray_NG/image "https://aaaas.deno.dev?query=$artist$song"
album_art=$(sed -n '1p' $HOME/.conky/RadioTray_NG/image | sed 's/{"image"://' | sed 's/}//' | sed 's/{//' | sed -e 's/.*"\(.*\)".*/\1/')
if [[ "$album_art" == "" ]]; then
cp $HOME/.conky/RadioTray_NG/not-available.png $HOME/.conky/RadioTray_NG/album_art.png
else
curl "$album_art" --output $HOME/.conky/RadioTray_NG/album_art.png
cat /dev/null > $HOME/.conky/RadioTray_NG/image
fi
fi
You will need the image not-available.png located in the same folder (~/.conky/RadioTray_NG) and you can download it here:
This is what RadioTrayNG conky looks like now:
Annika Chambers - Stand Up
Ronnie Baker Brooks - Doing Too Much
Charlie Musselwhite - Blues Up The River
Robert Cray - Track 14
Promo
P.S.
If I change the code in the future, I'll just edit this post and let you know with a link.
EDIT
Sometimes radio stations use double quotes in the title and this can be a problem for the script to find the album cover image.
The script has been updated.
Testing:
Artist: George "Harmonica" Smith
Album: "Now You Can Talk About Me"
Song: Astatic Stomp
The script works as expected and the album cover is found.
EDIT
You can find the latest version of the radiotray-ng script here:
https://forums.bunsenlabs.org/viewtopic … 38#p140138
Last edited by marens (2025-07-08 22:46:20)
If people would know how little brain is ruling the world, they would die of fear.
Offline
Hello
@ marens
As I'm using a lua script to display the album_art and I need a real .png for that, I've added this before the first fi, otherwise the album_art won't be displayed in the conky.
convert $HOME/.conky/RadioTray_NG/album_art.png $HOME/.conky/radiotrayng/pochette.png
Now it work great.
@+
Last edited by loutch (2024-07-23 08:12:20)
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
^ The source I use always comes out in .jpeg format.
It also works in conky.
It could look like this:
curl "$album_art" --output $HOME/.conky/RadioTray_NG/album_art.jpeg
cat /dev/null > $HOME/.conky/RadioTray_NG/image
If needed for your lua script, you can always add:
convert $HOME/.conky/RadioTray_NG/album_art.jpeg $HOME/.conky/radiotrayng/pochette.png
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
Hello guys
I would like to add to the fabulous section by marens hourly the wind direction and compass rose
I'm trying this but it don't work.
cat $HOME/Accuweather_conky_script/hourly | grep 'class="value' | awk -F'">' '{print $2}' | sed -r 's/.{6}$//' > $HOME/Accuweather_conky_script/marens_hourly/wind
If someone can look into it , there's no hurry thanks in advance
@+
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
^ Find the #Temperature part in #### Marens hourly and add below #Wind:
#Temperature
cat $HOME/Accuweather_conky_script/hourly | grep '"temp metric"' | awk -F'">' '{print $2}' | sed -r 's/.{12}$//' > $HOME/Accuweather_conky_script/marens_hourly/temperature
#Wind
cat $HOME/Accuweather_conky_script/hourly | grep 'Wind<' | sed 's/^[ \t]*//' | sed 's/<p>Wind<span class="value">//g' | sed 's/<\/span><\/p>//g' > $HOME/Accuweather_conky_script/marens_hourly/wind
Restart conky and check the file ~/Accuweather_conky_script/marens_hourly/wind.
If people would know how little brain is ruling the world, they would die of fear.
Offline
^ I don't know what the output will be when the wind is CALM.
That should be tested.
If people would know how little brain is ruling the world, they would die of fear.
Offline