Hi, hat jemand nen Tipp, wie man den Schatten der Schrift bearbeiten kann? Meiner soll dicker sein, aber ich kann dafür keine Einstellung finden. Danke.
[Sammelthread] Zeig mir deine ".conkyrc"!
Anmeldungsdatum: Beiträge: 756 |
|
||||
Anmeldungsdatum: Beiträge: 83 |
Hallo zusammen, ich bastel seit zwei Tagen mit Conky herum und bin da noch ziemlich neu in diesem Metier. Mit Hilfe dieses und diverser anderer Foren ist es mit zumindest gelungen, ein doch relativ bekanntes "conky" ein wenig auf meine Bedürfnisse anzupassen. Von meiner "Zielvorstellung" bin ich zwar noch meilenweit entfernt, und an vielen Stellen ist noch Baustelle angesagt, aber an einem Punkt komme ich aktuell gar nicht weiter. Ich habe in einem Archlinux Forum einen Beitrag gefunden, der ein lua script enthält, das "diskio" Auswertungen in kreisförmige conkys umwandelt. Ich habe versucht das in mein lua Script einzubinden, aber ich krieg es einfach nicht hin. Hat jemand einen Vorschlag oder mag einen Blick auf die Scripte werfen? Mein Lua script: --[[ Ring Meters by londonali1010 (2009) This script draws percentage meters as rings. It is fully customisable; all options are described in the script. IMPORTANT: if you are using the 'cpu' function, it will cause a segmentation fault if it tries to draw a ring straight away. The if statement near the end of the script uses a delay to make sure that this doesn't happen. It calculates the length of the delay by the number of updates since Conky started. Generally, a value of 5s is long enough, so if you update Conky every 1s, use update_num > 5 in that if statement (the default). If you only update Conky every 2s, you should change it to update_num > 3; conversely if you update Conky every 0.5s, you should use update_num > 10. ALSO, if you change your Conky, is it best to use "killall conky; conky" to update it, otherwise the update_num will not be reset and you will get an error. To call this script in Conky, use the following (assuming that you save this script to ~/scripts/rings.lua): lua_load ~/scripts/rings-v1.2.1.lua lua_draw_hook_pre ring_stats Changelog: + v1.2.1 -- Fixed minor bug that caused script to crash if conky_parse() returns a nil value (20.10.2009) + v1.2 -- Added option for the ending angle of the rings (07.10.2009) + v1.1 -- Added options for the starting angle of the rings, and added the "max" variable, to allow for variables that output a numerical value rather than a percentage (29.09.2009) + v1.0 -- Original release (28.09.2009) arg=conky_parse("${if_up wlan0}wlan0${else}eth0${endif}"), fg_colour=0xf0651f, fg_colour=conky_parse("${if_up wlan0}wlan0${else}eth0${endif}"), conky_parse("${cpu}") name=conky_parse("${acpitemp}"), ]] -- A TESTER --set alarm value, this is the value at which bar color will change --alarm_value=80 ----set alarm bar color, 1,0,0,1 = red fully opaque --ar,ag,ab,aa=1,0,0,1 -- couleurs 1 -- 1faaf0 -- f0651f -- f01f42 -- couleurs 2 + flashy -- 008cff -- ff7200 -- ff000d --normal_temp="0x1faaf0" --warn_temp="0xf0651f" --crit_temp="0xf01f42" -- Un mélange des deux normal="0x1faaf0" normal_temp="0x84FF00" warn="0xff7200" crit="0xff000d" -- seulement quand fond nécessaire corner_r=35 bg_colour=0x333333 bg_alpha=0.2 settings_table = { { name='execi 5 nvidia-settings -q [gpu:0]/UsedDedicatedGPUMemory -t', arg='', max=512, bg_colour=0x000000, bg_alpha=0.2, fg_colour=0x1faaf0, fg_alpha=0.8, x=340, y=92, radius=23, thickness=10, start_angle=100, end_angle=360 }, { name='nvidia memfreq', arg='', max=800, bg_colour=0x000000, bg_alpha=0.4, fg_colour=0x1faaf0, fg_alpha=0.8, x=340, y=92, radius=35, thickness=10, start_angle=100, end_angle=360 }, { name='nvidia gpufreq', arg='', max=500, bg_colour=0x000000, bg_alpha=0.6, fg_colour=0x1faaf0, fg_alpha=0.8, x=340, y=92, radius=47, thickness=10, start_angle=100, end_angle=360 }, { name='nvidia temp', arg='', max=90, bg_colour=0x000000, bg_alpha=0.8, fg_colour=0x84FF00, fg_alpha=1.0, x=340, y=92, radius=57, thickness=4, start_angle=100, end_angle=360 }, { name='acpitemp', arg='', max=90, bg_colour=0x000000, bg_alpha=0.8, fg_colour=0x84FF00, fg_alpha=1.0, x=200, y=194, radius=97, thickness=4, start_angle=0, end_angle=240 }, { name='cpu', arg='cpu0', max=100, bg_colour=0x000000, bg_alpha=0.8, fg_colour=0x1faaf0, fg_alpha=0.8, x=200, y=194, radius=86, thickness=13, start_angle=0, end_angle=240 }, { name='cpu', arg='cpu1', max=100, bg_colour=0x000000, bg_alpha=0.7, fg_colour=0x1faaf0, fg_alpha=0.8, x=200, y=194, radius=71, thickness=12, start_angle=0, end_angle=240 }, { name='memperc', arg='', max=100, bg_colour=0x000000, bg_alpha=0.8, fg_colour=0x1faaf0, fg_alpha=0.8, x=340, y=308, radius=60, thickness=15, start_angle=180, end_angle=420 }, { name='execi 60 hddtemp -n /dev/sda', arg='', max=70, bg_colour=0x000000, bg_alpha=0.8, fg_colour=0x84FF00, fg_alpha=0.8, x=220, y=354, radius=37, thickness=4, start_angle=0, end_angle=240 }, { name='diskio', arg='', max=5*1024*1024, --Bytes/second bg_colour=0x000000, bg_alpha=0.8, fg_colour=0x1faaf0, fg_alpha=0.8, x=220, y=354, radius=28, thickness=10, start_angle=0, end_angle=240 }, { name='fs_used_perc', arg='/', max=100, bg_colour=0x000000, bg_alpha=0.8, fg_colour=0x1faaf0, fg_alpha=0.8, x=220, y=354, radius=16, thickness=10, start_angle=0, end_angle=240 }, { name='downspeedf', arg='', max=2000, bg_colour=0x000000, bg_alpha=0.8, fg_colour=0x1faaf0, fg_alpha=0.8, x=290, y=420, radius=30, thickness=12, start_angle=180, end_angle=420 }, { name='upspeedf', arg='', max=200, bg_colour=0x000000, bg_alpha=0.6, fg_colour=0x1faaf0, fg_alpha=0.8, x=290, y=420, radius=18, thickness=8, start_angle=180, end_angle=420 }, { name='time', arg='%S', max=60, bg_colour=0x000000, bg_alpha=0.8, fg_colour=0x1faaf0, fg_alpha=0.8, x=230, y=484, radius=30, thickness=12, start_angle=0, end_angle=240 }, { name='time', arg='%M', max=60, bg_colour=0x000000, bg_alpha=0.6, fg_colour=0x1faaf0, fg_alpha=0.8, x=230, y=484, radius=18, thickness=8, start_angle=0, end_angle=240 }, { name='time', arg='%H', max=24, bg_colour=0x000000, bg_alpha=0.4, fg_colour=0x1faaf0, fg_alpha=0.8, x=230, y=484, radius=10, thickness=4, start_angle=0, end_angle=240 }, { name='battery_percent', arg='BAT0', max=100, bg_colour=0x000000, bg_alpha=0.6, fg_colour=0x1faaf0, fg_alpha=0.8, x=274, y=538, radius=18, thickness=10, start_angle=180, end_angle=420 }, { name='acpiacadapter', arg='on-line', max=1, bg_colour=0x000000, bg_alpha=0.6, fg_colour=0x1faaf0, fg_alpha=0.6, x=274, y=538, radius=3, thickness=13, start_angle=0, end_angle=360 }, } require 'cairo' function rgb_to_r_g_b(colour,alpha) return ((colour / 0x10000) % 0x100) / 255., ((colour / 0x100) % 0x100) / 255., (colour % 0x100) / 255., alpha end function draw_ring(cr,t,pt) local w,h=conky_window.width,conky_window.height local xc,yc,ring_r,ring_w,sa,ea=pt['x'],pt['y'],pt['radius'],pt['thickness'],pt['start_angle'],pt['end_angle'] local bgc, bga, fgc, fga=pt['bg_colour'], pt['bg_alpha'], pt['fg_colour'], pt['fg_alpha'] local angle_0=sa*(2*math.pi/360)-math.pi/2 local angle_f=ea*(2*math.pi/360)-math.pi/2 local t_arc=t*(angle_f-angle_0) -- Draw background ring cairo_arc(cr,xc,yc,ring_r,angle_0,angle_f) cairo_set_source_rgba(cr,rgb_to_r_g_b(bgc,bga)) cairo_set_line_width(cr,ring_w) cairo_stroke(cr) -- Draw indicator ring cairo_arc(cr,xc,yc,ring_r,angle_0,angle_0+t_arc) cairo_set_source_rgba(cr,rgb_to_r_g_b(fgc,fga)) cairo_stroke(cr) end function conky_ring_stats() local function setup_rings(cr,pt) local str='' local value=0 str=string.format('${%s %s}',pt['name'],pt['arg']) str=conky_parse(str) value=tonumber(str) if value == nil then value = 0 end pct=value/pt['max'] draw_ring(cr,pct,pt) end if conky_window==nil then return end local cs=cairo_xlib_surface_create(conky_window.display,conky_window.drawable,conky_window.visual, conky_window.width,conky_window.height) local cr=cairo_create(cs) local updates=conky_parse('${updates}') update_num=tonumber(updates) if update_num>5 then for i in pairs(settings_table) do display_temp=temp_watch() setup_rings(cr,settings_table[i]) end end cairo_surface_destroy(cs) cairo_destroy(cr) end -- Contrôle de l'espace disque function disk_watch() warn_disk=93 crit_disk=98 -- poser une boucle plus tard... pas simple disk=tonumber(conky_parse("${fs_used_perc /}")) if disk<warn_disk then settings_table[8]['fg_colour']=normal elseif disk<crit_disk then settings_table[8]['fg_colour']=warn else settings_table[8]['fg_colour']=crit end disk=tonumber(conky_parse("${fs_used_perc /usr}")) if disk<warn_disk then settings_table[10]['fg_colour']=normal elseif disk<crit_disk then settings_table[10]['fg_colour']=warn else settings_table[10]['fg_colour']=crit end end -- Contrôle de la température acpitemp & nvidia & ssd function temp_watch() warn_value_a=65 crit_value_a=75 warn_value_b=60 crit_value_b=75 warn_value_c=55 warn_value_c=65 temperature=tonumber(conky_parse("${acpitemp}")) if temperature<warn_value_a then settings_table[5]['fg_colour']=normal_temp elseif temperature<crit_value_a then settings_table[5]['fg_colour']=warn else settings_table[5]['fg_colour']=crit end temperature=tonumber(conky_parse("${nvidia temp}")) if temperature<warn_value_b then settings_table[4]['fg_colour']=normal_temp elseif temperature<crit_value_b then settings_table[4]['fg_colour']=warn else settings_table[4]['fg_colour']=crit end temperature=tonumber(conky_parse("${execi 60 hddtemp -n /dev/sda}")) if temperature<warn_value_c then settings_table[9]['fg_colour']=normal_temp elseif temperature<crit_value_c then settings_table[9]['fg_colour']=warn else settings_table[9]['fg_colour']=crit end end --[[ Contrôle de la diskio function conky_ring_stats() --local function setup_rings(cr,pt) -- local str='' --local value=0 --str=string.format('${%s %s}',pt['name'],pt['arg']) --str=conky_parse(str) if pt['name'] == 'diskio' or pt['name'] == 'diskio_read' or pt['name'] == 'diskio_write' then --what units? if string.find(str,'M') == nil then if string.find(str,'K') == nil then --bytes --value=tonumber(string.sub(str,0,string.find(str,'B'))) str=string.sub(str,0,string.find(str,'B')-1) value=tonumber(str) else --kilobytes --value=tonumber(string.sub(str,0,string.find(str,'KiB')))*1024*1024 str=string.sub(str,0,string.find(str,'K')-1) value=tonumber(str)*1024 end else --megabytes --value=tonumber(string.sub(str,0,string.find(str,'MiB')))*1024*1024 str=string.sub(str,0,string.find(str,'M')-1) value=tonumber(str)*1024*1024 end if value == nil then value = 0 end else value=tonumber(str) end]] -- Contrôle de l'interface active function iface_watch() iface=conky_parse("${if_existing /proc/net/route eth0}eth0${else}wlan0${endif}") settings_table[12]['arg']=iface settings_table[13]['arg']=iface end function conky_draw_bg() if conky_window==nil then return end local w=conky_window.width local h=conky_window.height local cs=cairo_xlib_surface_create(conky_window.display, conky_window.drawable, conky_window.visual, w, h) cr=cairo_create(cs) cairo_move_to(cr,corner_r,0) cairo_line_to(cr,w-corner_r,0) cairo_curve_to(cr,w,0,w,0,w,corner_r) cairo_line_to(cr,w,h-corner_r) cairo_curve_to(cr,w,h,w,h,w-corner_r,h) cairo_line_to(cr,corner_r,h) cairo_curve_to(cr,0,h,0,h,0,h-corner_r) cairo_line_to(cr,0,corner_r) cairo_curve_to(cr,0,0,0,0,corner_r,0) cairo_close_path(cr) cairo_set_source_rgba(cr,rgb_to_r_g_b(bg_colour,bg_alpha)) cairo_fill(cr) end function conky_main() temp_watch() disk_watch() iface_watch() conky_ring_stats() -- quand fond nécessaire -- conky_draw_bg() end Hier das lua-Script welches die Formatierungen für die Ringe enthält:
--[[ Ring Meters by londonali1010 (2009) This script draws percentage meters as rings. It is fully customisable; all options are described in the script. IMPORTANT: if you are using the 'cpu' function, it will cause a segmentation fault if it tries to draw a ring straight away. The if statement on line 145 uses a delay to make sure that this doesn't happen. It calculates the length of the delay by the number of updates since Conky started. Generally, a value of 5s is long enough, so if you update Conky every 1s, use update_num > 5 in that if statement (the default). If you only update Conky every 2s, you should change it to update_num > 3; conversely if you update Conky every 0.5s, you should use update_num > 10. ALSO, if you change your Conky, is it best to use "killall conky; conky" to update it, otherwise the update_num will not be reset and you will get an error. To call this script in Conky, use the following (assuming that you save this script to ~/scripts/rings.lua): lua_load ~/scripts/rings-v1.2.1.lua lua_draw_hook_pre ring_stats Changelog: + v1.2.1 -- Fixed minor bug that caused script to crash if conky_parse() returns a nil value (20.10.2009) + v1.2 -- Added option for the ending angle of the rings (07.10.2009) + v1.1 -- Added options for the starting angle of the rings, and added the "max" variable, to allow for variables that output a numerical value rather than a percentage (29.09.2009) + v1.0 -- Original release (28.09.2009) ]] conky_background_color = 0x000000 conky_background_alpha = 0.5 ring_background_color = 0xffffff ring_background_alpha = 0.15 ring_foreground_color = 0xffffff ring_foreground_alpha = 0.5 settings_table = { { -- Edit this table to customise your rings. -- You can create more rings simply by adding more elements to settings_table. -- "name" is the type of stat to display; you can choose from 'cpu', 'memperc', 'fs_used_perc', 'battery_used_perc'. name='time', -- "arg" is the argument to the stat type, e.g. if in Conky you would write ${cpu cpu0}, 'cpu0' would be the argument. -- If you would not use an argument in the Conky variable, use ''. arg='%I.%M', -- "max" is the maximum value of the ring. If the Conky variable outputs a percentage, use 100. max=12, -- "bg_colour" is the colour of the base ring. bg_colour=ring_background_color, -- "bg_alpha" is the alpha value of the base ring. bg_alpha=ring_background_alpha, -- "fg_colour" is the colour of the indicator part of the ring. fg_colour=ring_foreground_color, -- "fg_alpha" is the alpha value of the indicator part of the ring. fg_alpha=ring_foreground_alpha, -- "x" and "y" are the x and y coordinates of the centre of the ring, relative to the top left corner of the Conky window. x=26, y=30, -- "radius" is the radius of the ring. radius=10, -- "thickness" is the thickness of the ring, centred around the radius. thickness=6, -- "start_angle" is the starting angle of the ring, in degrees, clockwise from top. Value can be either positive or negative. start_angle=0, -- "end_angle" is the ending angle of the ring, in degrees, clockwise from top. Value can be either positive or negative, but must be larger (e.g. more clockwise) than start_angle. end_angle=360 }, { name='time', arg='%M.%S', max=60, bg_colour=ring_background_color, bg_alpha=ring_background_alpha, fg_colour=ring_foreground_color, fg_alpha=ring_foreground_alpha, x=26, y=30, radius=16, thickness=4, start_angle=0, end_angle=360 }, { name='time', arg='%S', max=60, bg_colour=ring_background_color, bg_alpha=ring_background_alpha, fg_colour=ring_foreground_color, fg_alpha=ring_foreground_alpha, x=26, y=30, radius=20, thickness=2, start_angle=0, end_angle=360 }, { name='cpu', arg='cpu1', max=100, bg_colour=ring_background_color, bg_alpha=ring_background_alpha, fg_colour=ring_foreground_color, fg_alpha=ring_foreground_alpha, x=26, y=80, radius=19, thickness=3, start_angle=-90, end_angle=210 }, { name='cpu', arg='cpu2', max=100, bg_colour=ring_background_color, bg_alpha=ring_background_alpha, fg_colour=ring_foreground_color, fg_alpha=ring_foreground_alpha, x=26, y=80, radius=15, thickness=3, start_angle=-90, end_angle=200 }, { name='memperc', arg='', max=100, bg_colour=ring_background_color, bg_alpha=ring_background_alpha, fg_colour=ring_foreground_color, fg_alpha=ring_foreground_alpha, x=26, y=130, radius=19, thickness=5, start_angle=-90, end_angle=200 }, { name='swapperc', arg='', max=100, bg_colour=ring_background_color, bg_alpha=ring_background_alpha, fg_colour=ring_foreground_color, fg_alpha=ring_foreground_alpha, x=26, y=130, radius=13, thickness=5, start_angle=-90, end_angle=180 }, { name='upspeedf', arg='eth0', max=250, bg_colour=ring_background_color, bg_alpha=ring_background_alpha, fg_colour=ring_foreground_color, fg_alpha=ring_foreground_alpha, x=26, y=180, radius=13, thickness=5, start_angle=-90, end_angle=180 }, { name='downspeedf', arg='eth0', max=500, bg_colour=ring_background_color, bg_alpha=ring_background_alpha, fg_colour=ring_foreground_color, fg_alpha=ring_foreground_alpha, x=26, y=180, radius=19, thickness=5, start_angle=-90, end_angle=200 }, { name='diskio_write', arg='', max=5*1024*1024, --Bytes/second bg_colour=ring_background_color, bg_alpha=ring_background_alpha, fg_colour=ring_foreground_color, fg_alpha=ring_foreground_alpha, x=26, y=230, radius=13, thickness=5, start_angle=-90, end_angle=200 }, { name='diskio_read', arg='', max=5*1024*1024, --Bytes/second bg_colour=ring_background_color, bg_alpha=ring_background_alpha, fg_colour=ring_foreground_color, fg_alpha=ring_foreground_alpha, x=26, y=230, radius=19, thickness=5, start_angle=-90, end_angle=200 } } require 'cairo' function rgb_to_r_g_b(colour,alpha) return ((colour / 0x10000) % 0x100) / 255., ((colour / 0x100) % 0x100) / 255., (colour % 0x100) / 255., alpha end function conky_round_rect(cr, x0, y0, w, h, r) if (w == 0) or (h == 0) then return end local x1 = x0 + w local y1 = y0 + h if w/2 < r then if h/2 < r then cairo_move_to (cr, x0, (y0 + y1)/2) cairo_curve_to (cr, x0 ,y0, x0, y0, (x0 + x1)/2, y0) cairo_curve_to (cr, x1, y0, x1, y0, x1, (y0 + y1)/2) cairo_curve_to (cr, x1, y1, x1, y1, (x1 + x0)/2, y1) cairo_curve_to (cr, x0, y1, x0, y1, x0, (y0 + y1)/2) else cairo_move_to (cr, x0, y0 + r) cairo_curve_to (cr, x0 ,y0, x0, y0, (x0 + x1)/2, y0) cairo_curve_to (cr, x1, y0, x1, y0, x1, y0 + r) cairo_line_to (cr, x1 , y1 - r) cairo_curve_to (cr, x1, y1, x1, y1, (x1 + x0)/2, y1) cairo_curve_to (cr, x0, y1, x0, y1, x0, y1- r) end else if h/2 < r then cairo_move_to (cr, x0, (y0 + y1)/2) cairo_curve_to (cr, x0 , y0, x0 , y0, x0 + r, y0) cairo_line_to (cr, x1 - r, y0) cairo_curve_to (cr, x1, y0, x1, y0, x1, (y0 + y1)/2) cairo_curve_to (cr, x1, y1, x1, y1, x1 - r, y1) cairo_line_to (cr, x0 + r, y1) cairo_curve_to (cr, x0, y1, x0, y1, x0, (y0 + y1)/2) else cairo_move_to (cr, x0, y0 + r) cairo_curve_to (cr, x0 , y0, x0 , y0, x0 + r, y0) cairo_line_to (cr, x1 - r, y0) cairo_curve_to (cr, x1, y0, x1, y0, x1, y0 + r) cairo_line_to (cr, x1 , y1 - r) cairo_curve_to (cr, x1, y1, x1, y1, x1 - r, y1) cairo_line_to (cr, x0 + r, y1) cairo_curve_to (cr, x0, y1, x0, y1, x0, y1- r) end end cairo_close_path (cr) end function draw_ring(cr,t,pt) local w,h=conky_window.width,conky_window.height local xc,yc,ring_r,ring_w,sa,ea=pt['x'],pt['y'],pt['radius'],pt['thickness'],pt['start_angle'],pt['end_angle'] local bgc, bga, fgc, fga=pt['bg_colour'], pt['bg_alpha'], pt['fg_colour'], pt['fg_alpha'] local angle_0=sa*(2*math.pi/360)-math.pi/2 local angle_f=ea*(2*math.pi/360)-math.pi/2 local t_arc=t*(angle_f-angle_0) -- Draw background ring cairo_arc(cr,xc,yc,ring_r,angle_0,angle_f) cairo_set_source_rgba(cr,rgb_to_r_g_b(bgc,bga)) cairo_set_line_width(cr,ring_w) cairo_stroke(cr) -- Draw indicator ring cairo_arc(cr,xc,yc,ring_r,angle_0,angle_0+t_arc) cairo_set_source_rgba(cr,rgb_to_r_g_b(fgc,fga)) cairo_stroke(cr) end cs, cr = nil -- initialize our cairo surface and context to nil function conky_ring_stats() local function setup_rings(cr,pt) local str='' local value=0 str=string.format('${%s %s}',pt['name'],pt['arg']) str=conky_parse(str) if pt['name'] == 'diskio' or pt['name'] == 'diskio_read' or pt['name'] == 'diskio_write' then --what units? if string.find(str,'M') == nil then if string.find(str,'K') == nil then --bytes --value=tonumber(string.sub(str,0,string.find(str,'B'))) str=string.sub(str,0,string.find(str,'B')-1) value=tonumber(str) else --kilobytes --value=tonumber(string.sub(str,0,string.find(str,'KiB')))*1024*1024 str=string.sub(str,0,string.find(str,'K')-1) value=tonumber(str)*1024 end else --megabytes --value=tonumber(string.sub(str,0,string.find(str,'MiB')))*1024*1024 str=string.sub(str,0,string.find(str,'M')-1) value=tonumber(str)*1024*1024 end if value == nil then value = 0 end else value=tonumber(str) end if value == nil then value = 0 end pct=value/pt['max'] draw_ring(cr,pct,pt) end if conky_window==nil then return end --local cs=cairo_xlib_surface_create(conky_window.display,conky_window.drawable,conky_window.visual, conky_window.width,conky_window.height) --local cr=cairo_create(cs) if cs == nil or cairo_xlib_surface_get_width(cs) ~= conky_window.width or cairo_xlib_surface_get_height(cs) ~= conky_window.height then if cs then cairo_surface_destroy(cs) end cs = cairo_xlib_surface_create(conky_window.display, conky_window.drawable, conky_window.visual, conky_window.width, conky_window.height) end if cr then cairo_destroy(cr) end cr = cairo_create(cs) local updates=conky_parse('${updates}') update_num=tonumber(updates) if update_num>3 then conky_round_rect(cr, 3, 0, conky_window.width-6, conky_window.height-3, 15) cairo_set_source_rgba(cr, rgb_to_r_g_b(conky_background_color, conky_background_alpha)) cairo_fill(cr) for i in pairs(settings_table) do setup_rings(cr,settings_table[i]) end end cairo_destroy(cr) cr = nil end function conky_cairo_cleanup() cairo_surface_destroy(cs) cs = nil end Wenn das einer lösen könnte, das wäre ein tolles Weihnachtsgeschenk! 😉 Gruß Yahya |
||||
Anmeldungsdatum: Beiträge: 744 |
Hi, scheint ja seit langem Keiner sein Conky hier vorzustellen, ist Conky nicht mehr interessant? Egal, hier ist meine Conky, einfach im Aussehen um schnell die Informationen sehen zu können. Grüßle, Naubaddi |
||||
Anmeldungsdatum: Beiträge: 6053 |
Ich habe ein kleines Problem mit meiner Conky. Zuerst mal das Script: conky.config = { -- — Conky settings — # background = true, update_interval = 2, total_run_times = 0, net_avg_samples = 2, override_utf8_locale = true, double_buffer = true, no_buffers = true, text_buffer_size = 2048, imlib_cache_size = 0, -- temperature_unit celsius -- — Window specifications — # own_window = true, -- own_window_type = 'desktop', own_window_argb_visual = true, -- own_window_argb_value = 50, own_window_transparent = true, -- own_window_colour = white, own_window_hints = 'undecorated,sticky,skip_taskbar,skip_pager,below', border_inner_margin = 0, border_outer_margin = 0, minimum_width = 270, minimum_height = 580, maximum_width = 270, alignment = 'top_right', gap_x = 10, gap_y = 40, -- — Graphics settings — # draw_shades = false, draw_outline = false, draw_borders = false, draw_graph_borders = false, -- — Text settings — # use_xft = true, font = 'Ubuntu:size=8', -- xftfont Sans:bold:size=8 xftalpha = 1.0, override_utf8_locale = true, default_color = '#FFFFFF', uppercase = false, use_spacer = 'right', color0 = white, --color1 orange --color2 green color1 = '#FFA300', color2 = '#9933CC', color3 = '#669900', color4 = '#FF8800', color5 = '#CC0000', color6 = '#AAAAAA', color7 = '#DDDDDD', }; conky.text = [[ ${image $HOME/.Conky/images/baseX.png -p 0,3 -s 282x580} ${goto 40}${color white}${font GE Inspira:pixelsize=86}${time %H:%M}${font} ${alignc -25}${font GE Inspira:bold:pixelsize=16}${color0}${font GE Inspira:bold:pixelsize=16}${time %A}, ${color1}${font GE Inspira:bold:pixelsize=16}${time %d} ${color0}${font GE Inspira:bold:pixelsize=16}${time %B} ${time %Y}${font} ${voffset 1} ${color lightgrey}${font}${goto 20}CPU1:$color ${freq 1} MHz ${goto 120}${cpubar cpu1 8,120} ${color lightgrey}${font}${goto 20}CPU2:$color ${freq 2} MHz ${goto 120}${cpubar cpu2 8,120} ${color lightgrey}${font}${goto 20}CPU3:$color ${freq 3} MHz ${goto 120}${cpubar cpu3 8,120} ${color lightgrey}${font}${goto 20}CPU4:$color ${freq 4} MHz ${goto 120}${cpubar cpu4 8,120} ${if_match "${execi 6 sensors | grep 'CPUTIN' | awk '{print $2}'}" != "+0.0°C"}${color lightgrey}${goto 20}CPU Temp:${goto 80}$color ${execi 6 sensors | grep 'CPUTIN' | awk '{print $2}'}${else}${color lightgrey}${goto 20}SYS Temp:${goto 80}$color ${execi 6 sensors | grep 'SYSTIN' | awk '{print $2}'}${endif} ${color lightgrey}${goto 20}Vcore:${goto 80}$color ${execi 2 sensors | grep 'Vcore' | awk '{print $2}'} V ${color lightgrey}${font}${goto 20}CPU Fan: $color ${execi 2 sensors | awk '/^fan2/ { print $2 }'} U/min ${goto 20}${cpugraph 32,220 009bf9 ffffff} ${goto 20}${color lightgrey}Name${goto 120}PID${goto 150}CPU%${goto 190}MEM% ${goto 20}$color${top name 1}${goto 115}${top pid 1}${goto 150}${top cpu 1}${goto 190}${top mem 1} ${goto 20}$color${top name 2}${goto 115}${top pid 2}${goto 150}${top cpu 2}${goto 190}${top mem 2} ${goto 20}$color${top name 3}${goto 115}${top pid 3}${goto 150}${top cpu 3}${goto 190}${top mem 3} ${goto 20}$color${top name 4}${goto 115}${top pid 4}${goto 150}${top cpu 4}${goto 190}${top mem 4} ${color lightgrey}${font}${goto 20}RAM: $color $memperc% ${goto 120}${membar 8,120} ${color lightgrey}${font}${goto 20}SWAP: $color $swapperc% ${goto 120}${swapbar 8,120} ${voffset 1} ${color lightgrey}${goto 20}Down:$color ${downspeed enp2s0}/s ${color lightgrey} ${goto 150}Up:$color ${upspeed enp2s0}/s ${color lightgrey}${goto 20}Total:$color ${totaldown enp2s0} ${color lightgrey} ${goto 150}$color ${totalup enp2s0} ${goto 20}${downspeedgraph enp2s0 32,100 009bf9 ffffff} ${goto 140}${upspeedgraph enp2s0 32,100 009bf9 ffffff} ${color lightgrey}${goto 20}IPs:$color ${addr enp2s0} ${goto 150}${execi 7200 ~/.Conky/ip.sh} ${voffset 1} ${color lightgrey}${goto 20}System:$color ${fs_used /}/${fs_size /} ${goto 160}${fs_bar 8,80 /} ${color lightgrey}${goto 20}Home:$color ${fs_used /home}/${fs_size /home} ${goto 160}${fs_bar 8,80 /home} ${voffset 5} ${color}${alignc}${execp cat /etc/issue |grep 'Ubuntu' | awk '{print $1 " " $2 " " $3}'} - $kernel ${alignc}${color}Uptime: ${uptime_short} ${if_running clementine} ${execi 2 sh $HOME/.Conky/meta.sh c}${image /tmp/tmp.jpg -p 35,615 -s 200x200} #${voffset 1} ${alignc}${color lightgrey}${color}${execi 2 sh $HOME/.Conky/meta.sh a} - ${color}${execi 2 sh $HOME/.Conky/meta.sh t} ${alignc}${color lightgrey}${color}${execi 2 sh $HOME/.Conky/meta.sh p} ${endif} ]]; Ich habe das Script um Funktionen für den Musikplayer Clementine erweitert. Funktioniert auch soweit. Die zusätzlichen Informationen werden nur eingeblendet wenn Clemnetine läuft. Mein Problem sieht man im angehängten Screenshot. Das Conky Fenster wird bei ca. 635 Pixeln abgeschnitten. Setze ich die Position des Covers testweise nach oben, wird es korrekt angezeigt. Hat jemand eine Idee über die Ursache? [Nachtrag] Mein DBus Script für Clementine:
|
||||
Anmeldungsdatum: Beiträge: 6053 |
Habs gefunden o.O minimum_height muss tatsächlich den maximal notwendigen Platz abdecken. Versteh ich nicht wirklich aber es funktioniert so. Dann habe ich noch die zweite Option die ablaufende Zeit als Bar anzuzeigen eingefügt: conky.config = { -- — Conky settings — # background = true, update_interval = 2, total_run_times = 0, net_avg_samples = 2, override_utf8_locale = true, double_buffer = true, no_buffers = true, text_buffer_size = 2048, imlib_cache_size = 0, -- temperature_unit celsius -- — Window specifications — # own_window = true, -- own_window_type = 'desktop', own_window_argb_visual = true, -- own_window_argb_value = 50, own_window_transparent = true, -- own_window_colour = white, own_window_hints = 'undecorated,sticky,skip_taskbar,skip_pager,below', border_inner_margin = 0, border_outer_margin = 0, minimum_width = 270, minimum_height = 820, -- maximum_width = 270, alignment = 'top_right', gap_x = 10, gap_y = 40, -- — Graphics settings — # draw_shades = false, draw_outline = false, draw_borders = false, draw_graph_borders = false, -- — Text settings — # use_xft = true, font = 'Ubuntu:size=8', -- xftfont Sans:bold:size=8 xftalpha = 1.0, override_utf8_locale = true, default_color = '#FFFFFF', uppercase = false, use_spacer = 'right', color0 = white, --color1 orange --color2 green color1 = '#FFA300', color2 = '#9933CC', color3 = '#669900', color4 = '#FF8800', color5 = '#CC0000', color6 = '#AAAAAA', color7 = '#DDDDDD', default_bar_width=200, default_bar_height=6, }; conky.text = [[ ${image $HOME/.Conky/images/baseX.png -p 0,3 -s 282x580} ${goto 40}${color white}${font GE Inspira:pixelsize=86}${time %H:%M}${font} ${alignc -25}${font GE Inspira:bold:pixelsize=16}${color0}${font GE Inspira:bold:pixelsize=16}${time %A}, ${color1}${font GE Inspira:bold:pixelsize=16}${time %d} ${color0}${font GE Inspira:bold:pixelsize=16}${time %B} ${time %Y}${font} ${voffset 1} ${color lightgrey}${font}${goto 20}CPU1:$color ${freq 1} MHz ${goto 120}${cpubar cpu1 8,120} ${color lightgrey}${font}${goto 20}CPU2:$color ${freq 2} MHz ${goto 120}${cpubar cpu2 8,120} ${color lightgrey}${font}${goto 20}CPU3:$color ${freq 3} MHz ${goto 120}${cpubar cpu3 8,120} ${color lightgrey}${font}${goto 20}CPU4:$color ${freq 4} MHz ${goto 120}${cpubar cpu4 8,120} ${if_match "${execi 6 sensors | grep 'CPUTIN' | awk '{print $2}'}" != "+0.0°C"}${color lightgrey}${goto 20}CPU Temp:${goto 80}$color ${execi 6 sensors | grep 'CPUTIN' | awk '{print $2}'}${else}${color lightgrey}${goto 20}SYS Temp:${goto 80}$color ${execi 6 sensors | grep 'SYSTIN' | awk '{print $2}'}${endif} ${color lightgrey}${goto 20}Vcore:${goto 80}$color ${execi 2 sensors | grep 'Vcore' | awk '{print $2}'} V ${color lightgrey}${font}${goto 20}CPU Fan: $color ${execi 2 sensors | awk '/^fan2/ { print $2 }'} U/min ${goto 20}${cpugraph 32,220 009bf9 ffffff} ${goto 20}${color lightgrey}Name${goto 120}PID${goto 150}CPU%${goto 190}MEM% ${goto 20}$color${top name 1}${goto 115}${top pid 1}${goto 150}${top cpu 1}${goto 190}${top mem 1} ${goto 20}$color${top name 2}${goto 115}${top pid 2}${goto 150}${top cpu 2}${goto 190}${top mem 2} ${goto 20}$color${top name 3}${goto 115}${top pid 3}${goto 150}${top cpu 3}${goto 190}${top mem 3} ${goto 20}$color${top name 4}${goto 115}${top pid 4}${goto 150}${top cpu 4}${goto 190}${top mem 4} ${color lightgrey}${font}${goto 20}RAM: $color $memperc% ${goto 120}${membar 8,120} ${color lightgrey}${font}${goto 20}SWAP: $color $swapperc% ${goto 120}${swapbar 8,120} ${voffset 1} ${color lightgrey}${goto 20}Down:$color ${downspeed enp2s0}/s ${color lightgrey} ${goto 150}Up:$color ${upspeed enp2s0}/s ${color lightgrey}${goto 20}Total:$color ${totaldown enp2s0} ${color lightgrey} ${goto 150}$color ${totalup enp2s0} ${goto 20}${downspeedgraph enp2s0 32,100 009bf9 ffffff} ${goto 140}${upspeedgraph enp2s0 32,100 009bf9 ffffff} ${color lightgrey}${goto 20}IPs:$color ${addr enp2s0} ${goto 150}${execi 7200 ~/.Conky/ip.sh} ${voffset 1} ${color lightgrey}${goto 20}System:$color ${fs_used /}/${fs_size /} ${goto 160}${fs_bar 8,80 /} ${color lightgrey}${goto 20}Home:$color ${fs_used /home}/${fs_size /home} ${goto 160}${fs_bar 8,80 /home} ${voffset 5} ${color}${alignc}${execp cat /etc/issue |grep 'Ubuntu' | awk '{print $1 " " $2 " " $3}'} - $kernel ${alignc}${color}Uptime: ${uptime_short} ${if_running clementine} ${execi 2 sh $HOME/.Conky/meta.sh c}${image /tmp/tmp.jpg -p 37,635 -s 200x200} #${voffset 1} ${alignc}${color lightgrey}${color}${execi 2 sh $HOME/.Conky/meta.sh a} ${alignc}${color lightgrey}${color}${execi 2 sh $HOME/.Conky/meta.sh t} #${alignc}${color lightgrey}${color}${execi 2 sh $HOME/.Conky/meta.sh p} ${alignc}${execbar sh $HOME/.Conky/meta.sh b} ${endif} ]]; |
||||
Anmeldungsdatum: Beiträge: 6053 |
Falls es jemanden interessiert. Das DBus Script funktioniert natürlich auch mit anderen Playern die DBus unterstützen. Für vlc sieht der Ausruf z.B so aus:
Es müssen nur alle Vorkommen von clementine zu vlc geändert werden und das Cover speichert VLC temporär an anderer Stelle. Für den jeweiligen Player einmal den obigen Befehl im Terminal ausführen. Da steht dann in artUrl der Speicherort. [Nachtrag] Ich stelle gerade fest das der Conky Befehl if_running die Ausgabe aller Zeilen bis zum endif unterdrückt aber trotzdem alle Befehle dazwischen durchläuft. Ich fange das jetzt mit einer entsprechenden IF Anweisung im Shellscript ab. [Nachtrag2] Auch der Pause und Angehalten Zustand bei laufendem Player muss abgefangen werden:
Und in der conkyrc sollte die DBus Abfrage nicht per execi x durchgeführt werden. Habe da alle Befehle zu exec geändert: ${if_running clementine} ${exec sh $HOME/.Conky/meta.sh c}${image /tmp/tmp.jpg -p 36,635 -s 200x200} ${alignc}${color}${exec sh $HOME/.Conky/meta.sh a} ${alignc}${color}${exec sh $HOME/.Conky/meta.sh t} #${alignc}${color}${exec sh $HOME/.Conky/meta.sh p} ${alignc}${execbar sh $HOME/.Conky/meta.sh b} ${endif}
|
||||
Anmeldungsdatum: Beiträge: 287 |
Danke Bleys! Das Skript läuft bei mir jetzt in einer abgespeckten Version und zeigt mir Artist und Künstler von Spotify auf Linux Mint an. Sieht Dateianhang. ☺ VG, Silentbob |
||||
Anmeldungsdatum: Beiträge: 287 |
p.s.: Kann es sein, dass das Skript den Prozessor ganz schön stark hochtaktet? |
||||
Anmeldungsdatum: Beiträge: 6053 |
|||||
Anmeldungsdatum: Beiträge: 287 |
Okay, das ist bei mir genauso eingestellt. Ich bin nur etwas irritiert, weil wenn das Skript läuft meistens ein CPU Takt von ca. 3800 Mhz angezeigt wird und ohne das Skript immer was um die 1800-2200 Mhz. |
||||
Anmeldungsdatum: Beiträge: 6053 |
Hm.. So sieht es bei mir aus. Gleichzeitig VLC, Firefox, Thunderbird und Clementine offen: |
||||
Anmeldungsdatum: Beiträge: 6053 |
Poste doch mal Dein geändertes Script |
||||
Anmeldungsdatum: Beiträge: 287 |
Okay, dann weiß ich leider auch nicht woran das bei mir liegt. Vielleicht ja auch an meiner Uralt-CPU AMD X4 860K Quad Core. Btw. schicker Desktop! ☺ |
||||
Anmeldungsdatum: Beiträge: 287 |
Danke das Du Dich der Sache annimmst. Here ist is. ${if_running spotify} #${exec sh $HOME/meta.sh c}${image /tmp/tmp.jpg -p 0,200 -s 180x180} ${color #9fb6cd}Artist: $alignr${color }${exec sh $HOME/meta.sh a} ${color #9fb6cd}Title: $alignr${color }${exec sh $HOME/meta.sh t} #${alignl}${color}${exec sh $HOME/meta.sh p} #${execbar sh $HOME/meta.sh b} ${endif} Und hier das Skript: SERVICE="spotify" if pgrep -x "$SERVICE" >/dev/null then convertsec() { x=`expr $1 / 1000000` s=`expr $x % 60` x=`expr $x / 60` m=`expr $x % 60` printf "%02d:%02d\n" $m $s } case "$1" in p|b) POS=$(qdbus org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.freedesktop.DBus.Properties.Get org.mpris.MediaPlayer2.Player Position) TOT=$(qdbus org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.freedesktop.DBus.Properties.Get org.mpris.MediaPlayer2.Player Metadata | grep "^mpris:length" | awk '{print $2}') case "$1" in p) if [ -z $TOT ] then echo "00:00" else echo $(convertsec $POS)/$(convertsec $TOT) fi;; b) if [ -z $TOT ] then echo 0 else echo $(( $POS*100/$TOT )) fi;; esac ;; a) ART=$(qdbus org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.freedesktop.DBus.Properties.Get org.mpris.MediaPlayer2.Player Metadata | grep "artist:") echo ${ART##*:};; t) TIT=$(qdbus org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.freedesktop.DBus.Properties.Get org.mpris.MediaPlayer2.Player Metadata | grep "title:") echo ${TIT##*:};; c) COV=$(qdbus org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.freedesktop.DBus.Properties.Get org.mpris.MediaPlayer2.Player Metadata | grep "artUrl:") if [ -n "$COV" ] then cp -a ${COV#*//} '/tmp/tmp.jpg' fi;; esac fi Ich habe eigentlich nicht viel geändert außer überall "Spotfy" rein geschrieben, wo vorher "Clementine" stand. Und bei den Pfaden in der conkyrc musste ich das /.Conky raus löschen. |
||||
Anmeldungsdatum: Beiträge: 6053 |
Nimm mal das sleep 5 raus! Keine Ahnung wie das in der bash gehandhabt wird aber ich kenne einige Scriptsprachen die das über Schleifen händeln und das belastet dann tatsächlich die CPU. |