guest@dotshare [~/groups/info/conky] $ ls conkyrchelena/ | cat

conkyrc_helena (scrot)

darent Dec 07, 2011 (info/conky)

conkyrc(raw, dl)

SCROT

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
# Create own window instead of using desktop (required in nautilus)
own_window yes
#own_window_type override
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
own_window_colour brown
own_window_transparent yes
own_window_argb_visual yes
own_window_hints below

# Use double buffering (reduces flicker, may not work for everyone)
double_buffer yes

# fiddle with window
use_spacer right
use_xft yes

# Update interval in seconds
update_interval 1.0

# Minimum size of text area
minimum_size 1024 5

# Draw shades?
draw_shades yes

# Text stuff
draw_outline no # amplifies text if yes
draw_borders no

uppercase no # set to yes if you want all text to be in uppercase

# Stippled borders?
stippled_borders 0

# border margins
#border_margin 0

# border width
border_width 1

# Default colors and also border colors, grey90 == #e5e5e5
default_color 177082
default_shade_color black
default_outline_color white

# Text alignment, other possible values are commented
alignment top_left
#alignment top_right
#alignment bottom_left
#alignment bottom_right

# Gap between borders of screen and text
gap_x 1024
gap_y 26

# stuff after 'TEXT' will be formatted on screen

override_utf8_locale no
xftfont Terminus:size=8
xftalpha 0.8

#lua_load ~/.conky/ringsfusion.lua
#lua_draw_hook_pre ring_stats


TEXT
${offset 5}${color slate grey}${time %a, } ${color }${time %e %B %G}
${offset 5}${color slate grey}${time %Z, }${color }${time %H:%M:%S}
${offset 5}${color slate grey}UpTime: ${color }$uptime
${offset 5}${color slate grey}Kern:${color }$kernel

${offset 5}${color slate grey}CPU:${color } $cpu% ${acpitemp}C
${offset 5}${cpugraph 20,150 000000 ddaa00}
${offset 5}${color slate grey}Load: ${color }$loadavg
${offset 5}${color slate grey}Processos: ${color }$processes
${offset 5}${color slate grey}Executant-se: ${color }$running_processes

${offset 5}${color slate grey}MEM: ${color } $memperc% $mem/$memmax
${offset 5}${membar 3,150}

${offset 5}${color slate grey}SWAP: ${color }$swapperc% $swap/$swapmax
${offset 5}${swapbar 3,150}

