Bonjour,
J'ai repris ce conky-lua:
https://elwan7.wordpress.com/tag/conky-lua/
Et l'ai un peu fait à mon goût:
http://nsa38.casimages.com/img/2016/06/09/160609020013182007.png
Un peu encombrant ce conky! En double écran c'est pas mal:
http://nsa37.casimages.com/img/2016/06/09/160609020108119455.png
Vous pouvez télécharger l'ensemble là(.conkyrc, scipts et rings.lua, fond d'écran, et les images tux, cadre transparent et grille pour le up et down du download qui m'ont servit pour modifier l'image de elwan7):
https://www.dropbox.com/s/rpd5ckq29c00y9i/conky-cool.tar.gz?dl=0
Vous devez éditer le fichier pour y mettre votre interface réseau (wifi ou ethernet ) et le chemin de votre répertoire de base (/home):
Ligne 85 remplacer les » /home/coolhand » par le votre (/home/xxxx)
Ligne 96 ,98 et 102 remplacer le » eno1 » par votre interface wifi ou ethernet(eno1 correspond sans doute à votre eth0 ou wlan2 on tape ifconfig dans un terminal pour avoir la réponse)
.conkyrc
# Conky settings #
#background yes
update_interval 1
cpu_avg_samples 2
net_avg_samples 2
override_utf8_locale yes
double_buffer yes
no_buffers yes
text_buffer_size 2048
#imlib_cache_size 0
temperature_unit fahrenheit
# Window specifications #
own_window yes # On dit à Conky de ne pas se mettre sur le bureau mais dans une fenêtre propre
own_window_type override # type de fenêtre "maison" (le type desktop convient si on n'a pas d'ombre)
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager # définition du type
#own_window_type override
own_window_transparent yes
own_window_hints undecorate,sticky,skip_taskbar,skip_pager,below
border_inner_margin 0
border_outer_margin 0
## This Resolution is set according to the sreen resolution of 1366x768
## Adjust Accoring to yours
minimum_size 900 560
maximum_width 1300
alignment tr
gap_x 15
gap_y 25
# Graphics settings #
draw_shades no
draw_outline no
draw_borders no
draw_graph_borders no
# Text settings #
use_xft yes
xftfont caviar dreams:size=8
xftalpha 0.5
uppercase no
temperature_unit celsius
default_color FFFFFF
# Lua Load #
lua_load ~/.conky/scripts/rings.lua
lua_draw_hook_pre ring_stats
## Adjust these fields according to the your screen size i have modded them for 1366X768
TEXT
${offset 700}${color EAEAEA}${font GE Inspira:pixelsize=120}${time %H:%M}${font}${voffset -84}${voffset 10}${color FFA300}${font GE Inspira:pixelsize=42}${time %d} ${voffset -15}${color EAEAEA}${font GE Inspira:pixelsize=22}${time %B} ${time %Y}${font}${voffset 124}${font GE Inspira:pixelsize=58}${offset -800}${time %A}${font}
${offset 720}${voffset -100}${font Ubuntu:pixelsize=10}${color FFA300}HD ${offset 9}$color${fs_free /} / ${fs_size /}${offset 30}${color FFA300}RAM ${offset 9}$color$mem / $memmax${offset 30}${color FFA300}CPU ${offset 9}$color${cpu cpu0}%
${voffset 10}${offset 270}${color 2c2c2c}${hr 4}
${image ~/.conky/rev-eng.png}
${offset 1010}${voffset 15}${color ffffff}${font Santana:size=8:style=Bold}CPU${voffset 9}
${offset 985}${voffset -5}${color ffffff}${font Santana:size=8:style=Bold}${cpu cpu} %
${offset 935}${voffset 10}${color ffffff}${font Santana:size=8:style=Bold}RAM${voffset 3}
${offset 915}${voffset 0}${color ffffff}${font Santana:size=8:style=Bold}${memperc} %
${offset 130}${voffset 150}${color #FFA300}${font Santana:size=9:style=Bold}root : ${font Santana:size=9:style=Bold}${fs_used /} / ${fs_size /}
${offset 130}${voffset 10}${font Santana:size=9:style=Bold}home : ${font Santana:size=9:style=Bold}${fs_used /home/coolhand} / ${fs_size /home/coolhand}$font
${offset 120}${voffset 12}${color ffffff}${font Santana:size=9:style=Bold}swap: ${font Santana:size=8} ${swap} / ${swapfree}$font
${offset 570}${voffset -110} ${color EAEAEA}Linux ${kernel} kernel
${offset 570}${voffset 5} Uptime :${uptime}
${offset 825}${voffset -80}${color ffffff}${font Santana:size=10:style=Bold} ${exec whoami}@${nodename}
${offset 830}${voffset 0}${font Santana:size=8:style=Bold} CPU RAM Name
${offset 830}${voffset 0}${color #FFA300}${font Santana:size=8} ${top cpu 1} ${top mem 1} ${top name 1}
${offset 830}${voffset 0}${color #F9E101}${font Santana:size=8} ${top cpu 2} ${top mem 2} ${top name 2}
${offset 830}${voffset 0}${color1}${font Santana:size=8} ${top cpu 3} ${top mem 3} ${top name 3}
${offset 830}${voffset 0}${color1}${font Santana:size=8} ${top cpu 4} ${top mem 4} ${top name 4}
${offset 830}${voffset 0}${color1}${font Santana:size=8} ${top cpu 5} ${top mem 5} ${top name 5}
${offset 680}${voffset 110}${color ffffff}${font Santana:size=8} IP Address : ${addr eno1}
${offset 705}${voffset 5}${color ffffff}${font Santana:size=8}IP Public :${texeci 3600 wget http://checkip.dyndns.org -O - -o /dev/null | cut -d : -f 2 | cut -d \< -f 1}
${offset 705}${voffset 5}${color ffffff}${font Santana:size=8}Down :${downspeed eno1} k/s ${offset 8}Up:${upspeed eno1} k/s
${offset 703}${voffset 5}${color ffffff}${font Santana:size=8}TCP Connections: ${tcp_portmon 1 65535 count}
${offset 680}${voffset 5}${color ffffff}${font Santana:size=8}Speed Graph :
${offset 680}${voffset -10}${color ffffff}${font Santana:size=8}${color FF6600}${downspeedgraph eno1 32,150 FF6600 ffffff} ${color FF6600}${upspeedgraph eno1 32,150 FF6600 ffffff}
rings.lua
--[[
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)
]]
settings_table = {
{
name='cpu',
arg='cpu1',
max=100,
bg_colour=0x606060,
bg_alpha=0.6,
fg_colour=0x1e7aa9,
fg_alpha=0.8,
x=1020, y=200,
radius=35,
thickness=5,
start_angle=270,
end_angle=570,
},
{
name='memperc',
arg='',
max=100,
bg_colour=0x606060,
bg_alpha=0.6,
fg_colour=0x1e7aa9,
fg_alpha=0.8,
x=950, y=240,
radius=35,
thickness=5,
start_angle=270,
end_angle=570,
},
{
name='swapperc',
arg='',
max=100,
bg_colour=0x606060,
bg_alpha=0.6,
fg_colour=0x1e7aa9,
fg_alpha=0.8,
x=950, y=240,
radius=28,
thickness=5,
start_angle=270,
end_angle=450,
},
}
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()
if lastValue==nil then lastValue = 0 end
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'] == "hddtemp" then
if str=="N/A" then
value=lastValue
else
value=tonumber(str)
lastValue=value
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)
local updates=conky_parse('${updates}')
update_num=tonumber(updates)
if update_num>5 then
for i in pairs(settings_table) do
setup_rings(cr,settings_table[i])
end
end
end