Conky radiotray-ng 2021 avec recherche de pochettes (il faut lynx et jq)
Le conky fonctionne avec mes radios , vous pouvez y mettre les vôtres dans ce qu'a il vous faudra mettre le logo de celles-ci et remplacer les xx pour une bonne position
${if_match "${execi 4 qdbus com.github.radiotray_ng /com/github/radiotray_ng com.github.radiotray_ng.get_player_state | jq -r '.station'}" == "blabla"} ${lua fDrawImage ~/.conky/radiotrayng/logos/blabla .png XXX XX XX XX} ${else}
le conkyrc
Code : Tout sélectionner
conky.config = {
background = true,
use_xft = true,
font = 'Liberation Sans:size=7',
xftalpha = 1,
update_interval = 1.0,
total_run_times = 0,
own_window = true,
own_window_transparent = true,
--own_window_color 000000
own_window_argb_visual = true,
--own_window_argb_value = 250,
own_window_type = 'normal',
own_window_hints = 'undecorated,below,skip_taskbar,skip_pager',
double_buffer = true,
minimum_width = 400, minimum_height = 100,
--maximum_width 200
text_buffer_size = 2048,
draw_shades = false,
draw_outline = false,
draw_borders = false,
draw_graph_borders = false,
default_color = 'white',
default_outline_color = 'white',
alignment = 'top_left',
gap_x = 780,
gap_y = 50,
no_buffers = true,
uppercase = false,
cpu_avg_samples = 2,
override_utf8_locale = true,
imlib_cache_flush_interval = 60,
imlib_cache_size = 10000,
-- Taille des pointillés
stippled_borders = 5,
-- Couleurs
default_color = '#ffffff',--ffd579
default_shade_color = '#333333',
default_outline_color = 'black',
lua_load = '~/.conky/lua/image.lua',
};
conky.text = [[
${texeci 8 ~/.conky/radiotrayng/pochette.sh}
${voffset -4}${alignc -90}${font GE Inspira:size=12}${execi 5 qdbus com.github.radiotray_ng /com/github/radiotray_ng com.github.radiotray_ng.get_player_state | jq -r '.station'}$font ${goto 340}Vol: ${exec amixer get Master | awk 'NR==5{print $4}' | tr -d {[]}}
${voffset 33}${alignc}${execi 4 qdbus com.github.radiotray_ng /com/github/radiotray_ng com.github.radiotray_ng.get_player_state | jq -r '.artist'}
${alignc}${execi 4 qdbus com.github.radiotray_ng /com/github/radiotray_ng com.github.radiotray_ng.get_player_state | jq -r '.title'}
${lua fDrawImage $HOME/.conky/radiotrayng/images/case.png 0 0 410 108}
${if_match "${execi 4 qdbus com.github.radiotray_ng /com/github/radiotray_ng com.github.radiotray_ng.get_player_state | jq -r '.station'}" == "RTL"} ${lua fDrawImage ~/.conky/radiotrayng/logos/rtl.png 240 32 50 50} ${else}
${if_match "${execi 4 qdbus com.github.radiotray_ng /com/github/radiotray_ng com.github.radiotray_ng.get_player_state | jq -r '.station'}" == "Hotmixradio 80"} ${lua fDrawImage ~/.conky/radiotrayng/logos/hotmix80.png 248 28 35 35} ${else}
${if_match "${execi 4 qdbus com.github.radiotray_ng /com/github/radiotray_ng com.github.radiotray_ng.get_player_state | jq -r '.station'}" == "Maxi 80"} ${lua fDrawImage ~/.conky/radiotrayng/logos/maxi80.png 250 29 35 35} ${else}
${if_match "${execi 4 qdbus com.github.radiotray_ng /com/github/radiotray_ng com.github.radiotray_ng.get_player_state | jq -r '.station'}" == "RTL2"} ${lua fDrawImage ~/.conky/radiotrayng/logos/rtl2.png 240 32 45 45} ${else}
${if_match "${execi 4 qdbus com.github.radiotray_ng /com/github/radiotray_ng com.github.radiotray_ng.get_player_state | jq -r '.station'}" == "MAGNUM LA RADIO"} ${lua fDrawImage ~/.conky/radiotrayng/logos/magnumradio.png 204 26 120 40}${else}
${if_match "${execi 4 qdbus com.github.radiotray_ng /com/github/radiotray_ng com.github.radiotray_ng.get_player_state | jq -r '.station'}" == "Radio Swiss Pop"} ${lua fDrawImage ~/.conky/radiotrayng/logos/rspop.png 250 30 35 35} ${else}
${if_match "${execi 4 qdbus com.github.radiotray_ng /com/github/radiotray_ng com.github.radiotray_ng.get_player_state | jq -r '.station'}" == "RFM"} ${lua fDrawImage ~/.conky/radiotrayng/logos/rfm.png 244 35 45 45} ${else}
${if_match "${execi 4 qdbus com.github.radiotray_ng /com/github/radiotray_ng com.github.radiotray_ng.get_player_state | jq -r '.station'}" == "80's & 90's hits"} ${lua fDrawImage ~/.conky/radiotrayng/logos/80-90.png 248 28 35 35} ${else}
${if_match "${execi 4 qdbus com.github.radiotray_ng /com/github/radiotray_ng com.github.radiotray_ng.get_player_state | jq -r '.station'}" == "Best Hits Radio 80's"}${lua fDrawImage ~/.conky/radiotrayng/logos/80.png 248 28 35 35} ${endif}
${endif}${endif}${endif}${endif}${endif}${endif}${endif}${endif}
${if_match "${execi 4 qdbus com.github.radiotray_ng /com/github/radiotray_ng com.github.radiotray_ng.get_player_state | jq -r '.title'}" == ""}${lua fDrawImage ~/.conky/radiotrayng/logos/radio.png 19 10 78 78}
${else}${lua fDrawImage ~/pochette.png 24 14 68 70}${endif}
#${lua fDrawImage ~/.conky/radiotrayng/logos/radio.png 19 10 78 78}
${lua fDrawImage ~/.conky/radiotrayng/images/stop.png 115 31 13 13}
${lua fDrawImage ~/.conky/radiotrayng/images/prev.png 100 45 13 13}
${lua fDrawImage ~/.conky/radiotrayng/images/play.png 115 45 13 13}
${lua fDrawImage ~/.conky/radiotrayng/images/next.png 130 45 13 13}
${lua fDrawImage ~/.conky/radiotrayng/images/pause.png 115 59 13 13}
${lua fDrawImage ~/.conky/radiotrayng/images/bar.png 98 78 48 4}
${lua fDrawImage ~/.conky/radiotrayng/images/grip.png 115 78 5 5}
${lua fDrawImage ~/.conky/radiotrayng/images/1-play.png 155 15 10 10}
${voffset -800}
Code : Tout sélectionner
#!/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

@+