The know-how.
Your'e will need the following files:
the tweaked
conkyrc of @ Sector11
# pkill -xf "conky -c ~/Conky/VO_Radiotray.conky" &
# works perfect Sector11 - 2012 (?)
# lua cover by google of @loutch https://forums.bunsenlabs.org/viewtopic.php?id=3282
# unklar Januar 2017
### Begin Window Settings ##################################################
# Create own window instead of using desktop (required in nautilus)
own_window yes
# Use the Xdbe extension? (eliminates flicker)
# It is highly recommended to use own window with this one
# so double buffer won't be so big.
double_buffer yes
own_window_type normal
own_window_transparent yes
own_window_hints undecorated,below,skip_taskbar,skip_pager,sticky
# own_window_colour #4d4d4d
own_window_class Radio Tray
own_window_title Radio Tray
### ARGB can be used for real transparency
### NOTE that a composite manager is required for real transparency.
### This option will not work as desired (in most cases) in conjunction with
### own_window_type override
own_window_argb_visual yes
### When ARGB visuals are enabled, this use this to modify the alpha value
### Use: own_window_type normal
### Use: own_window_transparent no
### Valid range is 0-255, where 0 is 0% opacity, and 255 is 100% opacity.
own_window_argb_value 150
minimum_size 400 0 ## width, height
#maximum_width 210 ## width, usually a good idea to equal minimum width
gap_x 10 ### left &right
gap_y 40 ### up & down
## Alignment
# top_left, top_right, top_middle - tl, tm, tr
# middle_left, middle_middle, middle_right - bl, bm, br
# bottom_left, bottom_right, bottom_middle - ml, mm, mr
alignment tr
#################################################### End Window Settings ###
### Font Settings ##########################################################
# Use Xft (anti-aliased font and stuff)
use_xft yes
xftfont birdman:size=9
#xftfont WenQuanYi Micro Hei Mono:bold:size=8
# Alpha of Xft font. Must be a value at or between 1 and 0 ###
xftalpha 1
# Force UTF8? requires XFT ###
override_utf8_locale yes
draw_shades no #### <<<<<<------------------To see it easier on light screens.
#default_shade_color black
draw_outline no #### <<<<<<---------------- Amplifies text if yes
default_outline_color black
UPPERcase no
###################################################### End Font Settings ###
### Color Settings #########################################################
default_shade_color gray
default_outline_color black
default_color DCDCDC #Gainsboro
color0 ffe595 #Teo Gold
color1 778899 #LightSlateGrey
color2 FF8C00 #Darkorange
color3 7FFF00 #Chartreuse
color4 FFA07A #LightSalmon
color5 FFDEAD #NavajoWhite
color6 00BFFF #DeepSkyBlue
color7 00FFFF #Cyan #48D1CC #MediumTurquoise
color8 FFFF00 #Yellow
color9 FF0000 #Red #A52A2A #DarkRed
##################################################### End Color Settings ###
### Borders Section ########################################################
draw_borders no
# Stippled borders?
stippled_borders 0
# border margins
border_inner_margin 10
border_outer_margin 0
# border width
border_width 0
# graph borders
draw_graph_borders no
##################################################### End Borders Secton ###
### Miscellaneous Section ##################################################
# Boolean value, if true, Conky will be forked to background when started.
background no
# Adds spaces around certain objects to stop them from moving other things
# around, this only helps if you are using a mono font
# Options: right, left or none
use_spacer right
# Default and Minimum size is 256 - needs more for single commands that
# "call" a lot of text IE: bash scripts
text_buffer_size 256
# Subtract (file system) buffers from used memory?
no_buffers yes
# change GiB to G and MiB to M
short_units yes
# Like it says, ot pads the decimals on % values
# doesn't seem to work since v1.7.1
pad_percents 2
# Maximum size of user text buffer, i.e. layout below TEXT line in config file
# (default is 16384 bytes)
# max_user_text 16384
############################################## End Miscellaneous Section ###
### LUA Settings ###########################################################
## Above and After TEXT - requires a composite manager or blinks.
##
# lua_load ~/Conky/LUA/draw-bg.lua
#TEXT
#${lua conky_draw_bg 10 0 0 0 0 0x000000 0.6}
#
## ${lua conky_draw_bg corner_radius x_position y_position width height color alpha}
##
## OR Both above TEXT (No composite manager required - no blinking!)
#
lua_load ~/Music/image.lua
#lua_draw_hook fDrawImage
lua_load ~/Lua/draw-bg.lua
#lua_draw_hook_pre draw_bg 10 0 0 0 0 0x000000 0.1
#
####################################################### End LUA Settings ###
#digiThe all important - How often conky refreshes.
# If you have a "Crey" try: 0.2 - smokin' - but watch the CPU useage go UP!
update_interval 1 # in seconds
#${execpi 15 /media/DATEN/francescoPC/Conky/Music/nochNeuer.sh}\
#${image /tmp/radioswisspop.jpg -p 100,70 -s 60x60}\
TEXT
${lua conky_draw_bg 10 0 0 0 0 0x000000 0.1}\
${execi 10 qdbus net.sourceforge.radiotray /net/sourceforge/radiotray getCurrentMetaData| fold -s -w80 > ~/Music/radiotray/artiste_titre.txt}
${texeci 20 bash $HOME/Music/radiotray/pochette.sh}\
${lua fDrawImage $HOME/Music/radiotray/pochette.png 14 18 68 60}
${goto 90}${color}${if_match "${execi 10 qdbus net.sourceforge.radiotray /net/sourceforge/radiotray net.sourceforge.radiotray.getCurrentRadio}" == "not playing"}Radio?${else}${execi 10 qdbus net.sourceforge.radiotray /net/sourceforge/radiotray net.sourceforge.radiotray.getCurrentRadio}
${goto 90}Artist & Song
${goto 90}${color B0E0E6}${execi 10 qdbus net.sourceforge.radiotray /net/sourceforge/radiotray getCurrentMetaData| fold -s -w50}${color}${endif}
the lua script
image.lua of @mrpeachy
require 'cairo'
home = os.getenv ('HOME')
--Fonction d'affichage
function conky_fDrawImage(path,x,y,w,h,arc)
path = string.gsub(path, "~", home)
path = string.gsub(path, "$HOME", home)
local cs = cairo_xlib_surface_create(conky_window.display, conky_window.drawable, conky_window.visual, conky_window.width, conky_window.height)
local function fDrawImage(path,x,y,w,h,arc)
x=x+(w/2)
y=y+(h/2)
local img = cairo_image_surface_create_from_png(path)
local w_img, h_img = cairo_image_surface_get_width (img), cairo_image_surface_get_height (img)
local cr = cairo_create (cs)
cairo_translate (cr, x, y)
if arc then
cairo_rotate (cr, arc)
end
cairo_scale (cr, w/w_img, h/h_img)
cairo_set_source_surface (cr, img, -w_img/2, -h_img/2)
cairo_paint (cr)
cairo_destroy(cr)
cairo_surface_destroy (img)
end
fDrawImage(path,x,y,w,h,arc)
cairo_surface_destroy(cs)
return ""
end
the script from @loutch
pochette.sh#!bin/bash
titre=$(head -1 ~/Music/radiotray/artiste_titre.txt)
lienMiniature=$(wget -U'Googlebot-Image/1.0' -qO - "www.google.fr/search?q=$titre\&tbm=isch" | perl -pe 's!.*?<img .*?src="([^"]*)".*!$1!')
wget -qO miniatureGoogleImage $lienMiniature
convert ~/miniatureGoogleImage ~/Music/radiotray/pochette.png
convert from the package imagemagick
The principle:
- conky asks at sourceforge the artist and the title of the radio station set in Radiotray. These up to 80 characters are written to a .txt file.
- the brilliant script of loutch reads these characters and leaves the aunt Google
search for. The first hit/cover/image is placed in your $ HOME.
Since these are different image sizes, the script "instructs"
convert it to suit the Conky, which is the "end product"
to your desktop fetch.
If there are different covers, it can happen
(first hit).Is to be forgotten.
Have fun and pay attention to the PATH!
---------------------------------------------------------------------------------------------------------------
Das Know-how.
Du benötigst folgende Dateien:
die gezwickte conkyrc von @ Sector11
das lua script image.lua von @mrpeachy
das Script von @loutch pochette.sh
convert aus dem Paket imagemagick
Das Prinzip:
-conky fragt bei sourceforge den Künstler und den Titel des eingestellten Radiosender in Radiotray. Diese bis zu 80 Zeichen werden in eine .txt-Datei geschrieben.
- das brillante Skript von loutch liest diese Zeichen und lässt Tante Google
suchen. Der erste Treffer / Cover / Bild wird in deinem $ HOME platziert.
Da es sich um unterschiedliche Bildgrößen handelt, "beauftragt" das Skript
convert es für Conky passend zu machen, der das "Endprodukt" auf deinem Desktop holt.
Wenn es unterschiedliche Cover gibt, kann es dazu kommen
(erster Treffer).Ist zu verschmerzen.
Habe Spaß und beachte die PFADE!