${offset 5}${color slate grey}Percentatge CPU:
${offset 5}${color #ddaa00} ${top name 1}${top_mem cpu 1}
${offset 5}${color lightgrey} ${top name 2}${top cpu 2}
${offset 5}${color lightgrey} ${top name 3}${top cpu 3}
${offset 5}${color lightgrey} ${top name 4}${top cpu 4}
${offset 5}${color lightgrey} ${top name 5}${top cpu 5}

${offset 5}${color slate grey}Percentatge MEM:
${offset 5}${color #ddaa00} ${top_mem name 1}${top_mem mem 1}
${offset 5}${color lightgrey} ${top_mem name 2}${top_mem mem 2}
${offset 5}${color lightgrey} ${top_mem name 3}${top_mem mem 3}
${offset 5}${color lightgrey} ${top_mem name 4}${top_mem mem 4}
${offset 5}${color lightgrey} ${top_mem name 5}${top_mem mem 5}

${offset 5}${color slate grey}ROOT: ${color }${fs_free /}/${fs_size /}
${offset 5}${fs_bar 10,150 /}
${offset 5}${color slate grey}HOME: ${color }${fs_free /home}/${fs_size /home}
${offset 5}${fs_bar 10,150 /home}
${offset 5}${color slate grey}WINDOWS: ${color }${fs_free /media/windows}/${fs_size /media/windows}
${offset 5}${fs_bar 10,150 /media/windows}
#${offset 5}${color slate grey}RECURSOS: ${color }${fs_free /media/recursos}/${fs_size /media/recursos}
#${offset 5}${fs_bar 10,150 /media/recursos}
${offset 5}${color slate grey}XARXA:
${if_up eth1}${offset 5}$color2 local IP : $color4${addr wlan1}
${offset 5}${color}Pujant: ${color }${upspeed wlan1} k/s
${offset 5}${upspeedgraph wlan1 20,150 000000 ddaa00}
${offset 5}${color}Baixant: ${color }${downspeed wlan1}k/s${color}
${offset 5}${downspeedgraph wlan1 20,150 000000 ddaa00}
${voffset 10}${color EAEAEA}${font GE Inspira:pixelsize=65}${time %H:%M}${font}${voffset -84}${offset 10}${color FFA300}${font GE Inspira:pixelsize=42}${time %d} ${voffset -15}${color }${font GE Inspira:pixelsize=22}${time  %B} ${time %Y}${font}${voffset 24}${font GE Inspira:pixelsize=58}${offset -148}${time %A}${font}
#${voffset 1}${offset 12}${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}%

CLICK TO VIEW

x

ringsfusion.lua(raw, dl)

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
--[[
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)
]]

settings_table = {
	{
		-- Edit this table to customise your rings.
		-- You can create more rings simply by adding more elements to settings_table.
		-- Segons"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='%S',
		-- "max" is the maximum value of the ring. If the Conky variable outputs a percentage, use 100.
		max=60,
		-- "bg_colour" is the colour of the base ring.
		bg_colour=0xffffff,
		-- "bg_alpha" is the alpha value of the base ring.
		bg_alpha=0,
		-- "fg_colour" is the colour of the indicator part of the ring.
		fg_colour=0xffffff,
		-- "fg_alpha" is the alpha value of the indicator part of the ring.
		fg_alpha=0.4,
		-- "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=870, y=630,
		-- "radius" is the radius of the ring.
		radius=50,
		-- "thickness" is the thickness of the ring, centred around the radius.
		thickness=5,
		-- "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=0xffffff,
		bg_alpha=0.1,
		fg_colour=0xffffff,
		fg_alpha=0.3,
		x=870, y=630,
		radius=56,
		thickness=5,
		start_angle=0,
		end_angle=360
	},
	{
		name='time',
		arg='%I.%M',
		max=12,
		bg_colour=0xffffff,
		bg_alpha=0.1,
		fg_colour=0xffffff,
		fg_alpha=0.3,
		x=870, y=630,
		radius=62,
		thickness=5,
		start_angle=0,
		end_angle=360
	},
	{
		name='cpu',
		arg='cpu1',
		max=100,
		bg_colour=0xff1800,
		bg_alpha=0.1,
		fg_colour=0xff1800,
		fg_alpha=0.2,
		x=870, y=630,
		radius=70,
		thickness=5,
		start_angle=60,
		end_angle=120
	},
	{
		name='cpu',
		arg='cpu2',
		max=100,
		bg_colour=0xff1800,
		bg_alpha=0.1,
		fg_colour=0xff1800,
		fg_alpha=0.2,
		x=870, y=630,
		radius=76,
		thickness=5,
		start_angle=60,
		end_angle=120
	},
	{
		name='cpu',
		arg='cpu0',
		max=100,
		bg_colour=0xff1800,
		bg_alpha=0.1,
		fg_colour=0xff1800,
		fg_alpha=0.4,
		x=870, y=630,
		radius=84.5,
		thickness=10,
		start_angle=60,
		end_angle=120
	},
	{
		name='wireless_link_qual_perc',
		arg='ath0',
		max=100,
		bg_colour=0x00ff2c,
		bg_alpha=0.1,
		fg_colour=0x00ff2c,
		fg_alpha=0.3,
		x=870, y=630,
		radius=72,
		thickness=11,
		start_angle=122,
		end_angle=210
	},
	{
		name='memperc',
		arg='',
		max=100,
		bg_colour=0xfefe00,
		bg_alpha=0.1,
		fg_colour=0xfefe00,
		fg_alpha=0.3,
		x=870, y=630,
		radius=83.5,
		thickness=8,
		start_angle=122,
		end_angle=210
	},
	{
		name='time',
		arg='%d',
		max=31,
		bg_colour=0xffffff,
		bg_alpha=0.1,
		fg_colour=0xffffff,
		fg_alpha=0.3,
		x=870, y=630,
		radius=70,
		thickness=5,
		start_angle=212,
		end_angle=360
	},
	{
		name='time',
		arg='%m',
		max=12,
		bg_colour=0xffffff,
		bg_alpha=0.1,
		fg_colour=0xffffff,
		fg_alpha=0.3,
		x=870, y=630,
		radius=76,
		thickness=5,
		start_angle=212,
		end_angle=360
	},
	{
		name='fs_used_perc',
		arg='/',
		max=100,
		bg_colour=0x95edfe,
		bg_alpha=0.1,
		fg_colour=0x177082,
		fg_alpha=0.3,
		x=870, y=630,
		radius=112,
		thickness=10,
		start_angle=-120,
		end_angle=120
	},
	--{
		--name='fs_used_perc',
		--arg='/media/recursos/',
		--max=100,
		--bg_colour=0x95edfe,
		--bg_alpha=0.1,
		--fg_colour=0x95edfe,
		--fg_alpha=0.3,
		--x=870, y=630,
		--radius=102,
		--thickness=5,
		--start_angle=-120,
		--end_angle=120
	--},
	{
		name='fs_used_perc',
		arg='/media/windows/',
		max=100,
		bg_colour=0x95edfe,
		bg_alpha=0.1,
		fg_colour=0x177082,
		fg_alpha=0.3,
		x=870, y=630,
		radius=98,
		thickness=10,
		start_angle=-120,
		end_angle=-1
	},
		{
		name='fs_used_perc',
		arg='/media/recursos/',
		max=100,
		bg_colour=0x95edfe,
		bg_alpha=0.1,
		fg_colour=0x177082,
		fg_alpha=0.3,
		x=870, y=630,
		radius=98,
		thickness=10,
		start_angle=1,
		end_angle=120
	},
	{
		name='fs_used_perc',
		arg='/home/darent/',
		max=100,
		bg_colour=0x95edfe,
		bg_alpha=0.1,
		fg_colour=0x177082,
		fg_alpha=0.3,
		x=870, y=630,
		radius=135,
		thickness=30,
		start_angle=-120,
		end_angle=120
	},
}

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
			setup_rings(cr,settings_table[i])
		end
	end
end
 

x

Notes

Also needs lua script and GE_Inspira_Regular.ttf font installed in .local/share/fonts/ or /usr/share/fonts/

You’ll need to edit the disk space info to adapt it to your setup (mine is sda1 sda2 and sda4). Also, edit the network info depending on your network interface (wlan in my case, may be eth or ath in yours).

Wish it helps.