CONKY
Partage et aide .
Logiciels / Autres logiciels

loutch Membre non connecté
-
- Voir le profil du membre loutch
- Inscrit le : 07/07/2010
- Groupes :
.gif)
Voila je me lance sur cette M4 .(les modos si ce n'est pas la bonne place .......)
Rien de farfelu par rapport à M2
le conky de droite :
conkyrc:
Caché :
background yes
use_xft yes
xftfont URW Chancery L:style=Bold:size=9
xftalpha 1
update_interval 1.0
total_run_times 0
own_window yes
own_window_transparent yes
own_window_argb_visual yes
own_window_type normal
own_window_hints undecorated,below,skip_taskbar,skip_pager,sticky
double_buffer yes
minimum_size 150
maximum_width 150
text_buffer_size 1024
draw_shades no
draw_outline no
draw_borders no
draw_graph_borders no
default_color e8e8e8
default_outline_color white
alignment top_right
gap_x 0
gap_y 30
no_buffers yes
uppercase no
cpu_avg_samples 2
override_utf8_locale yes
color black
lua_load ~/.conky/blanc/tousv.lua
lua_draw_hook_pre main_rings #bars pour bargraph rings pour tousv
TEXT
cpu 1
${cpu cpu0}% ${exec expr `cat /sys/class/hwmon/hwmon2/device/temp1_input` / 1000}°C
${freq_g 1}GHz
cpu 2
${cpu cpu1}% ${exec expr `cat /sys/class/hwmon/hwmon2/device/temp2_input` / 1000}°C
${freq_g 2}GHz
cpu3
${cpu cpu2}% ${exec expr `cat /sys/class/hwmon/hwmon2/device/temp3_input` / 1000}°C
${freq_g 3}GHz
cpu4
${cpu cpu3}% ${exec expr `cat /sys/class/hwmon/hwmon2/device/temp3_input` / 1000}°C
${freq_g 4}GHz
ram
$memperc%
/racine
${fs_size /}
${fs_used_perc /}%
/home
${fs_size /home}
${fs_used_perc /home}%
Down
${downspeedf wlp2s0}k/s
${totaldown wlp2s0}
Up
${upspeedf wlp2}k/s
${totalup wlp2s0}
TC : ${hwmon 0 temp 1} °C
TD : ${execi 120 hddtemp -n /dev/sda} °C
background yes
use_xft yes
xftfont URW Chancery L:style=Bold:size=9
xftalpha 1
update_interval 1.0
total_run_times 0
own_window yes
own_window_transparent yes
own_window_argb_visual yes
own_window_type normal
own_window_hints undecorated,below,skip_taskbar,skip_pager,sticky
double_buffer yes
minimum_size 150
maximum_width 150
text_buffer_size 1024
draw_shades no
draw_outline no
draw_borders no
draw_graph_borders no
default_color e8e8e8
default_outline_color white
alignment top_right
gap_x 0
gap_y 30
no_buffers yes
uppercase no
cpu_avg_samples 2
override_utf8_locale yes
color black
lua_load ~/.conky/blanc/tousv.lua
lua_draw_hook_pre main_rings #bars pour bargraph rings pour tousv
TEXT
cpu 1
${cpu cpu0}% ${exec expr `cat /sys/class/hwmon/hwmon2/device/temp1_input` / 1000}°C
${freq_g 1}GHz
cpu 2
${cpu cpu1}% ${exec expr `cat /sys/class/hwmon/hwmon2/device/temp2_input` / 1000}°C
${freq_g 2}GHz
cpu3
${cpu cpu2}% ${exec expr `cat /sys/class/hwmon/hwmon2/device/temp3_input` / 1000}°C
${freq_g 3}GHz
cpu4
${cpu cpu3}% ${exec expr `cat /sys/class/hwmon/hwmon2/device/temp3_input` / 1000}°C
${freq_g 4}GHz
ram
$memperc%
/racine
${fs_size /}
${fs_used_perc /}%
/home
${fs_size /home}
${fs_used_perc /home}%
Down
${downspeedf wlp2s0}k/s
${totaldown wlp2s0}
Up
${upspeedf wlp2}k/s
${totalup wlp2s0}
TC : ${hwmon 0 temp 1} °C
TD : ${execi 120 hddtemp -n /dev/sda} °C
le lua:
Caché :
--[[
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.lua
lua_draw_hook_pre ring_stats
Changelog:
+ 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)
]]
require 'cairo'
function conky_main_rings()
if (os.date("%l"))=='12' then
heure=(os.date("%M")/60)
else
heure=(os.date("%l"))+(os.date("%M")/60)
end
-- START PARAMETERS HERE
local rings_settings={
{
name="cpu",
arg="cpu0",
max=100,
xc=40,
yc=58,
radius=30,
thickness=3,
gap_sectors=1,
sectors=10,
bg_colour1={{0,0x999999,0},{0.5,0x999999,1}, {1,0x999999,0}},
fg_colour1={{0,0x6495ee,1},{0.5,0x6495ee,1}, {1,0x6495ee,1}},
fg_colour2={{0,0X6495ee,1},{0.5,0x6495ee,1}, {1,0x6495ee,1}},
bd_colour1={{0,0X6495ee,1},{0.5,0x6495ee,1}, {1,0x6495ee,1}},
},
{
name="exec",
arg="exec expr `cat /sys/class/hwmon/hwmon2/device/temp1_input` / 1000",
max=100,
xc=40,
yc=58,
radius=25,
thickness=3,
gap_sectors=1,
sectors=10,
bg_colour1={{0,0x999999,0},{0.5,0x999999,1}, {1,0x999999,0}},
fg_colour1={{0,0x6495ee,1},{0.5,0x6495ee,1}, {1,0x6495ee,1}},
fg_colour2={{0,0X6495ee,1},{0.5,0x6495ee,1}, {1,0x6495ee,1}},
bd_colour1={{0,0X6495ee,1},{0.5,0x6,1}, {1,0x6495ee,1}},
},
{
name="cpu",
arg="cpu1",
max=100,
xc=40,
yc=138,
radius=30,
thickness=3,
gap_sectors=1,
sectors=10,
bg_colour1={{0,0x999999,0},{0.5,0x999999,1}, {1,0x999999,0}},
fg_colour1={{0,0x6495ee,1},{0.5,0x6495ee,1}, {1,0x6495ee,1}},
fg_colour2={{0,0X6495ee,1},{0.5,0x6495ee,1}, {1,0x6495ee,1}},
bd_colour1={{0,0X6495ee,1},{0.5,0x6495ee,1}, {1,0x6495ee,1}},
},
{
name="exec",
arg="exec expr `cat /sys/class/hwmon/hwmon2/device/temp2_input` / 1000",
max=100,
xc=40,
yc=138,
radius=25,
thickness=3,
gap_sectors=1,
sectors=10,
bg_colour1={{0,0x999999,0},{0.5,0x999999,1}, {1,0x999999,0}},
fg_colour1={{0,0x6495ee,1},{0.5,0x6495ee,1}, {1,0x6495ee,1}},
fg_colour2={{0,0X6495ee,1},{0.5,0x6495ee,1}, {1,0x6495ee,1}},
bd_colour1={{0,0X6495ee,1},{0.5,0x6495ee,1}, {1,0x6495ee,1}},
},
{
name="cpu",
arg="cpu2",
max=100,
xc=40,
yc=218,
radius=30,
thickness=3,
gap_sectors=1,
sectors=10,
bg_colour1={{0,0x999999,0},{0.5,0x999999,1}, {1,0x999999,0}},
fg_colour1={{0,0x6495ee,1},{0.5,0x6495ee,1}, {1,0x6495ee,1}},
fg_colour2={{0,0X6495ee,1},{0.5,0x6495ee,1}, {1,0x6495ee,1}},
bd_colour1={{0,0X6495ee,1},{0.5,0x6495ee,1}, {1,0x6495ee,1}},
},
{
name="exec",
arg="exec expr `cat /sys/class/hwmon/hwmon2/device/temp3_input` / 1000",
max=100,
xc=40,
yc=218,
radius=25,
thickness=3,
gap_sectors=1,
sectors=10,
bg_colour1={{0,0x999999,0},{0.5,0x999999,1}, {1,0x999999,0}},
fg_colour1={{0,0x6495ee,1},{0.5,0x6495ee,1}, {1,0x6495ee,1}},
fg_colour2={{0,0X6495ee,1},{0.5,0x6495ee,1}, {1,0x6495ee,1}},
bd_colour1={{0,0X6495ee,1},{0.5,0x6495ee,1}, {1,0x6495ee,1}},
},
{
name="cpu",
arg="cpu3",
max=100,
xc=40,
yc=298,
radius=30,
thickness=3,
gap_sectors=1,
sectors=10,
bg_colour1={{0,0x999999,0},{0.5,0x999999,1}, {1,0x999999,0}},
fg_colour1={{0,0x6495ee,1},{0.5,0x6495ee,1}, {1,0x6495ee,1}},
fg_colour2={{0,0X6495ee,1},{0.5,0x6495ee,1}, {1,0x6495ee,1}},
bd_colour1={{0,0X6495ee,1},{0.5,0x6495ee,1}, {1,0x6495ee,1}},
},
{
name="exec",
arg="exec expr `cat /sys/class/hwmon/hwmon2/device/temp2_input` / 1000",
max=100,
xc=40,
yc=298,
radius=25,
thickness=3,
gap_sectors=1,
sectors=10,
bg_colour1={{0,0x999999,0},{0.5,0x999999,1}, {1,0x999999,0}},
fg_colour1={{0,0x6495ee,1},{0.5,0x6495ee,1}, {1,0x6495ee,1}},
fg_colour2={{0,0X6495ee,1},{0.5,0x6495ee,1}, {1,0x6495ee,1}},
bd_colour1={{0,0X6495ee,1},{0.5,0x6495ee,1}, {1,0x6495ee,1}},
},
{
name="memperc",
arg="",
max=100,
xc=40,
yc=368,
radius=30,
thickness=3,
gap_sectors=1,
sectors=10,
bg_colour1={{0,0x999999,0},{0.5,0x999999,1}, {1,0x999999,0}},
fg_colour1={{0,0x6495ee,1},{0.5,0x6495ee,1}, {1,0x6495ee,1}},
fg_colour2={{0,0X6495ee,1},{0.5,0x6495ee,1}, {1,0x6495ee,1}},
bd_colour1={{0,0X6495ee,1},{0.5,0x6495ee,1}, {1,0x6495ee,1}},
},
{
name="fs_used_perc",
arg="/",
max=100,
xc=40,
yc=438,
radius=30,
thickness=3,
gap_sectors=1,
sectors=10,
bg_colour1={{0,0x999999,0},{0.5,0x999999,1}, {1,0x999999,0}},
fg_colour1={{0,0x6495ee,1},{0.5,0x6495ee,1}, {1,0x6495ee,1}},
fg_colour2={{0,0X6495ee,1},{0.5,0x6495ee,1}, {1,0x6495ee,1}},
bd_colour1={{0,0X6495ee,1},{0.5,0x6495ee,1}, {1,0x6495ee,1}},
},
{
name="fs_used_perc",
arg="/home",
max=100,
xc=40,
yc=518,
radius=30,
thickness=3,
gap_sectors=1,
sectors=10,
bg_colour1={{0,0x999999,0},{0.5,0x999999,1}, {1,0x999999,0}},
fg_colour1={{0,0x6495ee,1},{0.5,0x6495ee,1}, {1,0x6495ee,1}},
fg_colour2={{0,0X6495ee,1},{0.5,0x6495ee,1}, {1,0x6495ee,1}},
bd_colour1={{0,0X6495ee,1},{0.5,0x6495ee,1}, {1,0x6495ee,1}},
},
{
name="downspeedf",
arg="wlp2s0",
max=500,
xc=40,
yc=598,
radius=30,
thickness=3,
gap_sectors=1,
sectors=10,
bg_colour1={{0,0x999999,0},{0.5,0x999999,1}, {1,0x999999,0}},
fg_colour1={{0,0x6495ee,1},{0.5,0x6495ee,1}, {1,0x6495ee,1}},
fg_colour2={{0,0X6495ee,1},{0.5,0x6495ee,1}, {1,0x6495ee,1}},
bd_colour1={{0,0X6495ee,1},{0.5,0x6495ee,1}, {1,0x6495ee,1}},
},
{
name="upspeedf",
arg="wlp2s0",
max=100,
xc=40,
yc=678,
radius=30,
thickness=3,
gap_sectors=1,
sectors=10,
bg_colour1={{0,0x999999,0},{0.5,0x999999,1}, {1,0x999999,0}},
fg_colour1={{0,0x6495ee,1},{0.5,0x6495ee,1}, {1,0x6495ee,1}},
fg_colour2={{0,0X6495ee,1},{0.5,0x6495ee,1}, {1,0x6495ee,1}},
bd_colour1={{0,0X6495ee,1},{0.5,0x6495ee,1}, {1,0x6495ee,1}},
},
{
name="hwmon",
arg="0 temp 1",
max=100,
xc=40,
yc=748,
radius=30,
thickness=3,
gap_sectors=1,
sectors=10,
bg_colour1={{0,0x999999,0},{0.5,0x999999,1}, {1,0x999999,0}},
fg_colour1={{0,0x6495ee,1},{0.5,0x6495ee,1}, {1,0x6495ee,1}},
fg_colour2={{0,0X6495ee,1},{0.5,0x6495ee,1}, {1,0x6495ee,1}},
bd_colour1={{0,0X6495ee,1},{0.5,0x6495ee,1}, {1,0x6495ee,1}},
},
{
name="execi",
arg="120 hddtemp -n /dev/sda",
max=100,
xc=40,
yc=748,
radius=25,
thickness=3,
gap_sectors=1,
sectors=10,
bg_colour1={{0,0x999999,0},{0.5,0x999999,1}, {1,0x999999,0}},
fg_colour1={{0,0x6495ee,1},{0.5,0x6495ee,1}, {1,0x6495ee,1}},
fg_colour2={{0,0X6495ee,1},{0.5,0x6495ee,1}, {1,0x6495ee,1}},
bd_colour1={{0,0X6495ee,1},{0.5,0x6495ee,1}, {1,0x6495ee,1}},
},
}
--END OF PARAMETERS HERE
--main function
--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 tonumber(conky_parse('${updates}'))>3 then
for i in pairs(rings_settings) do
draw_ring(cr,rings_settings[i])
end
end
cairo_destroy(cr)
end
function draw_ring(cr, t)
local function rgba_to_r_g_b_a(tcolour)
local colour,alpha=tcolour[2],tcolour[3]
return ((colour / 0x10000) % 0x100) / 255.,
((colour / 0x100) % 0x100) / 255., (colour % 0x100) / 255., alpha
end
local function calc_delta(tcol1,tcol2)
--calculate deltas P R G B A to table_colour 1
for x = 1, #tcol1 do
tcol1[x].dA = 0
tcol1[x].dP = 0
tcol1[x].dR = 0
tcol1[x].dG = 0
tcol1[x].dB = 0
if tcol2~=nil and #tcol1 == #tcol2 then
local r1,g1,b1,a1 = rgba_to_r_g_b_a(tcol1[x])
local r2,g2,b2,a2 = rgba_to_r_g_b_a(tcol2[x])
tcol1[x].dP = (tcol2[x][1]-tcol1[x][1])/t.sectors
tcol1[x].dR = (r2-r1)/t.sectors
tcol1[x].dG = (g2-g1)/t.sectors
tcol1[x].dB = (b2-b1)/t.sectors
tcol1[x].dA = (a2-a1)/t.sectors
end
end
return tcol1
end
--check values
local function setup(t)
if t.name==nil and t.arg==nil then
print ("No input values ... use parameters 'name'" +
" with 'arg' or only parameter 'arg' ")
return
end
if t.max==nil then
print ("No maximum value defined, use 'max'")
print ("for name=" .. t.name)
print ("with arg=" .. t.arg)
return
end
if t.name==nil then t.name="" end
if t.arg==nil then t.arg="" end
if t.xc==nil then t.xc=conky_window.width/2 end
if t.yc==nil then t.yc=conky_window.height/2 end
if t.thickness ==nil then t.thickness = 10 end
if t.radius ==nil then t.radius =conky_window.width/4 end
if t.start_angle==nil then t.start_angle =0 end
if t.end_angle==nil then t.end_angle=360 end
if t.bg_colour1==nil then
t.bg_colour1={{0,0x00ffff,0.1},{0.5,0x00FFFF,0.5},{1,0x00FFFF,0.1}}
end
if t.fg_colour1==nil then
t.fg_colour1={{0,0x00FF00,0.1},{0.5,0x00FF00,1},{1,0x00FF00,0.1}}
end
if t.bd_colour1==nil then
t.bd_colour1={{0,0xFFFF00,0.5},{0.5,0xFFFF00,1},{1,0xFFFF00,0.5}}
end
if t.sectors==nil then t.sectors=10 end
if t.gap_sectors==nil then t.gap_sectors=1 end
if t.fill_sector==nil then t.fill_sector=false end
if t.sectors==1 then t.fill_sector=false end
if t.border_size==nil then t.border_size=0 end
if t.cap==nil then t.cap="p" end
--some checks
if t.thickness>t.radius then t.thickness=t.radius*0.1 end
t.int_radius = t.radius-t.thickness
--check colors tables
for i=1, #t.bg_colour1 do
if #t.bg_colour1[i]~=3 then t.bg_colour1[i]={1,0xFFFFFF,0.5} end
end
for i=1, #t.fg_colour1 do
if #t.fg_colour1[i]~=3 then t.fg_colour1[i]={1,0xFF0000,1} end
end
for i=1, #t.bd_colour1 do
if #t.bd_colour1[i]~=3 then t.bd_colour1[i]={1,0xFFFF00,1} end
end
if t.bg_colour2~=nil then
for i=1, #t.bg_colour2 do
if #t.bg_colour2[i]~=3 then t.bg_colour2[i]={1,0xFFFFFF,0.5} end
end
end
if t.fg_colour2~=nil then
for i=1, #t.fg_colour2 do
if #t.fg_colour2[i]~=3 then t.fg_colour2[i]={1,0xFF0000,1} end
end
end
if t.bd_colour2~=nil then
for i=1, #t.bd_colour2 do
if #t.bd_colour2[i]~=3 then t.bd_colour2[i]={1,0xFFFF00,1} end
end
end
if t.start_angle>=t.end_angle then
local tmp_angle=t.end_angle
t.end_angle= t.start_angle
t.start_angle = tmp_angle
-- print ("inversed angles")
if t.end_angle-t.start_angle>360 and t.start_angle>0 then
t.end_angle=360+t.start_angle
print ("reduce angles")
end
if t.end_angle+t.start_angle>360 and t.start_angle<=0 then
t.end_angle=360+t.start_angle
print ("reduce angles")
end
if t.int_radius<0 then t.int_radius =0 end
if t.int_radius>t.radius then
local tmp_radius=t.radius
t.radius=t.int_radius
t.int_radius=tmp_radius
print ("inversed radius")
end
if t.int_radius==t.radius then
t.int_radius=0
print ("int radius set to 0")
end
end
t.fg_colour1 = calc_delta(t.fg_colour1,t.fg_colour2)
t.bg_colour1 = calc_delta(t.bg_colour1,t.bg_colour2)
t.bd_colour1 = calc_delta(t.bd_colour1,t.bd_colour2)
end
if t.draw_me == true then t.draw_me = nil end
if t.draw_me ~= nil and conky_parse(tostring(t.draw_me)) ~= "1" then return end
--initialize table
setup(t)
--initialize cairo context
cairo_save(cr)
cairo_translate(cr,t.xc,t.yc)
cairo_set_line_join (cr, CAIRO_LINE_JOIN_ROUND)
cairo_set_line_cap (cr, CAIRO_LINE_CAP_ROUND)
--get value
local value = 0
if t.name ~="" then
value = tonumber(conky_parse(string.format('${%s %s}', t.name, t.arg)))
else
value = tonumber(t.arg)
end
if value==nil then value =0 end
--initialize sectors
--angle of a sector :
local angleA = ((t.end_angle-t.start_angle)/t.sectors)*math.pi/180
--value of a sector :
local valueA = t.max/t.sectors
--first angle of a sector :
local lastAngle = t.start_angle*math.pi/180
local function draw_sector(type_arc,angle0,angle,valpc, idx)
--this function draws a portion of arc
--type of arc, angle0 = strating angle, angle= angle of sector,
--valpc = percentage inside the sector, idx = sctor number #
local tcolor
if type_arc=="bg" then --background
if valpc==1 then return end
tcolor=t.bg_colour1
elseif type_arc=="fg" then --foreground
if valpc==0 then return end
tcolor=t.fg_colour1
elseif type_arc=="bd" then --border
tcolor=t.bd_colour1
end
--angles equivalents to gap_sector
local ext_delta=math.atan(t.gap_sectors/(2*t.radius))
local int_delta=math.atan(t.gap_sectors/(2*t.int_radius))
--angles of arcs
local ext_angle=(angle-ext_delta*2)*valpc
local int_angle=(angle-int_delta*2)*valpc
--define colours to use for this sector
if #tcolor==1 then
--plain color
local vR,vG,vB,vA = rgba_to_r_g_b_a(tcolor[1])
cairo_set_source_rgba(cr,vR+tcolor[1].dR*idx,
vG+tcolor[1].dG*idx,
vB+tcolor[1].dB*idx,
vA+tcolor[1].dA*idx )
else
--radient color
local pat=cairo_pattern_create_radial(0,0,t.int_radius,0,0,t.radius)
for i=1, #tcolor do
local vP,vR,vG,vB,vA = tcolor[i][1], rgba_to_r_g_b_a(tcolor[i])
cairo_pattern_add_color_stop_rgba (pat,
vP+tcolor[i].dP*idx,
vR+tcolor[i].dR*idx,
vG+tcolor[i].dG*idx,
vB+tcolor[i].dB*idx,
vA+tcolor[i].dA*idx )
end
cairo_set_source (cr, pat)
cairo_pattern_destroy(pat)
end
--start drawing
cairo_save(cr)
--x axis is parrallel to start of sector
cairo_rotate(cr,angle0-math.pi/2)
local ri,re = t.int_radius ,t.radius
--point A
local angle_a
if t.cap == "p" then
angle_a = int_delta
if t.inverse_arc and type_arc ~="bg" then
angle_a = angle-int_angle-int_delta
end
if not(t.inverse_arc) and type_arc =="bg" then
angle_a = int_delta+int_angle
end
else --t.cap=="r"
angle_a = ext_delta
if t.inverse_arc and type_arc~="bg" then
angle_a = angle-ext_angle-ext_delta
end
if not(t.inverse_arc) and type_arc=="bg" then
angle_a = ext_delta+ext_angle
end
end
local ax,ay = ri*math.cos(angle_a),ri*math.sin(angle_a)
--point B
local angle_b = ext_delta
if t.cap == "p" then
if t.inverse_arc and type_arc ~="bg" then
angle_b = angle-ext_angle-ext_delta
end
if not(t.inverse_arc) and type_arc=="bg" then
angle_b = ext_delta+ext_angle
end
else
if t.inverse_arc and type_arc ~="bg" then
angle_b = angle-ext_angle-ext_delta
end
if not(t.inverse_arc) and type_arc=="bg" then
angle_b = ext_delta+ext_angle
end
end
local bx,by = re*math.cos(angle_b),re*math.sin(angle_b)
-- EXTERNAL ARC B --> C
local b0,b1
if t.inverse_arc then
if type_arc=="bg" then
b0,b1= ext_delta, angle-ext_delta-ext_angle
else
b0,b1= angle-ext_angle-ext_delta, angle-ext_delta
end
else
if type_arc=="bg" then
b0,b1= ext_delta+ext_angle, angle-ext_delta
else
b0,b1= ext_delta, ext_angle+ext_delta
end
end
---POINT D
local angle_c, angle_d
if t.cap == "p" then
angle_d = angle-int_delta
if t.inverse_arc and type_arc=="bg" then
angle_d = angle-int_delta-int_angle
end
if not(t.inverse_arc) and type_arc~="bg" then
angle_d=int_delta+int_angle
end
else
angle_d = angle-ext_delta
if t.inverse_arc and type_arc=="bg" then
angle_d =angle-ext_delta-ext_angle
end
if not(t.inverse_arc) and type_arc~="bg" then
angle_d = ext_angle+ext_delta
end
end
local dx,dy = ri*math.cos(angle_d),ri*math.sin(angle_d)
-- INTERNAL ARC D --> A
local d0,d1
if t.cap=="p" then
if t.inverse_arc then
if type_arc=="bg" then
d0,d1= angle-int_delta-int_angle,int_delta
else
d0,d1= angle-int_delta, angle- int_angle-int_delta
end
else
if type_arc=="bg" then
d0,d1= angle-int_delta, int_delta+int_angle
else
d0,d1= int_delta+int_angle, int_delta
end
end
else
if t.inverse_arc then
if type_arc=="bg" then
d0,d1= angle-ext_delta-ext_angle,ext_delta
else
d0,d1= angle-ext_delta, angle- ext_angle-ext_delta
end
else
if type_arc=="bg" then
d0,d1= angle-ext_delta,ext_delta+ext_angle
else
d0,d1= ext_angle+ext_delta, ext_delta
end
end
end
--draw sector
cairo_move_to(cr,ax,ay)
cairo_line_to(cr,bx,by)
cairo_arc(cr,0,0,re,b0,b1)
cairo_line_to(cr,dx,dy)
cairo_arc_negative(cr,0,0,ri,d0,d1)
cairo_close_path (cr);
--stroke or fill sector
if type_arc=="bd" then
cairo_set_line_width(cr,t.border_size)
cairo_stroke(cr)
else
cairo_fill(cr)
end
cairo_restore(cr)
end
--draw sectors
local n0,n1,n2 = 1,t.sectors,1
if t.inverse_arc then n0,n1,n2 = t.sectors,1,-1 end
local index = 0
for i = n0,n1,n2 do
index = index +1
local valueZ=1
local cstA, cstB = (i-1),i
if t.inverse_arc then cstA,cstB = (t.sectors-i), (t.sectors-i+1) end
if value>valueA *cstA and value<valueA*cstB then
if not t.fill_sector then
valueZ = (value-valueA*cstA)/valueA
end
else
if value<valueA*cstB then valueZ=0 end
end
local start_angle= lastAngle+(i-1)*angleA
if t.foreground ~= false then
draw_sector("fg",start_angle,angleA,valueZ, index)
end
if t.background ~= false then
draw_sector("bg",start_angle,angleA,valueZ, i)
end
if t.border_size>0 then draw_sector("bd",start_angle,angleA,1, i) end
end
cairo_restore(cr)
end
--[[END OF RING-SECTORS WIDGET]]
--[[
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.lua
lua_draw_hook_pre ring_stats
Changelog:
+ 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)
]]
require 'cairo'
function conky_main_rings()
if (os.date("%l"))=='12' then
heure=(os.date("%M")/60)
else
heure=(os.date("%l"))+(os.date("%M")/60)
end
-- START PARAMETERS HERE
local rings_settings={
{
name="cpu",
arg="cpu0",
max=100,
xc=40,
yc=58,
radius=30,
thickness=3,
gap_sectors=1,
sectors=10,
bg_colour1={{0,0x999999,0},{0.5,0x999999,1}, {1,0x999999,0}},
fg_colour1={{0,0x6495ee,1},{0.5,0x6495ee,1}, {1,0x6495ee,1}},
fg_colour2={{0,0X6495ee,1},{0.5,0x6495ee,1}, {1,0x6495ee,1}},
bd_colour1={{0,0X6495ee,1},{0.5,0x6495ee,1}, {1,0x6495ee,1}},
},
{
name="exec",
arg="exec expr `cat /sys/class/hwmon/hwmon2/device/temp1_input` / 1000",
max=100,
xc=40,
yc=58,
radius=25,
thickness=3,
gap_sectors=1,
sectors=10,
bg_colour1={{0,0x999999,0},{0.5,0x999999,1}, {1,0x999999,0}},
fg_colour1={{0,0x6495ee,1},{0.5,0x6495ee,1}, {1,0x6495ee,1}},
fg_colour2={{0,0X6495ee,1},{0.5,0x6495ee,1}, {1,0x6495ee,1}},
bd_colour1={{0,0X6495ee,1},{0.5,0x6,1}, {1,0x6495ee,1}},
},
{
name="cpu",
arg="cpu1",
max=100,
xc=40,
yc=138,
radius=30,
thickness=3,
gap_sectors=1,
sectors=10,
bg_colour1={{0,0x999999,0},{0.5,0x999999,1}, {1,0x999999,0}},
fg_colour1={{0,0x6495ee,1},{0.5,0x6495ee,1}, {1,0x6495ee,1}},
fg_colour2={{0,0X6495ee,1},{0.5,0x6495ee,1}, {1,0x6495ee,1}},
bd_colour1={{0,0X6495ee,1},{0.5,0x6495ee,1}, {1,0x6495ee,1}},
},
{
name="exec",
arg="exec expr `cat /sys/class/hwmon/hwmon2/device/temp2_input` / 1000",
max=100,
xc=40,
yc=138,
radius=25,
thickness=3,
gap_sectors=1,
sectors=10,
bg_colour1={{0,0x999999,0},{0.5,0x999999,1}, {1,0x999999,0}},
fg_colour1={{0,0x6495ee,1},{0.5,0x6495ee,1}, {1,0x6495ee,1}},
fg_colour2={{0,0X6495ee,1},{0.5,0x6495ee,1}, {1,0x6495ee,1}},
bd_colour1={{0,0X6495ee,1},{0.5,0x6495ee,1}, {1,0x6495ee,1}},
},
{
name="cpu",
arg="cpu2",
max=100,
xc=40,
yc=218,
radius=30,
thickness=3,
gap_sectors=1,
sectors=10,
bg_colour1={{0,0x999999,0},{0.5,0x999999,1}, {1,0x999999,0}},
fg_colour1={{0,0x6495ee,1},{0.5,0x6495ee,1}, {1,0x6495ee,1}},
fg_colour2={{0,0X6495ee,1},{0.5,0x6495ee,1}, {1,0x6495ee,1}},
bd_colour1={{0,0X6495ee,1},{0.5,0x6495ee,1}, {1,0x6495ee,1}},
},
{
name="exec",
arg="exec expr `cat /sys/class/hwmon/hwmon2/device/temp3_input` / 1000",
max=100,
xc=40,
yc=218,
radius=25,
thickness=3,
gap_sectors=1,
sectors=10,
bg_colour1={{0,0x999999,0},{0.5,0x999999,1}, {1,0x999999,0}},
fg_colour1={{0,0x6495ee,1},{0.5,0x6495ee,1}, {1,0x6495ee,1}},
fg_colour2={{0,0X6495ee,1},{0.5,0x6495ee,1}, {1,0x6495ee,1}},
bd_colour1={{0,0X6495ee,1},{0.5,0x6495ee,1}, {1,0x6495ee,1}},
},
{
name="cpu",
arg="cpu3",
max=100,
xc=40,
yc=298,
radius=30,
thickness=3,
gap_sectors=1,
sectors=10,
bg_colour1={{0,0x999999,0},{0.5,0x999999,1}, {1,0x999999,0}},
fg_colour1={{0,0x6495ee,1},{0.5,0x6495ee,1}, {1,0x6495ee,1}},
fg_colour2={{0,0X6495ee,1},{0.5,0x6495ee,1}, {1,0x6495ee,1}},
bd_colour1={{0,0X6495ee,1},{0.5,0x6495ee,1}, {1,0x6495ee,1}},
},
{
name="exec",
arg="exec expr `cat /sys/class/hwmon/hwmon2/device/temp2_input` / 1000",
max=100,
xc=40,
yc=298,
radius=25,
thickness=3,
gap_sectors=1,
sectors=10,
bg_colour1={{0,0x999999,0},{0.5,0x999999,1}, {1,0x999999,0}},
fg_colour1={{0,0x6495ee,1},{0.5,0x6495ee,1}, {1,0x6495ee,1}},
fg_colour2={{0,0X6495ee,1},{0.5,0x6495ee,1}, {1,0x6495ee,1}},
bd_colour1={{0,0X6495ee,1},{0.5,0x6495ee,1}, {1,0x6495ee,1}},
},
{
name="memperc",
arg="",
max=100,
xc=40,
yc=368,
radius=30,
thickness=3,
gap_sectors=1,
sectors=10,
bg_colour1={{0,0x999999,0},{0.5,0x999999,1}, {1,0x999999,0}},
fg_colour1={{0,0x6495ee,1},{0.5,0x6495ee,1}, {1,0x6495ee,1}},
fg_colour2={{0,0X6495ee,1},{0.5,0x6495ee,1}, {1,0x6495ee,1}},
bd_colour1={{0,0X6495ee,1},{0.5,0x6495ee,1}, {1,0x6495ee,1}},
},
{
name="fs_used_perc",
arg="/",
max=100,
xc=40,
yc=438,
radius=30,
thickness=3,
gap_sectors=1,
sectors=10,
bg_colour1={{0,0x999999,0},{0.5,0x999999,1}, {1,0x999999,0}},
fg_colour1={{0,0x6495ee,1},{0.5,0x6495ee,1}, {1,0x6495ee,1}},
fg_colour2={{0,0X6495ee,1},{0.5,0x6495ee,1}, {1,0x6495ee,1}},
bd_colour1={{0,0X6495ee,1},{0.5,0x6495ee,1}, {1,0x6495ee,1}},
},
{
name="fs_used_perc",
arg="/home",
max=100,
xc=40,
yc=518,
radius=30,
thickness=3,
gap_sectors=1,
sectors=10,
bg_colour1={{0,0x999999,0},{0.5,0x999999,1}, {1,0x999999,0}},
fg_colour1={{0,0x6495ee,1},{0.5,0x6495ee,1}, {1,0x6495ee,1}},
fg_colour2={{0,0X6495ee,1},{0.5,0x6495ee,1}, {1,0x6495ee,1}},
bd_colour1={{0,0X6495ee,1},{0.5,0x6495ee,1}, {1,0x6495ee,1}},
},
{
name="downspeedf",
arg="wlp2s0",
max=500,
xc=40,
yc=598,
radius=30,
thickness=3,
gap_sectors=1,
sectors=10,
bg_colour1={{0,0x999999,0},{0.5,0x999999,1}, {1,0x999999,0}},
fg_colour1={{0,0x6495ee,1},{0.5,0x6495ee,1}, {1,0x6495ee,1}},
fg_colour2={{0,0X6495ee,1},{0.5,0x6495ee,1}, {1,0x6495ee,1}},
bd_colour1={{0,0X6495ee,1},{0.5,0x6495ee,1}, {1,0x6495ee,1}},
},
{
name="upspeedf",
arg="wlp2s0",
max=100,
xc=40,
yc=678,
radius=30,
thickness=3,
gap_sectors=1,
sectors=10,
bg_colour1={{0,0x999999,0},{0.5,0x999999,1}, {1,0x999999,0}},
fg_colour1={{0,0x6495ee,1},{0.5,0x6495ee,1}, {1,0x6495ee,1}},
fg_colour2={{0,0X6495ee,1},{0.5,0x6495ee,1}, {1,0x6495ee,1}},
bd_colour1={{0,0X6495ee,1},{0.5,0x6495ee,1}, {1,0x6495ee,1}},
},
{
name="hwmon",
arg="0 temp 1",
max=100,
xc=40,
yc=748,
radius=30,
thickness=3,
gap_sectors=1,
sectors=10,
bg_colour1={{0,0x999999,0},{0.5,0x999999,1}, {1,0x999999,0}},
fg_colour1={{0,0x6495ee,1},{0.5,0x6495ee,1}, {1,0x6495ee,1}},
fg_colour2={{0,0X6495ee,1},{0.5,0x6495ee,1}, {1,0x6495ee,1}},
bd_colour1={{0,0X6495ee,1},{0.5,0x6495ee,1}, {1,0x6495ee,1}},
},
{
name="execi",
arg="120 hddtemp -n /dev/sda",
max=100,
xc=40,
yc=748,
radius=25,
thickness=3,
gap_sectors=1,
sectors=10,
bg_colour1={{0,0x999999,0},{0.5,0x999999,1}, {1,0x999999,0}},
fg_colour1={{0,0x6495ee,1},{0.5,0x6495ee,1}, {1,0x6495ee,1}},
fg_colour2={{0,0X6495ee,1},{0.5,0x6495ee,1}, {1,0x6495ee,1}},
bd_colour1={{0,0X6495ee,1},{0.5,0x6495ee,1}, {1,0x6495ee,1}},
},
}
--END OF PARAMETERS HERE
--main function
--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 tonumber(conky_parse('${updates}'))>3 then
for i in pairs(rings_settings) do
draw_ring(cr,rings_settings[i])
end
end
cairo_destroy(cr)
end
function draw_ring(cr, t)
local function rgba_to_r_g_b_a(tcolour)
local colour,alpha=tcolour[2],tcolour[3]
return ((colour / 0x10000) % 0x100) / 255.,
((colour / 0x100) % 0x100) / 255., (colour % 0x100) / 255., alpha
end
local function calc_delta(tcol1,tcol2)
--calculate deltas P R G B A to table_colour 1
for x = 1, #tcol1 do
tcol1[x].dA = 0
tcol1[x].dP = 0
tcol1[x].dR = 0
tcol1[x].dG = 0
tcol1[x].dB = 0
if tcol2~=nil and #tcol1 == #tcol2 then
local r1,g1,b1,a1 = rgba_to_r_g_b_a(tcol1[x])
local r2,g2,b2,a2 = rgba_to_r_g_b_a(tcol2[x])
tcol1[x].dP = (tcol2[x][1]-tcol1[x][1])/t.sectors
tcol1[x].dR = (r2-r1)/t.sectors
tcol1[x].dG = (g2-g1)/t.sectors
tcol1[x].dB = (b2-b1)/t.sectors
tcol1[x].dA = (a2-a1)/t.sectors
end
end
return tcol1
end
--check values
local function setup(t)
if t.name==nil and t.arg==nil then
print ("No input values ... use parameters 'name'" +
" with 'arg' or only parameter 'arg' ")
return
end
if t.max==nil then
print ("No maximum value defined, use 'max'")
print ("for name=" .. t.name)
print ("with arg=" .. t.arg)
return
end
if t.name==nil then t.name="" end
if t.arg==nil then t.arg="" end
if t.xc==nil then t.xc=conky_window.width/2 end
if t.yc==nil then t.yc=conky_window.height/2 end
if t.thickness ==nil then t.thickness = 10 end
if t.radius ==nil then t.radius =conky_window.width/4 end
if t.start_angle==nil then t.start_angle =0 end
if t.end_angle==nil then t.end_angle=360 end
if t.bg_colour1==nil then
t.bg_colour1={{0,0x00ffff,0.1},{0.5,0x00FFFF,0.5},{1,0x00FFFF,0.1}}
end
if t.fg_colour1==nil then
t.fg_colour1={{0,0x00FF00,0.1},{0.5,0x00FF00,1},{1,0x00FF00,0.1}}
end
if t.bd_colour1==nil then
t.bd_colour1={{0,0xFFFF00,0.5},{0.5,0xFFFF00,1},{1,0xFFFF00,0.5}}
end
if t.sectors==nil then t.sectors=10 end
if t.gap_sectors==nil then t.gap_sectors=1 end
if t.fill_sector==nil then t.fill_sector=false end
if t.sectors==1 then t.fill_sector=false end
if t.border_size==nil then t.border_size=0 end
if t.cap==nil then t.cap="p" end
--some checks
if t.thickness>t.radius then t.thickness=t.radius*0.1 end
t.int_radius = t.radius-t.thickness
--check colors tables
for i=1, #t.bg_colour1 do
if #t.bg_colour1[i]~=3 then t.bg_colour1[i]={1,0xFFFFFF,0.5} end
end
for i=1, #t.fg_colour1 do
if #t.fg_colour1[i]~=3 then t.fg_colour1[i]={1,0xFF0000,1} end
end
for i=1, #t.bd_colour1 do
if #t.bd_colour1[i]~=3 then t.bd_colour1[i]={1,0xFFFF00,1} end
end
if t.bg_colour2~=nil then
for i=1, #t.bg_colour2 do
if #t.bg_colour2[i]~=3 then t.bg_colour2[i]={1,0xFFFFFF,0.5} end
end
end
if t.fg_colour2~=nil then
for i=1, #t.fg_colour2 do
if #t.fg_colour2[i]~=3 then t.fg_colour2[i]={1,0xFF0000,1} end
end
end
if t.bd_colour2~=nil then
for i=1, #t.bd_colour2 do
if #t.bd_colour2[i]~=3 then t.bd_colour2[i]={1,0xFFFF00,1} end
end
end
if t.start_angle>=t.end_angle then
local tmp_angle=t.end_angle
t.end_angle= t.start_angle
t.start_angle = tmp_angle
-- print ("inversed angles")
if t.end_angle-t.start_angle>360 and t.start_angle>0 then
t.end_angle=360+t.start_angle
print ("reduce angles")
end
if t.end_angle+t.start_angle>360 and t.start_angle<=0 then
t.end_angle=360+t.start_angle
print ("reduce angles")
end
if t.int_radius<0 then t.int_radius =0 end
if t.int_radius>t.radius then
local tmp_radius=t.radius
t.radius=t.int_radius
t.int_radius=tmp_radius
print ("inversed radius")
end
if t.int_radius==t.radius then
t.int_radius=0
print ("int radius set to 0")
end
end
t.fg_colour1 = calc_delta(t.fg_colour1,t.fg_colour2)
t.bg_colour1 = calc_delta(t.bg_colour1,t.bg_colour2)
t.bd_colour1 = calc_delta(t.bd_colour1,t.bd_colour2)
end
if t.draw_me == true then t.draw_me = nil end
if t.draw_me ~= nil and conky_parse(tostring(t.draw_me)) ~= "1" then return end
--initialize table
setup(t)
--initialize cairo context
cairo_save(cr)
cairo_translate(cr,t.xc,t.yc)
cairo_set_line_join (cr, CAIRO_LINE_JOIN_ROUND)
cairo_set_line_cap (cr, CAIRO_LINE_CAP_ROUND)
--get value
local value = 0
if t.name ~="" then
value = tonumber(conky_parse(string.format('${%s %s}', t.name, t.arg)))
else
value = tonumber(t.arg)
end
if value==nil then value =0 end
--initialize sectors
--angle of a sector :
local angleA = ((t.end_angle-t.start_angle)/t.sectors)*math.pi/180
--value of a sector :
local valueA = t.max/t.sectors
--first angle of a sector :
local lastAngle = t.start_angle*math.pi/180
local function draw_sector(type_arc,angle0,angle,valpc, idx)
--this function draws a portion of arc
--type of arc, angle0 = strating angle, angle= angle of sector,
--valpc = percentage inside the sector, idx = sctor number #
local tcolor
if type_arc=="bg" then --background
if valpc==1 then return end
tcolor=t.bg_colour1
elseif type_arc=="fg" then --foreground
if valpc==0 then return end
tcolor=t.fg_colour1
elseif type_arc=="bd" then --border
tcolor=t.bd_colour1
end
--angles equivalents to gap_sector
local ext_delta=math.atan(t.gap_sectors/(2*t.radius))
local int_delta=math.atan(t.gap_sectors/(2*t.int_radius))
--angles of arcs
local ext_angle=(angle-ext_delta*2)*valpc
local int_angle=(angle-int_delta*2)*valpc
--define colours to use for this sector
if #tcolor==1 then
--plain color
local vR,vG,vB,vA = rgba_to_r_g_b_a(tcolor[1])
cairo_set_source_rgba(cr,vR+tcolor[1].dR*idx,
vG+tcolor[1].dG*idx,
vB+tcolor[1].dB*idx,
vA+tcolor[1].dA*idx )
else
--radient color
local pat=cairo_pattern_create_radial(0,0,t.int_radius,0,0,t.radius)
for i=1, #tcolor do
local vP,vR,vG,vB,vA = tcolor[i][1], rgba_to_r_g_b_a(tcolor[i])
cairo_pattern_add_color_stop_rgba (pat,
vP+tcolor[i].dP*idx,
vR+tcolor[i].dR*idx,
vG+tcolor[i].dG*idx,
vB+tcolor[i].dB*idx,
vA+tcolor[i].dA*idx )
end
cairo_set_source (cr, pat)
cairo_pattern_destroy(pat)
end
--start drawing
cairo_save(cr)
--x axis is parrallel to start of sector
cairo_rotate(cr,angle0-math.pi/2)
local ri,re = t.int_radius ,t.radius
--point A
local angle_a
if t.cap == "p" then
angle_a = int_delta
if t.inverse_arc and type_arc ~="bg" then
angle_a = angle-int_angle-int_delta
end
if not(t.inverse_arc) and type_arc =="bg" then
angle_a = int_delta+int_angle
end
else --t.cap=="r"
angle_a = ext_delta
if t.inverse_arc and type_arc~="bg" then
angle_a = angle-ext_angle-ext_delta
end
if not(t.inverse_arc) and type_arc=="bg" then
angle_a = ext_delta+ext_angle
end
end
local ax,ay = ri*math.cos(angle_a),ri*math.sin(angle_a)
--point B
local angle_b = ext_delta
if t.cap == "p" then
if t.inverse_arc and type_arc ~="bg" then
angle_b = angle-ext_angle-ext_delta
end
if not(t.inverse_arc) and type_arc=="bg" then
angle_b = ext_delta+ext_angle
end
else
if t.inverse_arc and type_arc ~="bg" then
angle_b = angle-ext_angle-ext_delta
end
if not(t.inverse_arc) and type_arc=="bg" then
angle_b = ext_delta+ext_angle
end
end
local bx,by = re*math.cos(angle_b),re*math.sin(angle_b)
-- EXTERNAL ARC B --> C
local b0,b1
if t.inverse_arc then
if type_arc=="bg" then
b0,b1= ext_delta, angle-ext_delta-ext_angle
else
b0,b1= angle-ext_angle-ext_delta, angle-ext_delta
end
else
if type_arc=="bg" then
b0,b1= ext_delta+ext_angle, angle-ext_delta
else
b0,b1= ext_delta, ext_angle+ext_delta
end
end
---POINT D
local angle_c, angle_d
if t.cap == "p" then
angle_d = angle-int_delta
if t.inverse_arc and type_arc=="bg" then
angle_d = angle-int_delta-int_angle
end
if not(t.inverse_arc) and type_arc~="bg" then
angle_d=int_delta+int_angle
end
else
angle_d = angle-ext_delta
if t.inverse_arc and type_arc=="bg" then
angle_d =angle-ext_delta-ext_angle
end
if not(t.inverse_arc) and type_arc~="bg" then
angle_d = ext_angle+ext_delta
end
end
local dx,dy = ri*math.cos(angle_d),ri*math.sin(angle_d)
-- INTERNAL ARC D --> A
local d0,d1
if t.cap=="p" then
if t.inverse_arc then
if type_arc=="bg" then
d0,d1= angle-int_delta-int_angle,int_delta
else
d0,d1= angle-int_delta, angle- int_angle-int_delta
end
else
if type_arc=="bg" then
d0,d1= angle-int_delta, int_delta+int_angle
else
d0,d1= int_delta+int_angle, int_delta
end
end
else
if t.inverse_arc then
if type_arc=="bg" then
d0,d1= angle-ext_delta-ext_angle,ext_delta
else
d0,d1= angle-ext_delta, angle- ext_angle-ext_delta
end
else
if type_arc=="bg" then
d0,d1= angle-ext_delta,ext_delta+ext_angle
else
d0,d1= ext_angle+ext_delta, ext_delta
end
end
end
--draw sector
cairo_move_to(cr,ax,ay)
cairo_line_to(cr,bx,by)
cairo_arc(cr,0,0,re,b0,b1)
cairo_line_to(cr,dx,dy)
cairo_arc_negative(cr,0,0,ri,d0,d1)
cairo_close_path (cr);
--stroke or fill sector
if type_arc=="bd" then
cairo_set_line_width(cr,t.border_size)
cairo_stroke(cr)
else
cairo_fill(cr)
end
cairo_restore(cr)
end
--draw sectors
local n0,n1,n2 = 1,t.sectors,1
if t.inverse_arc then n0,n1,n2 = t.sectors,1,-1 end
local index = 0
for i = n0,n1,n2 do
index = index +1
local valueZ=1
local cstA, cstB = (i-1),i
if t.inverse_arc then cstA,cstB = (t.sectors-i), (t.sectors-i+1) end
if value>valueA *cstA and value<valueA*cstB then
if not t.fill_sector then
valueZ = (value-valueA*cstA)/valueA
end
else
if value<valueA*cstB then valueZ=0 end
end
local start_angle= lastAngle+(i-1)*angleA
if t.foreground ~= false then
draw_sector("fg",start_angle,angleA,valueZ, index)
end
if t.background ~= false then
draw_sector("bg",start_angle,angleA,valueZ, i)
end
if t.border_size>0 then draw_sector("bd",start_angle,angleA,1, i) end
end
cairo_restore(cr)
end
--[[END OF RING-SECTORS WIDGET]]
le charge + net
Caché :
background yes
use_xft yes
xftfont URW Chancery L:style=Bold:size=9
xftalpha 1
update_interval 1.0
total_run_times 0
own_window yes
own_window_transparent yes
own_window_argb_visual yes
own_window_type normal
own_window_hints undecorated,below,skip_taskbar,skip_pager
double_buffer yes
minimum_size 300
maximum_width 300
text_buffer_size 1024
draw_shades no
draw_outline no
draw_borders no
draw_graph_borders no
default_color e8e8e8
default_outline_color white
alignment tr
gap_x 180
gap_y 200
no_buffers yes
uppercase no
cpu_avg_samples 2
override_utf8_locale yes
# Fonctionne uniquement avec les polices Fixes
#use_spacer yes
# Taille des pointillés
stippled_borders 5
TEXT
${alignc}TOP CPU
${top name 1}${goto 150}${top cpu 1}%${alignr}${top pid 1}
${top name 2}${goto 150}${top cpu 2}%${alignr}${top pid 2}
${top name 3}${goto 150}${top cpu 3}%${alignr}${top pid 3}
${top name 4}${goto 150}${top cpu 4}%${alignr}${top pid 4}
${top name 5}${goto 150}${top cpu 5}%${alignr}${top pid 5}
${top name 6}${goto 150}${top cpu 6}%${alignr}${top pid 6}
${alignc}TOP RAM
${top_mem name 1}${goto 150}${top_mem mem 1}%${alignr}${top_mem pid 1}
${top_mem name 2}${goto 150}${top_mem mem 2}%${alignr}${top_mem pid 2}
${top_mem name 3}${goto 150}${top_mem mem 3}%${alignr}${top_mem pid 3}
${top_mem name 4}${goto 150}${top_mem mem 4}%${alignr}${top_mem pid 4}
${top_mem name 5}${goto 150}${top_mem mem 5}%${alignr}${top_mem pid 5}
${top_mem name 6}${goto 150}${top_mem mem 6}%${alignr}${top_mem pid 6}
${alignc}RESEAU:
Quality:${alignr}${wireless_link_qual_perc wlp2s0}%
Interface : ${gw_iface}${alignr}${wireless_essid wlp2s0}
Internal IP: ${alignr}${addr wlp2s0}
I.P. Pas. : ${alignr}${gw_ip}
URL${goto 150}NB PORTS OUVERTS: ${tcp_portmon 1 65535 count}
${tcp_portmon 1 65535 rip 0}${goto 195}${tcp_portmon 1 65535 rport 0}
${tcp_portmon 1 65535 rip 1}${goto 195}${tcp_portmon 1 65535 rport 1}
${tcp_portmon 1 65535 rip 2}${goto 195}${tcp_portmon 1 65535 rport 2}
${tcp_portmon 1 65535 rip 3}${goto 195}${tcp_portmon 1 65535 rport 3}
${tcp_portmon 1 65535 rip 4}${goto 195}${tcp_portmon 1 65535 rport 4}
background yes
use_xft yes
xftfont URW Chancery L:style=Bold:size=9
xftalpha 1
update_interval 1.0
total_run_times 0
own_window yes
own_window_transparent yes
own_window_argb_visual yes
own_window_type normal
own_window_hints undecorated,below,skip_taskbar,skip_pager
double_buffer yes
minimum_size 300
maximum_width 300
text_buffer_size 1024
draw_shades no
draw_outline no
draw_borders no
draw_graph_borders no
default_color e8e8e8
default_outline_color white
alignment tr
gap_x 180
gap_y 200
no_buffers yes
uppercase no
cpu_avg_samples 2
override_utf8_locale yes
# Fonctionne uniquement avec les polices Fixes
#use_spacer yes
# Taille des pointillés
stippled_borders 5
TEXT
${alignc}TOP CPU
${top name 1}${goto 150}${top cpu 1}%${alignr}${top pid 1}
${top name 2}${goto 150}${top cpu 2}%${alignr}${top pid 2}
${top name 3}${goto 150}${top cpu 3}%${alignr}${top pid 3}
${top name 4}${goto 150}${top cpu 4}%${alignr}${top pid 4}
${top name 5}${goto 150}${top cpu 5}%${alignr}${top pid 5}
${top name 6}${goto 150}${top cpu 6}%${alignr}${top pid 6}
${alignc}TOP RAM
${top_mem name 1}${goto 150}${top_mem mem 1}%${alignr}${top_mem pid 1}
${top_mem name 2}${goto 150}${top_mem mem 2}%${alignr}${top_mem pid 2}
${top_mem name 3}${goto 150}${top_mem mem 3}%${alignr}${top_mem pid 3}
${top_mem name 4}${goto 150}${top_mem mem 4}%${alignr}${top_mem pid 4}
${top_mem name 5}${goto 150}${top_mem mem 5}%${alignr}${top_mem pid 5}
${top_mem name 6}${goto 150}${top_mem mem 6}%${alignr}${top_mem pid 6}
${alignc}RESEAU:
Quality:${alignr}${wireless_link_qual_perc wlp2s0}%
Interface : ${gw_iface}${alignr}${wireless_essid wlp2s0}
Internal IP: ${alignr}${addr wlp2s0}
I.P. Pas. : ${alignr}${gw_ip}
URL${goto 150}NB PORTS OUVERTS: ${tcp_portmon 1 65535 count}
${tcp_portmon 1 65535 rip 0}${goto 195}${tcp_portmon 1 65535 rport 0}
${tcp_portmon 1 65535 rip 1}${goto 195}${tcp_portmon 1 65535 rport 1}
${tcp_portmon 1 65535 rip 2}${goto 195}${tcp_portmon 1 65535 rport 2}
${tcp_portmon 1 65535 rip 3}${goto 195}${tcp_portmon 1 65535 rport 3}
${tcp_portmon 1 65535 rip 4}${goto 195}${tcp_portmon 1 65535 rport 4}
la météo
le conkyrc :
Caché :
background yes
use_xft yes
xftfont URW Chancery L:style=Bold:size=10
xftalpha 1
update_interval 1.0
total_run_times 0
own_window yes
own_window_transparent yes
#own_window_color 000000
own_window_argb_visual yes
#own_window_argb_value 0
own_window_type normal
own_window_hints undecorated,below,skip_taskbar,skip_pager
double_buffer yes
minimum_size 470
maximum_width 470
text_buffer_size 2048
draw_shades no
draw_outline no
draw_borders no
draw_graph_borders no
default_color white
default_outline_color white
alignment top_right
gap_x 560
gap_y 450
no_buffers yes
uppercase no
cpu_avg_samples 2
override_utf8_locale yes
# Fonctionne uniquement avec les polices Fixes
#use_spacer yes
uppercase no
default_color e8e8e8
# -- Déclaration template -- #
template0 ${lua fDrawImage ~/.conky/conky-meteo/meteo6jours/fon/1 2 3 4 5} # -- images fond -- #
template1 ${lua Meteo_1 2 3 4 5 6} # -- gestion météo --#
template2 ${lua Meteo_1 2 3 4 5 6 7} # -- icônes météo -- 2=répertoire icônes 3=position 4=taille 5=jour (pour les prévisions) #
template3 ${lua Lune_1}
template4 ${lua_parse Images_1 2 3 60 4} # -- Appelle image -- 2=position 3=taille 4=jour (pour les prévisions) #
lua_load ~/.conky/conky-meteo/meteo_lua_2/scripts/meteo2.lua
lua_startup_hook init ~/.conky/conky-meteo/meteo6jours/meteo.cfg
TEXT
${template2 IconeM ~/.conky/conky-meteo/meteo_lua_2/icones 215 200 132 70}
${template2 Jour_IconeM ~/.conky/conky-meteo/meteo_lua_2/icones 1 350 75 45 2}
${template2 Jour_IconeM ~/.conky/conky-meteo/meteo_lua_2/icones 80 350 75 45 3}
${template2 Jour_IconeM ~/.conky/conky-meteo/meteo_lua_2/icones 160 350 75 45 4}
${template2 Jour_IconeM ~/.conky/conky-meteo/meteo_lua_2/icones 240 350 75 45 5}
${template2 Jour_IconeM ~/.conky/conky-meteo/meteo_lua_2/icones 320 350 75 45 6}
${template2 Jour_IconeM ~/.conky/conky-meteo/meteo_lua_2/icones 400 350 75 45 7}
${template1 Maj}${alignc}
${voffset 20}${font URW Chancery L:style=Bold:size=10}${goto 360}Vent : ${template1 VentDirP}
${font URW Chancery L :style=Bold:size=10}${goto 360}Vitesse : ${template1 VentForce} km/h
${goto 360}Pluie : ${template1 Jour_NivPrec 1} mm
${voffset -56}${goto 55}${font URW Chancery L :size=12 style:bold}${template1 Ville} : ${font URW Chancery L :size=10}${template1 TempAct}°C
${alignc 100}${template1 CondMeteo}
${alignc 115}${template1 Jour %a_%d 2}${alignc 50}${template1 Jour %a_%d 3}${alignc -12}${template1 Jour %a_%d 4}${alignc -72}${template1 Jour %a_%d 5}${alignc -135}${template1 Jour %a_%d 6}${alignc -200}${template1 Jour %a_%d 7}
${alignc 100}${template1 Jour_Temp 2}° / ${template1 Nuit_Temp 2}° ${alignc 40}${template1 Jour_Temp 3}° / ${template1 Nuit_Temp 3}° ${alignc -20}${template1 Jour_Temp 4}° / ${template1 Nuit_Temp 4}° ${alignc -78}${template1 Jour_Temp 5}° / ${template1 Nuit_Temp 5}° ${alignc -138}${template1 Jour_Temp 6}° / ${template1 Nuit_Temp 6}° ${alignc -202}${template1 Jour_Temp 7}° / ${template1 Nuit_Temp 7}°
${alignc 105}${template1 Jour_VentForce 2}km/h ${alignc 42}${template1 Jour_VentForce 3} km/h ${alignc -15}${template1 Jour_VentForce 4} km/h${alignc -80}${template1 Jour_VentForce 5} km/h ${alignc -135}${template1 Jour_VentForce 6} km/h${alignc -200}${template1 Jour_VentForce 7} km/h
use_xft yes
xftfont URW Chancery L:style=Bold:size=10
xftalpha 1
update_interval 1.0
total_run_times 0
own_window yes
own_window_transparent yes
#own_window_color 000000
own_window_argb_visual yes
#own_window_argb_value 0
own_window_type normal
own_window_hints undecorated,below,skip_taskbar,skip_pager
double_buffer yes
minimum_size 470
maximum_width 470
text_buffer_size 2048
draw_shades no
draw_outline no
draw_borders no
draw_graph_borders no
default_color white
default_outline_color white
alignment top_right
gap_x 560
gap_y 450
no_buffers yes
uppercase no
cpu_avg_samples 2
override_utf8_locale yes
# Fonctionne uniquement avec les polices Fixes
#use_spacer yes
uppercase no
default_color e8e8e8
# -- Déclaration template -- #
template0 ${lua fDrawImage ~/.conky/conky-meteo/meteo6jours/fon/1 2 3 4 5} # -- images fond -- #
template1 ${lua Meteo_1 2 3 4 5 6} # -- gestion météo --#
template2 ${lua Meteo_1 2 3 4 5 6 7} # -- icônes météo -- 2=répertoire icônes 3=position 4=taille 5=jour (pour les prévisions) #
template3 ${lua Lune_1}
template4 ${lua_parse Images_1 2 3 60 4} # -- Appelle image -- 2=position 3=taille 4=jour (pour les prévisions) #
lua_load ~/.conky/conky-meteo/meteo_lua_2/scripts/meteo2.lua
lua_startup_hook init ~/.conky/conky-meteo/meteo6jours/meteo.cfg
TEXT
${template2 IconeM ~/.conky/conky-meteo/meteo_lua_2/icones 215 200 132 70}
${template2 Jour_IconeM ~/.conky/conky-meteo/meteo_lua_2/icones 1 350 75 45 2}
${template2 Jour_IconeM ~/.conky/conky-meteo/meteo_lua_2/icones 80 350 75 45 3}
${template2 Jour_IconeM ~/.conky/conky-meteo/meteo_lua_2/icones 160 350 75 45 4}
${template2 Jour_IconeM ~/.conky/conky-meteo/meteo_lua_2/icones 240 350 75 45 5}
${template2 Jour_IconeM ~/.conky/conky-meteo/meteo_lua_2/icones 320 350 75 45 6}
${template2 Jour_IconeM ~/.conky/conky-meteo/meteo_lua_2/icones 400 350 75 45 7}
${template1 Maj}${alignc}
${voffset 20}${font URW Chancery L:style=Bold:size=10}${goto 360}Vent : ${template1 VentDirP}
${font URW Chancery L :style=Bold:size=10}${goto 360}Vitesse : ${template1 VentForce} km/h
${goto 360}Pluie : ${template1 Jour_NivPrec 1} mm
${voffset -56}${goto 55}${font URW Chancery L :size=12 style:bold}${template1 Ville} : ${font URW Chancery L :size=10}${template1 TempAct}°C
${alignc 100}${template1 CondMeteo}
${alignc 115}${template1 Jour %a_%d 2}${alignc 50}${template1 Jour %a_%d 3}${alignc -12}${template1 Jour %a_%d 4}${alignc -72}${template1 Jour %a_%d 5}${alignc -135}${template1 Jour %a_%d 6}${alignc -200}${template1 Jour %a_%d 7}
${alignc 100}${template1 Jour_Temp 2}° / ${template1 Nuit_Temp 2}° ${alignc 40}${template1 Jour_Temp 3}° / ${template1 Nuit_Temp 3}° ${alignc -20}${template1 Jour_Temp 4}° / ${template1 Nuit_Temp 4}° ${alignc -78}${template1 Jour_Temp 5}° / ${template1 Nuit_Temp 5}° ${alignc -138}${template1 Jour_Temp 6}° / ${template1 Nuit_Temp 6}° ${alignc -202}${template1 Jour_Temp 7}° / ${template1 Nuit_Temp 7}°
${alignc 105}${template1 Jour_VentForce 2}km/h ${alignc 42}${template1 Jour_VentForce 3} km/h ${alignc -15}${template1 Jour_VentForce 4} km/h${alignc -80}${template1 Jour_VentForce 5} km/h ${alignc -135}${template1 Jour_VentForce 6} km/h${alignc -200}${template1 Jour_VentForce 7} km/h
la montre :
conkyrc:
Caché :
#===================================================================================
# cai_simplicity.lua
# author : CAI
# version : 20130526
# license : Distributed under the terms of GNU GPL version 2 or later
# http://cai79.deviantart.com/
#===================================================================================
background yes
update_interval 1
cpu_avg_samples 2
net_avg_samples 2
temperature_unit celsius
pad_percents 2
double_buffer yes
no_buffers yes
text_buffer_size 2048
gap_x 935
gap_y 350
minimum_size 260 260
maximum_width 260
own_window yes
own_window_type normal
own_window_argb_visual yes
# for dark backgrounds:
#own_window_argb_value 100
# for light backgrounds:
own_window_argb_value 180
own_window_transparent yes
own_window_hints undecorate,sticky,skip_taskbar,skip_pager,below
border_inner_margin 0
border_outer_margin 0
alignment tr
draw_shades no
draw_outline no
draw_borders no
draw_graph_borders no
override_utf8_locale yes
use_xft yes
xftfont URW Chancery L:size=8
xftalpha 1
uppercase no
default_color 000000
default_bar_size 90 20
lua_load ~/.conky/clock/clock.lua
lua_draw_hook_post main
TEXT
# cai_simplicity.lua
# author : CAI
# version : 20130526
# license : Distributed under the terms of GNU GPL version 2 or later
# http://cai79.deviantart.com/
#===================================================================================
background yes
update_interval 1
cpu_avg_samples 2
net_avg_samples 2
temperature_unit celsius
pad_percents 2
double_buffer yes
no_buffers yes
text_buffer_size 2048
gap_x 935
gap_y 350
minimum_size 260 260
maximum_width 260
own_window yes
own_window_type normal
own_window_argb_visual yes
# for dark backgrounds:
#own_window_argb_value 100
# for light backgrounds:
own_window_argb_value 180
own_window_transparent yes
own_window_hints undecorate,sticky,skip_taskbar,skip_pager,below
border_inner_margin 0
border_outer_margin 0
alignment tr
draw_shades no
draw_outline no
draw_borders no
draw_graph_borders no
override_utf8_locale yes
use_xft yes
xftfont URW Chancery L:size=8
xftalpha 1
uppercase no
default_color 000000
default_bar_size 90 20
lua_load ~/.conky/clock/clock.lua
lua_draw_hook_post main
TEXT
le lua :
Caché :
--==============================================================================
-- clock.lua
-- author : CAI
-- version : 20130526
-- license : Distributed under the terms of GNU GPL version 2 or later
--
-- analog clock algorythm
-- author : ramzport (http://ramzport.blogspot.ru/2012/04/conkylua-1.html)
--==============================================================================
require 'cairo'
--------------------------------------------------------------------------------
-- clock DATA
function go_clock()
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)
cr = cairo_create(cs)
local nXCenter = conky_window.width/2
local nYCenter = 130
local nRadius = conky_window.width/2 - 15
local nSecond = tonumber(os.date('%S'))
local nMinute = tonumber(os.date('%M'))
local nHour = tonumber(os.date('%I'))
if nHour == 12 then nHour=0 end
--CLOCK
--numbers
for i = 1, 12 do
nTheta = math.rad(i*30)
nXCoord = nXCenter + (nRadius+8)*math.sin(nTheta)
nYCoord = nYCenter - (nRadius+8)*math.cos(nTheta)
if i==12 then nXCoord=nXCoord-3 end
fDrawTextCenter (nXCoord+1, nYCoord+6, i, 'URW Chancery L', 14, 0, 1, 0xcacaca, 1, 0)
fDrawTextCenter (nXCoord, nYCoord+5, i, 'URW Chancery L', 14, 0, 1, 0x999999, 0, 0)
end
for i = 0, 12 do
nTheta = math.rad(i*30)
nXCoord = nXCenter + (nRadius-12)*math.cos(nTheta)
nYCoord = nYCenter + (nRadius-12)*math.sin(nTheta)
nXoCoord = nXCenter + (nRadius-4)*math.cos(nTheta)
nYoCoord = nYCenter + (nRadius-4)*math.sin(nTheta)
fLine(nXoCoord, nYoCoord, nXCoord, nYCoord, 0xcacaca, 1, 2)
end
for i = 0, 60 do
nTheta = math.rad(i*6)
nXCoord = nXCenter + (nRadius-9)*math.cos(nTheta)
nYCoord = nYCenter + (nRadius-9)*math.sin(nTheta)
nXoCoord = nXCenter + (nRadius-5)*math.cos(nTheta)
nYoCoord = nYCenter + (nRadius-5)*math.sin(nTheta)
fLine(nXoCoord, nYoCoord, nXCoord, nYCoord, 0xcacaca, 1, 1)
end
-- text on clock face
fDrawTextCenter (nXCenter, nYCenter+30, '', 'URW Chancery L', 9, 0, 0, 0x555555, 1, 0)
-- hour
nTheta = math.rad(270+nHour*30+nMinute/2)
nXCoord = nXCenter+(nRadius-27)*math.cos(nTheta)
nYCoord = nYCenter+(nRadius-27)*math.sin(nTheta)
nXoCoord = nXCenter-5*math.cos(nTheta)
nYoCoord = nYCenter-5*math.sin(nTheta)
fLine(nXoCoord+1, nYoCoord+1, nXCoord+2, nYCoord+2, 0x555555, 0.3, 5)
cairo_set_line_width (cr, 5)
cairo_set_source_rgba(cr, fRGBtoARGB(0xcacaca, 1))
cairo_move_to(cr, nXoCoord, nYoCoord)
cairo_line_to(cr, nXCoord, nYCoord)
cairo_stroke(cr)
nTheta = math.rad(270+nHour*30+nMinute/2)
nXCoord = nXCenter+(nRadius-28)*math.cos(nTheta)
nYCoord = nYCenter+(nRadius-28)*math.sin(nTheta)
nXoCoord = nXCenter-4*math.cos(nTheta)
nYoCoord = nYCenter-4*math.sin(nTheta)
fLine(nXoCoord, nYoCoord, nXCoord, nYCoord, 0x555555, 1, 3)
-- minute
nTheta = math.rad(270+nMinute*6)
nXCoord = nXCenter+(nRadius-17)*math.cos(nTheta)
nYCoord = nYCenter+(nRadius-17)*math.sin(nTheta)
nXoCoord = nXCenter-5*math.cos(nTheta)
nYoCoord = nYCenter-5*math.sin(nTheta)
fLine(nXoCoord+1, nYoCoord+1, nXCoord+2, nYCoord+2, 0x555555, 0.3, 4)
cairo_set_line_width (cr, 4)
cairo_set_source_rgba(cr, fRGBtoARGB(0xcacaca, 1))
cairo_move_to(cr, nXoCoord, nYoCoord)
cairo_line_to(cr, nXCoord, nYCoord)
cairo_stroke(cr)
nTheta = math.rad(270+nMinute*6)
nXCoord = nXCenter+(nRadius-18)*math.cos(nTheta)
nYCoord = nYCenter+(nRadius-18)*math.sin(nTheta)
nXoCoord = nXCenter-4*math.cos(nTheta)
nYoCoord = nYCenter-4*math.sin(nTheta)
fLine(nXoCoord, nYoCoord, nXCoord, nYCoord, 0x555555, 1, 2)
-- second
nTheta = math.rad(270+nSecond*6)
nXCoord = nXCenter+(nRadius-7)*math.cos(nTheta)
nYCoord = nYCenter+(nRadius-7)*math.sin(nTheta)
nXoCoord = nXCenter-10*math.cos(nTheta)
nYoCoord = nYCenter-10*math.sin(nTheta)
fLine(nXoCoord+1, nYoCoord+1, nXCoord+2, nYCoord+2, 0x555555, 0.3, 3)
cairo_set_line_width (cr, 3)
cairo_set_source_rgba(cr, fRGBtoARGB(0xcacaca, 1))
cairo_move_to(cr, nXoCoord, nYoCoord)
cairo_line_to(cr, nXCoord, nYCoord)
cairo_stroke(cr)
nTheta = math.rad(270+nSecond*6)
nXCoord = nXCenter+(nRadius-8)*math.cos(nTheta)
nYCoord = nYCenter+(nRadius-8)*math.sin(nTheta)
nXoCoord = nXCenter-9*math.cos(nTheta)
nYoCoord = nYCenter-9*math.sin(nTheta)
fLine(nXoCoord, nYoCoord, nXCoord, nYCoord, 0x555555, 0.1, 1)
-- glossy
cairo_set_source_rgba(cr, fRGBtoARGB(0xffffff, 1))
cairo_new_sub_path(cr)
cairo_arc (cr, nXCenter, nYCenter, nRadius, math.rad(0), math.rad(360))
local pLin = cairo_pattern_create_radial (nXCenter, nYCenter-50, 0, nXCenter, nYCenter-50, nRadius+55)
cairo_pattern_add_color_stop_rgba (pLin, 0.0, fRGBtoARGB(0xffffff, 0.0))
cairo_pattern_add_color_stop_rgba (pLin, 0.3, fRGBtoARGB(0xffffff, 0.0))
cairo_pattern_add_color_stop_rgba (pLin, 1, fRGBtoARGB(0xffffff, 0.0))
cairo_set_source (cr, pLin)
cairo_fill(cr)
cairo_pattern_destroy (pLin)
end
function fRGBtoARGB (nColor, nAlpha)
return ((nColor / 0x10000) % 0x100) / 255., ((nColor / 0x100) % 0x100) / 255., (nColor % 0x100) / 255., nAlpha
end
function fDrawTextCenter (nXCenter, nYCenter, sText, sFontName, sFontSize, nFontSlant, nFontWeight, nColor, nAlpha, nRotate)
local extents = cairo_text_extents_t:create()
cairo_select_font_face (cr, sFontName, nFontSlant, nFontWeight)
cairo_set_font_size (cr, sFontSize)
cairo_text_extents (cr, sText, extents)
local nXSpace = nXCenter-(extents.width/2)
local nYSpace = nYCenter
cairo_move_to (cr, nXSpace, nYSpace)
cairo_set_source_rgba(cr, fRGBtoARGB (nColor, nAlpha))
cairo_rotate (cr, nRotate*math.pi/180)
cairo_show_text(cr, sText)
cairo_rotate (cr, (0-nRotate)*math.pi/180)
end
function fLine(nXoCoord, nYoCoord, nXCoord, nYCoord, nColor, nAlpha, nWidthLine)
cairo_set_source_rgba(cr, fRGBtoARGB(nColor, nAlpha))
cairo_set_line_width (cr, nWidthLine)
cairo_move_to(cr, nXoCoord, nYoCoord)
cairo_line_to(cr, nXCoord, nYCoord)
cairo_stroke(cr)
end
function fRoundRect (nXCoord, nYCoord, nWidth, nHeight, nRadius)
cairo_move_to(cr, nXCoord+nRadius, nYCoord)
cairo_line_to(cr, nXCoord+nWidth-nRadius, nYCoord)
cairo_arc (cr, nXCoord+nWidth-nRadius, nYCoord+nRadius, nRadius, math.rad(270), math.rad(360))
cairo_line_to(cr, nXCoord+nWidth, nYCoord+nHeight-nRadius)
cairo_arc (cr, nXCoord+nWidth-nRadius, nYCoord+nHeight-nRadius, nRadius, math.rad(0), math.rad(90))
cairo_line_to(cr, nXCoord+nRadius, nYCoord+nHeight)
cairo_arc (cr, nXCoord+nRadius, nYCoord+nHeight-nRadius, nRadius, math.rad(90), math.rad(180))
cairo_line_to(cr, nXCoord, nYCoord+nRadius)
cairo_arc (cr, nXCoord+nRadius, nYCoord+nRadius, nRadius, math.rad(180), math.rad(270))
end
-------------------------------------------------------------------------------
-- MAIN
function conky_main()
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 display = cairo_create(cs)
local updates = conky_parse('${updates}')
update_num = tonumber(updates)
if update_num > 5 then
go_clock()
end
cairo_surface_destroy(cs)
cairo_destroy(display)
end
-- clock.lua
-- author : CAI
-- version : 20130526
-- license : Distributed under the terms of GNU GPL version 2 or later
--
-- analog clock algorythm
-- author : ramzport (http://ramzport.blogspot.ru/2012/04/conkylua-1.html)
--==============================================================================
require 'cairo'
--------------------------------------------------------------------------------
-- clock DATA
function go_clock()
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)
cr = cairo_create(cs)
local nXCenter = conky_window.width/2
local nYCenter = 130
local nRadius = conky_window.width/2 - 15
local nSecond = tonumber(os.date('%S'))
local nMinute = tonumber(os.date('%M'))
local nHour = tonumber(os.date('%I'))
if nHour == 12 then nHour=0 end
--CLOCK
--numbers
for i = 1, 12 do
nTheta = math.rad(i*30)
nXCoord = nXCenter + (nRadius+8)*math.sin(nTheta)
nYCoord = nYCenter - (nRadius+8)*math.cos(nTheta)
if i==12 then nXCoord=nXCoord-3 end
fDrawTextCenter (nXCoord+1, nYCoord+6, i, 'URW Chancery L', 14, 0, 1, 0xcacaca, 1, 0)
fDrawTextCenter (nXCoord, nYCoord+5, i, 'URW Chancery L', 14, 0, 1, 0x999999, 0, 0)
end
for i = 0, 12 do
nTheta = math.rad(i*30)
nXCoord = nXCenter + (nRadius-12)*math.cos(nTheta)
nYCoord = nYCenter + (nRadius-12)*math.sin(nTheta)
nXoCoord = nXCenter + (nRadius-4)*math.cos(nTheta)
nYoCoord = nYCenter + (nRadius-4)*math.sin(nTheta)
fLine(nXoCoord, nYoCoord, nXCoord, nYCoord, 0xcacaca, 1, 2)
end
for i = 0, 60 do
nTheta = math.rad(i*6)
nXCoord = nXCenter + (nRadius-9)*math.cos(nTheta)
nYCoord = nYCenter + (nRadius-9)*math.sin(nTheta)
nXoCoord = nXCenter + (nRadius-5)*math.cos(nTheta)
nYoCoord = nYCenter + (nRadius-5)*math.sin(nTheta)
fLine(nXoCoord, nYoCoord, nXCoord, nYCoord, 0xcacaca, 1, 1)
end
-- text on clock face
fDrawTextCenter (nXCenter, nYCenter+30, '', 'URW Chancery L', 9, 0, 0, 0x555555, 1, 0)
-- hour
nTheta = math.rad(270+nHour*30+nMinute/2)
nXCoord = nXCenter+(nRadius-27)*math.cos(nTheta)
nYCoord = nYCenter+(nRadius-27)*math.sin(nTheta)
nXoCoord = nXCenter-5*math.cos(nTheta)
nYoCoord = nYCenter-5*math.sin(nTheta)
fLine(nXoCoord+1, nYoCoord+1, nXCoord+2, nYCoord+2, 0x555555, 0.3, 5)
cairo_set_line_width (cr, 5)
cairo_set_source_rgba(cr, fRGBtoARGB(0xcacaca, 1))
cairo_move_to(cr, nXoCoord, nYoCoord)
cairo_line_to(cr, nXCoord, nYCoord)
cairo_stroke(cr)
nTheta = math.rad(270+nHour*30+nMinute/2)
nXCoord = nXCenter+(nRadius-28)*math.cos(nTheta)
nYCoord = nYCenter+(nRadius-28)*math.sin(nTheta)
nXoCoord = nXCenter-4*math.cos(nTheta)
nYoCoord = nYCenter-4*math.sin(nTheta)
fLine(nXoCoord, nYoCoord, nXCoord, nYCoord, 0x555555, 1, 3)
-- minute
nTheta = math.rad(270+nMinute*6)
nXCoord = nXCenter+(nRadius-17)*math.cos(nTheta)
nYCoord = nYCenter+(nRadius-17)*math.sin(nTheta)
nXoCoord = nXCenter-5*math.cos(nTheta)
nYoCoord = nYCenter-5*math.sin(nTheta)
fLine(nXoCoord+1, nYoCoord+1, nXCoord+2, nYCoord+2, 0x555555, 0.3, 4)
cairo_set_line_width (cr, 4)
cairo_set_source_rgba(cr, fRGBtoARGB(0xcacaca, 1))
cairo_move_to(cr, nXoCoord, nYoCoord)
cairo_line_to(cr, nXCoord, nYCoord)
cairo_stroke(cr)
nTheta = math.rad(270+nMinute*6)
nXCoord = nXCenter+(nRadius-18)*math.cos(nTheta)
nYCoord = nYCenter+(nRadius-18)*math.sin(nTheta)
nXoCoord = nXCenter-4*math.cos(nTheta)
nYoCoord = nYCenter-4*math.sin(nTheta)
fLine(nXoCoord, nYoCoord, nXCoord, nYCoord, 0x555555, 1, 2)
-- second
nTheta = math.rad(270+nSecond*6)
nXCoord = nXCenter+(nRadius-7)*math.cos(nTheta)
nYCoord = nYCenter+(nRadius-7)*math.sin(nTheta)
nXoCoord = nXCenter-10*math.cos(nTheta)
nYoCoord = nYCenter-10*math.sin(nTheta)
fLine(nXoCoord+1, nYoCoord+1, nXCoord+2, nYCoord+2, 0x555555, 0.3, 3)
cairo_set_line_width (cr, 3)
cairo_set_source_rgba(cr, fRGBtoARGB(0xcacaca, 1))
cairo_move_to(cr, nXoCoord, nYoCoord)
cairo_line_to(cr, nXCoord, nYCoord)
cairo_stroke(cr)
nTheta = math.rad(270+nSecond*6)
nXCoord = nXCenter+(nRadius-8)*math.cos(nTheta)
nYCoord = nYCenter+(nRadius-8)*math.sin(nTheta)
nXoCoord = nXCenter-9*math.cos(nTheta)
nYoCoord = nYCenter-9*math.sin(nTheta)
fLine(nXoCoord, nYoCoord, nXCoord, nYCoord, 0x555555, 0.1, 1)
-- glossy
cairo_set_source_rgba(cr, fRGBtoARGB(0xffffff, 1))
cairo_new_sub_path(cr)
cairo_arc (cr, nXCenter, nYCenter, nRadius, math.rad(0), math.rad(360))
local pLin = cairo_pattern_create_radial (nXCenter, nYCenter-50, 0, nXCenter, nYCenter-50, nRadius+55)
cairo_pattern_add_color_stop_rgba (pLin, 0.0, fRGBtoARGB(0xffffff, 0.0))
cairo_pattern_add_color_stop_rgba (pLin, 0.3, fRGBtoARGB(0xffffff, 0.0))
cairo_pattern_add_color_stop_rgba (pLin, 1, fRGBtoARGB(0xffffff, 0.0))
cairo_set_source (cr, pLin)
cairo_fill(cr)
cairo_pattern_destroy (pLin)
end
function fRGBtoARGB (nColor, nAlpha)
return ((nColor / 0x10000) % 0x100) / 255., ((nColor / 0x100) % 0x100) / 255., (nColor % 0x100) / 255., nAlpha
end
function fDrawTextCenter (nXCenter, nYCenter, sText, sFontName, sFontSize, nFontSlant, nFontWeight, nColor, nAlpha, nRotate)
local extents = cairo_text_extents_t:create()
cairo_select_font_face (cr, sFontName, nFontSlant, nFontWeight)
cairo_set_font_size (cr, sFontSize)
cairo_text_extents (cr, sText, extents)
local nXSpace = nXCenter-(extents.width/2)
local nYSpace = nYCenter
cairo_move_to (cr, nXSpace, nYSpace)
cairo_set_source_rgba(cr, fRGBtoARGB (nColor, nAlpha))
cairo_rotate (cr, nRotate*math.pi/180)
cairo_show_text(cr, sText)
cairo_rotate (cr, (0-nRotate)*math.pi/180)
end
function fLine(nXoCoord, nYoCoord, nXCoord, nYCoord, nColor, nAlpha, nWidthLine)
cairo_set_source_rgba(cr, fRGBtoARGB(nColor, nAlpha))
cairo_set_line_width (cr, nWidthLine)
cairo_move_to(cr, nXoCoord, nYoCoord)
cairo_line_to(cr, nXCoord, nYCoord)
cairo_stroke(cr)
end
function fRoundRect (nXCoord, nYCoord, nWidth, nHeight, nRadius)
cairo_move_to(cr, nXCoord+nRadius, nYCoord)
cairo_line_to(cr, nXCoord+nWidth-nRadius, nYCoord)
cairo_arc (cr, nXCoord+nWidth-nRadius, nYCoord+nRadius, nRadius, math.rad(270), math.rad(360))
cairo_line_to(cr, nXCoord+nWidth, nYCoord+nHeight-nRadius)
cairo_arc (cr, nXCoord+nWidth-nRadius, nYCoord+nHeight-nRadius, nRadius, math.rad(0), math.rad(90))
cairo_line_to(cr, nXCoord+nRadius, nYCoord+nHeight)
cairo_arc (cr, nXCoord+nRadius, nYCoord+nHeight-nRadius, nRadius, math.rad(90), math.rad(180))
cairo_line_to(cr, nXCoord, nYCoord+nRadius)
cairo_arc (cr, nXCoord+nRadius, nYCoord+nRadius, nRadius, math.rad(180), math.rad(270))
end
-------------------------------------------------------------------------------
-- MAIN
function conky_main()
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 display = cairo_create(cs)
local updates = conky_parse('${updates}')
update_num = tonumber(updates)
if update_num > 5 then
go_clock()
end
cairo_surface_destroy(cs)
cairo_destroy(display)
end
l'éphéméride:
Caché :
background yes
use_xft yes
xftfont URW Chancery L:style=Bold:size=9
xftalpha 1
update_interval 1.0
total_run_times 0
own_window yes
own_window_transparent yes
own_window_argb_visual yes
own_window_type normal
own_window_hints undecorated,below,skip_taskbar,skip_pager
double_buffer yes
minimum_size 420
maximum_width 420
text_buffer_size 2048
draw_shades no
draw_outline no
draw_borders no
draw_graph_borders no
default_color e8e8e8
default_outline_color white
alignment top_left
gap_x 70
gap_y 10
no_buffers yes
uppercase no
cpu_avg_samples 2
override_utf8_locale yes
TEXT
${alignc}EPHEMERIDE
Semaine : ${time %V} Jour : ${time %j} ${time %A %d %B}
Signe astrologique ${execp ~/.conky/blanc/astro_neo.sh}
Saint du jour : ${texeci 28800 wget -q http://nominis.cef.fr/ -O saint.html -O - | iconv -f latin1 -t utf8 | sed '1,/Bonne Fête !/d; /Autres Fêtes du Jour/Q;' | sed '$d' | sed '1i<html>' | sed '4a</html>' | xmlstarlet sel -t -v '//dt/a' | awk 'ORS=NR%6?" ":"n"'}
Blague du jour : ${texeci 28800 wget www.blaguesdegeek.com/aleatoire.html -o /dev/null -O - | egrep '<p class.*</p>' | sed 's/<p class="contenu">//1' | sed 's/</p>//1' | sed 's/^[ t]*//;s/[ t]*$//' | recode h..utf8 | head -n 1 | fold -s -w 60}
.
background yes
use_xft yes
xftfont URW Chancery L:style=Bold:size=9
xftalpha 1
update_interval 1.0
total_run_times 0
own_window yes
own_window_transparent yes
own_window_argb_visual yes
own_window_type normal
own_window_hints undecorated,below,skip_taskbar,skip_pager
double_buffer yes
minimum_size 420
maximum_width 420
text_buffer_size 2048
draw_shades no
draw_outline no
draw_borders no
draw_graph_borders no
default_color e8e8e8
default_outline_color white
alignment top_left
gap_x 70
gap_y 10
no_buffers yes
uppercase no
cpu_avg_samples 2
override_utf8_locale yes
TEXT
${alignc}EPHEMERIDE
Semaine : ${time %V} Jour : ${time %j} ${time %A %d %B}
Signe astrologique ${execp ~/.conky/blanc/astro_neo.sh}
Saint du jour : ${texeci 28800 wget -q http://nominis.cef.fr/ -O saint.html -O - | iconv -f latin1 -t utf8 | sed '1,/Bonne Fête !/d; /Autres Fêtes du Jour/Q;' | sed '$d' | sed '1i<html>' | sed '4a</html>' | xmlstarlet sel -t -v '//dt/a' | awk 'ORS=NR%6?" ":"n"'}
Blague du jour : ${texeci 28800 wget www.blaguesdegeek.com/aleatoire.html -o /dev/null -O - | egrep '<p class.*</p>' | sed 's/<p class="contenu">//1' | sed 's/</p>//1' | sed 's/^[ t]*//;s/[ t]*$//' | recode h..utf8 | head -n 1 | fold -s -w 60}
.
les heures:
Caché :
background yes
use_xft yes
xftfont URW Chancery L:style=Bold:size=8
xftalpha 1
update_interval 1.0
total_run_times 0
own_window yes
own_window_transparent yes # no si enleve #
#own_window_color 000000
own_window_argb_visual yes
#own_window_argb_value 0
own_window_type normal
own_window_hints undecorated,below,skip_taskbar,skip_pager
double_buffer yes
minimum_size 300
maximum_width 300
text_buffer_size 1024
draw_shades no
draw_outline no
draw_borders no
draw_graph_borders no
default_color black
default_outline_color white
alignment top_left
gap_x 80
gap_y 250
no_buffers yes
uppercase no
cpu_avg_samples 2
override_utf8_locale yes
# Fonctionne uniquement avec les polices Fixes
#use_spacer yes
# Couleurs
default_color e8e8e8 #blanc
default_shade_color 333333
default_outline_color black
color6 cacaca
TEXT
${goto 50}HEURES GRANDES VILLES MONDIALES
${tztime US/Hawaii %A %d %B %Y}
${color6}${tztime Asia/Tokyo %A %d %B %Y}${color}
${goto 25}${if_match ${tztime Europe/London %d} == ${tztime NZ %d}}${color6} Londres ${goto 120}${tztime Europe/London %R}${color}${else} Londres ${goto 180}${tztime Europe/London %R}${endif}
${goto 25}${if_match ${tztime Europe/Rome %d} == ${tztime NZ %d}}${color6} Rome ${goto 120}${tztime Europe/Rome %R}${color}${else} Rome ${goto 180}${tztime Europe/Rome %R}${endif}
${goto 25}${if_match ${tztime US/Eastern %d} == ${tztime NZ %d}}${color6} Miami ${goto 120}${tztime US/Eastern %R}${color}${else} Miami ${goto 180}${tztime US/Eastern %R}${endif}
${goto 25}${if_match ${tztime America/Mexico_City %d} == ${tztime NZ %d}}${color6} Mexico ${goto 120}${tztime America/Mexico_City %R}${color}${else} Mexico ${goto 180}${tztime America/Mexico_City %R}${endif}
${goto 25}${if_match ${tztime America/Buenos_Aires %d} == ${tztime NZ %d}}${color6} Buenos Aires ${goto 120}${tztime America/Buenos_Aires %R}${color}${else} Buenos Aires ${goto 180}${tztime America/Buenos_Aires %R}${endif}
${goto 25}${if_match ${tztime US/Pacific %d} == ${tztime NZ %d}}${color6} Los Angeles ${goto 120}${tztime US/Pacific %R}${color}${else} Los Angeles ${goto 180}${tztime US/Pacific %R}${endif}
${goto 25}${if_match ${tztime US/Hawaii %d} == ${tztime NZ %d}}${color6} Honolulu ${goto 120}${tztime US/Hawaii %R}${color}${else} Honolulu ${goto 180}${tztime US/Hawaii %R}${endif}
${goto 25}${if_match ${tztime Asia/Tokyo %d} == ${tztime NZ %d}}${color6} Tokyo ${goto 120}${tztime Asia/Tokyo %R}${color}${else} Tokyo ${goto 180}${tztime Asia/Tokyo %R}${endif}
${goto 25}${if_match ${tztime Asia/Singapore %d} == ${tztime NZ %d}}${color6} Singapore ${goto 120}${tztime Asia/Singapore %R}${color}${else} Singapore ${goto 180}${tztime Asia/Singapore %R}${endif}
${goto 25}${if_match ${tztime GMT-5:30 %d} == ${tztime NZ %d}}${color6} New Delhi ${goto 120}${tztime GMT-5:30 %R}${color}${else} New Delhi ${goto 180}${tztime GMT-5:30 %R}${endif}
${goto 25}${if_match ${tztime Africa/Johannesburg %d} == ${tztime NZ %d}}${color6} Le Cap ${goto 120}${tztime Africa/Johannesburg %R}${color}${else} Le Cap ${goto 180}${tztime Africa/Johannesburg %R}${endif}
background yes
use_xft yes
xftfont URW Chancery L:style=Bold:size=8
xftalpha 1
update_interval 1.0
total_run_times 0
own_window yes
own_window_transparent yes # no si enleve #
#own_window_color 000000
own_window_argb_visual yes
#own_window_argb_value 0
own_window_type normal
own_window_hints undecorated,below,skip_taskbar,skip_pager
double_buffer yes
minimum_size 300
maximum_width 300
text_buffer_size 1024
draw_shades no
draw_outline no
draw_borders no
draw_graph_borders no
default_color black
default_outline_color white
alignment top_left
gap_x 80
gap_y 250
no_buffers yes
uppercase no
cpu_avg_samples 2
override_utf8_locale yes
# Fonctionne uniquement avec les polices Fixes
#use_spacer yes
# Couleurs
default_color e8e8e8 #blanc
default_shade_color 333333
default_outline_color black
color6 cacaca
TEXT
${goto 50}HEURES GRANDES VILLES MONDIALES
${tztime US/Hawaii %A %d %B %Y}
${color6}${tztime Asia/Tokyo %A %d %B %Y}${color}
${goto 25}${if_match ${tztime Europe/London %d} == ${tztime NZ %d}}${color6} Londres ${goto 120}${tztime Europe/London %R}${color}${else} Londres ${goto 180}${tztime Europe/London %R}${endif}
${goto 25}${if_match ${tztime Europe/Rome %d} == ${tztime NZ %d}}${color6} Rome ${goto 120}${tztime Europe/Rome %R}${color}${else} Rome ${goto 180}${tztime Europe/Rome %R}${endif}
${goto 25}${if_match ${tztime US/Eastern %d} == ${tztime NZ %d}}${color6} Miami ${goto 120}${tztime US/Eastern %R}${color}${else} Miami ${goto 180}${tztime US/Eastern %R}${endif}
${goto 25}${if_match ${tztime America/Mexico_City %d} == ${tztime NZ %d}}${color6} Mexico ${goto 120}${tztime America/Mexico_City %R}${color}${else} Mexico ${goto 180}${tztime America/Mexico_City %R}${endif}
${goto 25}${if_match ${tztime America/Buenos_Aires %d} == ${tztime NZ %d}}${color6} Buenos Aires ${goto 120}${tztime America/Buenos_Aires %R}${color}${else} Buenos Aires ${goto 180}${tztime America/Buenos_Aires %R}${endif}
${goto 25}${if_match ${tztime US/Pacific %d} == ${tztime NZ %d}}${color6} Los Angeles ${goto 120}${tztime US/Pacific %R}${color}${else} Los Angeles ${goto 180}${tztime US/Pacific %R}${endif}
${goto 25}${if_match ${tztime US/Hawaii %d} == ${tztime NZ %d}}${color6} Honolulu ${goto 120}${tztime US/Hawaii %R}${color}${else} Honolulu ${goto 180}${tztime US/Hawaii %R}${endif}
${goto 25}${if_match ${tztime Asia/Tokyo %d} == ${tztime NZ %d}}${color6} Tokyo ${goto 120}${tztime Asia/Tokyo %R}${color}${else} Tokyo ${goto 180}${tztime Asia/Tokyo %R}${endif}
${goto 25}${if_match ${tztime Asia/Singapore %d} == ${tztime NZ %d}}${color6} Singapore ${goto 120}${tztime Asia/Singapore %R}${color}${else} Singapore ${goto 180}${tztime Asia/Singapore %R}${endif}
${goto 25}${if_match ${tztime GMT-5:30 %d} == ${tztime NZ %d}}${color6} New Delhi ${goto 120}${tztime GMT-5:30 %R}${color}${else} New Delhi ${goto 180}${tztime GMT-5:30 %R}${endif}
${goto 25}${if_match ${tztime Africa/Johannesburg %d} == ${tztime NZ %d}}${color6} Le Cap ${goto 120}${tztime Africa/Johannesburg %R}${color}${else} Le Cap ${goto 180}${tztime Africa/Johannesburg %R}${endif}
la lunaison
Caché :
background yes
use_xft yes
xftfont URW Chancery L:style=Bold:size=9
xftalpha 1
update_interval 1.0
total_run_times 0
own_window yes
own_window_transparent yes
#own_window_color 000000
own_window_argb_visual yes
#own_window_argb_value 0
own_window_type normal
own_window_hints undecorated,below,skip_taskbar,skip_pager
double_buffer yes
minimum_size 440
maximum_width 440
text_buffer_size 1024
draw_shades no
draw_outline no
draw_borders no
draw_graph_borders yes
default_color 00000
default_outline_color white
alignment top_left
gap_x 80
gap_y 620
no_buffers yes
uppercase no
cpu_avg_samples 2
override_utf8_locale yes
# Fonctionne uniquement avec les polices Fixes
#use_spacer yes
# Taille des pointillés
stippled_borders 5
# Couleurs
color1 000000
#
color2 e8e8e8
#
color3 cacaca
#
color4 cacaca
#
color5 e7e7e7
#
color6 red
default_color e8e8e8
# -- Déclaration template -- #
template1 ${lua Meteo_1 2 3 4 5 6} # -- gestion météo --#
template2 ${lua Meteo_1 2 3 4 5 6 7} # -- icônes météo -- 2=répertoire icônes 3=position 4=taille 5=jour (pour les prévisions) #
template3 ${lua Lune_1}
lua_load ~/.conky/conky-meteo/meteo_lua_2/scripts/meteo2.lua
lua_startup_hook init ~/.conky/conky-meteo/meteo/meteo.cfg
TEXT
${goto 130}LUNAISON${template1 horsligne}
${color3}Éphémérides journalières ${color2}${goto 180} ${template3 ephemerides}
${color3}Taux de visibilité de la lune ${color2}${goto 180} ${template3 Visibilite} %
${color3}Phases ${color2}${goto 180} ${template3 Phases}
${color3}Prochain nœud lunaire dans ${color2}${goto 180} ${template3 Noeudlunaire} jours
${color3}Prochaine apogée dans ${color2}${goto 180} ${template3 Apogee} jours
${color3}Prochaine périgée dans ${color2}${goto 180} ${template3 Perigee} jours
${color3}Distance terre lune ${color2}${goto 180} ${template3 Distance} kms
${color3}Age de la lune ${color2}${goto 180} ${template3 Age}
${color3}Heure lever lune ${color2}${goto 180} ${template3 HLeverLune}:${template3 MLeverLune}
${color3}Heure coucher lune ${color2}${goto 180} ${template3 HCoucherLune}:${template3 MCoucherLune}
${color3}Prochaine éclipse partielle ${color2}${goto 180} ${template3 EclipsePartielle}
${color3}Prochaine éclipse total ${color2}${goto 180} ${template3 EclipseTotal}
background yes
use_xft yes
xftfont URW Chancery L:style=Bold:size=9
xftalpha 1
update_interval 1.0
total_run_times 0
own_window yes
own_window_transparent yes
#own_window_color 000000
own_window_argb_visual yes
#own_window_argb_value 0
own_window_type normal
own_window_hints undecorated,below,skip_taskbar,skip_pager
double_buffer yes
minimum_size 440
maximum_width 440
text_buffer_size 1024
draw_shades no
draw_outline no
draw_borders no
draw_graph_borders yes
default_color 00000
default_outline_color white
alignment top_left
gap_x 80
gap_y 620
no_buffers yes
uppercase no
cpu_avg_samples 2
override_utf8_locale yes
# Fonctionne uniquement avec les polices Fixes
#use_spacer yes
# Taille des pointillés
stippled_borders 5
# Couleurs
color1 000000
#
color2 e8e8e8
#
color3 cacaca
#
color4 cacaca
#
color5 e7e7e7
#
color6 red
default_color e8e8e8
# -- Déclaration template -- #
template1 ${lua Meteo_1 2 3 4 5 6} # -- gestion météo --#
template2 ${lua Meteo_1 2 3 4 5 6 7} # -- icônes météo -- 2=répertoire icônes 3=position 4=taille 5=jour (pour les prévisions) #
template3 ${lua Lune_1}
lua_load ~/.conky/conky-meteo/meteo_lua_2/scripts/meteo2.lua
lua_startup_hook init ~/.conky/conky-meteo/meteo/meteo.cfg
TEXT
${goto 130}LUNAISON${template1 horsligne}
${color3}Éphémérides journalières ${color2}${goto 180} ${template3 ephemerides}
${color3}Taux de visibilité de la lune ${color2}${goto 180} ${template3 Visibilite} %
${color3}Phases ${color2}${goto 180} ${template3 Phases}
${color3}Prochain nœud lunaire dans ${color2}${goto 180} ${template3 Noeudlunaire} jours
${color3}Prochaine apogée dans ${color2}${goto 180} ${template3 Apogee} jours
${color3}Prochaine périgée dans ${color2}${goto 180} ${template3 Perigee} jours
${color3}Distance terre lune ${color2}${goto 180} ${template3 Distance} kms
${color3}Age de la lune ${color2}${goto 180} ${template3 Age}
${color3}Heure lever lune ${color2}${goto 180} ${template3 HLeverLune}:${template3 MLeverLune}
${color3}Heure coucher lune ${color2}${goto 180} ${template3 HCoucherLune}:${template3 MCoucherLune}
${color3}Prochaine éclipse partielle ${color2}${goto 180} ${template3 EclipsePartielle}
${color3}Prochaine éclipse total ${color2}${goto 180} ${template3 EclipseTotal}
et puis l'image:

.gif)
Édité par loutch Le 19/02/2014 à 17h03
Linuxmint 24.02 Xia - Mageia 9 xfce et plasma sur ssd sur HP Pavilion g7
Xubuntu 18.04 LTS et 24.04 en xfce sur ASUS Rog STRIX
Xubuntu 18.04 LTS et 24.04 en xfce sur ASUS Rog STRIX

m@rco123 Membre non connecté
-
- Voir le profil du membre m@rco123
- Inscrit le : 15/05/2009
- Groupes :

Lenovo 110-17acl
cg Mullins [Radeon R3 Graphics] / ssd SanDisk 250Go
Mageia 9 plasma 64b
packard ls11hr
cg intel 810 / ssd SanDisk 128Go
Mageia 9 plasma 64b
cg Mullins [Radeon R3 Graphics] / ssd SanDisk 250Go
Mageia 9 plasma 64b
packard ls11hr
cg intel 810 / ssd SanDisk 128Go
Mageia 9 plasma 64b
Répondre
Vous n'êtes pas autorisé à écrire dans cette catégorie