Initial commit after creation.

This commit is contained in:
Cyteen May 2020-02-25 11:39:22 +00:00
commit 213d7672ce
28 changed files with 656 additions and 0 deletions

37
configs/conky_bg Normal file
View File

@ -0,0 +1,37 @@
conky.config = {
-- ------------------------- Windows Settings
own_window = true,
own_window_type = 'normal',
own_window_transparent = false,
own_window_hints = 'undecorated,sticky,below,skip_taskbar,skip_pager',
own_window_argb_visual = true,
own_window_argb_value = 190,
double_buffer = true,
background = true,
-- ------------------------- Position
alignment = 'bottom_right',
minimum_height = 165,
minimum_width = 1125,
gap_x = 0,
gap_y = 50,
border_inner_margin = 0,
border_outer_margin = 0,
-- ------------------------- Font
draw_shades = false,
draw_outline = false,
draw_borders = false,
-- ------------------------- Other
update_interval = 36000,
};
conky.text = [[
${image ~/.conky/conky-xanimos/img/bg.png}
]];

45
configs/conky_clock Normal file
View File

@ -0,0 +1,45 @@
conky.config = {
-- ------------------------- Windows Settings
own_window = true,
own_window_type = 'normal',
own_window_transparent = false,
own_window_hints = 'undecorated,sticky,below,skip_taskbar,skip_pager',
own_window_argb_visual = true,
own_window_argb_value = 0,
double_buffer = true,
background = true,
-- ------------------------- Position
alignment = 'bottom_right',
minimum_width = 550,
minimum_height = 100,
maximum_width = 550,
gap_x = 5,
gap_y = 225,
-- ------------------------- Font
use_xft = true,
xftalpha = 0.1,
override_utf8_locale = true,
draw_borders = false,
draw_outline = false,
draw_shades = false,
-- ------------------------- Color
default_color = 'DCDCDC',
color0 = '24D9D9',
color1 = 'DDDDDD',
color2 = 'AAAAAA',
color3 = '888888',
-- ------------------------- Other
update_interval = 1,
};
conky.text = [[
${color}${font GE Inspira:pixelsize=90}${time %H:%M}${font}${voffset -70}${offset 100}${color0}${font GE Inspira:pixelsize=42}${time %d} ${voffset -0}${color}${font GE Inspira:pixelsize=30}${time %B} ${time %Y}${font}${voffset 18}${font GE Inspira:pixelsize=42}${offset -212}${time %A}${font}
]];

62
configs/conky_cpu Normal file
View File

@ -0,0 +1,62 @@
conky.config = {
-- ------------------------- Windows Settings
own_window = true,
own_window_type = 'normal',
own_window_transparent = false,
own_window_hints = 'undecorated,sticky,below,skip_taskbar,skip_pager',
own_window_argb_visual = true,
own_window_argb_value = 0,
double_buffer = true,
background = true,
-- ------------------------- Position
alignment = 'bottom_right',
minimum_width = 235,
minimum_height = 165,
maximum_width = 235,
gap_x = 430,
gap_y = 50,
-- ------------------------- Font
use_xft = true,
xftalpha = 0.8,
override_utf8_locale = true,
draw_shades = false,
draw_borders = false,
draw_outline = false,
draw_graph_borders = false,
font = 'Monofur:bold:size=8',
-- ------------------------- Color
default_color = 'DCDCDC',
color0 = '24D9D9',
color1 = 'CCCCCC',
color2 = 'AAAAAA',
color3 = '888888',
-- ------------------------- OTHER
update_interval = 1,
top_cpu_separate = false,
cpu_avg_samples = 2,
template0 = [[${GOTO 50}${color\1}${top name \2}${alignr}${top cpu \2}%]],
};
conky.text = [[
${voffset 8}${GOTO 50}${font Monofur:bold:size=12}CPU${font}
${voffset 10}${GOTO 50}${font}Avg use: ${font Monofur:size=8}${color1}${cpu cpu0}%${alignr}${color}${font}Freq: ${font Monofur:size=8}${color1}${freq_g} Ghz${color}
${color}${font Monofur:bold:size=8}${GOTO 50}Core:${GOTO 90}1${offset 6}${color1}${font Monofur:size=6}${voffset -1}${cpu cpu0}%${voffset -1}${color}${font}${GOTO 127}2${offset 6}${color1}${font Monofur:size=6}${voffset -1}${cpu cpu1}%
${GOTO 50}${cpugraph cpu0 15,185 0EA794 0EA794}
${GOTO 50}${cpugraph cpu1 15,185 0EA794 0EA794}
${template0 0 1}
${template0 1 2}
${template0 2 3}
${template0 3 4}
${image ~/.conky/conky-xanimos/img/cpu.png -p 0,5}
]];

52
configs/conky_files Normal file
View File

@ -0,0 +1,52 @@
conky.config = {
-- ------------------------- Windows Settings
own_window = true,
own_window_type = 'normal',
own_window_transparent = false,
own_window_hints = 'undecorated,sticky,below,skip_taskbar,skip_pager',
own_window_argb_visual = true,
own_window_argb_value = 0,
double_buffer = true,
background = true,
-- ------------------------- Position
alignment = 'bottom_right',
minimum_width = 255,
minimum_height = 165,
maximum_width = 255,
gap_x = 870,
gap_y = 50,
-- ------------------------- Font
use_xft = true,
xftalpha = 0.8,
override_utf8_locale = true,
draw_shades = false,
default_shade_color = 'black',
draw_borders = false,
draw_outline = false,
font = 'Monofur:bold:size=8',
-- ------------------------- Color
default_color = 'DCDCDC',
color0 = '24D9D9',
--------------------------- OTHER
update_interval = 1,
lua_load = '~/.conky/conky-xanimos/lua/files_ring.lua',
lua_draw_hook_pre = 'main',
};
conky.text = [[
${voffset 8}${GOTO 50}${font Monofur:bold:size=12}File System${font}
${voffset 10}${GOTO 50}${font}Read: ${font Monofur:size=8}${diskio_read}${GOTO 160}${font}Write: ${font Monofur:size=8}${diskio_write}
${voffset 45}${GOTO 80}${font}/: ${color0}${font Monofur:size=8}${fs_used /}${color} | ${font Monofur:size=8}${fs_size /}
${voffset 5}${GOTO 60}${font}/home: ${color0}${font Monofur:size=8}${fs_used /home}${color} | ${font Monofur:size=8}${fs_size /home}
${image ~/.conky/conky-xanimos/img/files.png -p 0,5}
]];

60
configs/conky_network Normal file
View File

@ -0,0 +1,60 @@
conky.config = {
-- ------------------------- Windows Settings
own_window = true,
own_window_type = 'normal',
own_window_transparent = false,
own_window_hints = 'undecorated,sticky,below,skip_taskbar,skip_pager',
own_window_argb_visual = true,
own_window_argb_value = 0,
double_buffer = true,
-- ------------------------- Position
alignment = 'bottom_right',
minimum_width = 210,
minimum_height = 165,
maximum_width = 210,
gap_x = 5,
gap_y = 50,
-- ------------------------- Font
use_xft = true,
xftalpha = 0.8,
override_utf8_locale = true,
draw_shades = false,
draw_borders = false,
draw_outline = false,
draw_graph_borders = false,
font = 'Monofur:bold:size=8',
-- ------------------------- Color
default_color = 'DCDCDC',
color0 = '24D9D9',
-- ------------------------- OTHER
update_interval = 1,
};
conky.text = [[
${voffset -18}${if_existing /proc/net/route eth0}${voffset 25}${GOTO 50}${font Monofur:bold:size=12}Network
${GOTO 50}${font}Public: ${color0}${font Monofur:size=8}${texeci 36000 wget -qO - http://ipecho.net/plain | tail}${color}
${voffset 5}${GOTO 50}${font}Local: ${color0}${font Monofur:size=8}${addrs eth0}${color}
${voffset 5}${GOTO 20}${upspeedgraph eth0 15,170 0EA794 DCDCDC}
${voffset 5}${GOTO 20}${downspeedgraph eth0 15,170 0EA794 DCDCDC}
${voffset 28}${GOTO 12}${font}Receive: ${font Monofur:size=8}${downspeed eth0}${GOTO 120}${font}Send: ${font Monofur:size=8}${upspeed eth0}
${image ~/.conky/conky-xanimos/img/networkhigh.png -p 0,5}${else}${if_existing /proc/net/route wlan0}${voffset 8}${GOTO 50}${font Monofur:bold:size=18}Network${font}
${GOTO 50}${font}Public: ${color0}${font Monofur:size=8}${texeci 36000 wget -qO - http://ipecho.net/plain | tail}${color}
${voffset 5}${GOTO 50}${font}Local: ${color0}${font Monofur:size=8}${addrs wlan0}${color}
${voffset 5}${GOTO 50}${font}Up: ${font Monofur:size=8}${upspeed wlan0}
${voffset 0}${GOTO 50}${upspeedgraph eth0 15,150 0EA794 0EA794 5000}
${voffset 2}${GOTO 50}${font}Down: ${font Monofur:size=8}${downspeed wlan}
${voffset 0}${GOTO 50}${downspeedgraph wlan0 15,150 0EA794 0EA794 10000}
${if_match "${wireless_link_qual_perc wlan0}"<"33"}${image ~/.conky/conky-xanimos/img/networklow.png -p 0,5 -s 45x45}${else}${if_match "${wireless_link_qual_perc wlan0}"<"66"}${image ~/.conky/conky-xanimos/img/networkmid.png -p 0,5}${else}${image ~/.conky/conky-xanimos/img/networkhigh.png -p 0,5}${endif}${endif}${else}${voffset 27}${GOTO 50}${font}Network
${GOTO 50}${font}No connection
${image ~/.conky/conky-xanimos/img/nonetwork.png -p 0,5}${endif}${endif}
]];

59
configs/conky_ram Normal file
View File

@ -0,0 +1,59 @@
conky.config = {
-- ------------------------- Windows Settings
own_window = true,
own_window_type = 'normal',
own_window_transparent = false,
own_window_hints = 'undecorated,sticky,below,skip_taskbar,skip_pager',
own_window_argb_visual = true,
own_window_argb_value = 0,
double_buffer = true,
background = true,
-- ------------------------- Position
alignment = 'bottom_right',
minimum_width = 205,
minimum_height = 165,
maximum_width = 205,
gap_x = 220,
gap_y = 50,
-- ------------------------- Font
use_xft = true,
xftalpha = 0.8,
override_utf8_locale = true,
draw_shades = false,
--default_shade_color = 'black',
draw_borders = false,
draw_outline = false,
font = 'Monofur:bold:size=8',
-- ------------------------ Colors
default_color = 'DCDCDC',
color0 = '24D9D9',
color1 = 'DDDDDD',
color2 = 'AAAAAA',
color3 = '888888',
-- ------------------------- Other
update_interval = 5,
template0 = [[${GOTO 50}${color\1}${top_mem name \2}${alignr}${top_mem mem \2}%]],
no_buffers = true,
};
conky.text = [[
${voffset 8}${GOTO 50}${font Monofur:bold:size=12}RAM${font}
${voffset 10}${GOTO 50}${font}Usage: ${font Monofur:size=8}${memperc}%${alignr}${font}${mem}
${voffset 27}${font Monofur:size=8}${template0 0 1}
${template0 1 2}
${template0 2 3}
${template0 3 4}
${template0 3 5}
${image ~/.conky/conky-xanimos/img/ram.png -p 0,0}
]];

69
configs/conky_system Normal file
View File

@ -0,0 +1,69 @@
conky.config = {
-- ------------------------- Windows Settings
own_window = true,
own_window_type = 'normal',
own_window_transparent = false,
own_window_hints = 'undecorated,sticky,below,skip_taskbar,skip_pager',
own_window_argb_visual = true,
own_window_argb_value = 0,
double_buffer = true,
background = true,
-- ------------------------- Position
alignment = 'bottom_right',
minimum_width = 215,
minimum_height = 165,
maximum_width = 215,
gap_x = 670,
gap_y = 50,
-- ------------------------- Font
use_xft = true,
xftalpha = 0.8,
override_utf8_locale = true,
draw_shades = false,
--default_shade_color = 'black',
draw_borders = false,
draw_outline = false,
font = 'Monofur:bold:size=8',
times_in_seconds = true,
-- ------------------------ Colors
default_color = 'DCDCDC',
color0 = '24D9D9',
color1 = 'CCCCCC',
--green
color2 = '24D912',
--yellow
color3 = 'D9BC12',
--red
color4 = 'F9120A',
-- ------------------------- Templates
template0 = [[${if_match \1 \2<=\4}\3${else}${if_match \1 \2<=\6}\5${else}${if_match \1 \2>\6}\7${endif}${endif}${endif}]],
template1 = [[${template0 ${battery_percent BAT0} $color4 10 $color3 25 $color0}]],
-- ------------------------- Other
update_interval = 1,
};
conky.text = [[
${voffset 8}${GOTO 50}${font Monofur:bold:size=12}System${font}
${voffset 18}${GOTO 50}${font}Uptime: ${font}${color1}${font Monofur:size=8}${format_time $uptime_short "\hh \mm"}${color}
${voffset 10}${GOTO 50}${font}Battery: ${font Monofur:size=8}${color1}${if_match "${acpiacadapter ACAD}"!="off-line"}${image ~/.conky/conky-xanimos/img/units/timeleft.png -p 162,64 -s 18x18}Charging${alignr}(${template1}${battery_percent BAT0}%${color})${else}${image ~/.conky/conky-xanimos/img/units/timeleft.png -p 145,64 -s 18x18}${if_match ${battery_percent BAT0}<=10}${color4}${blink ${battery_percent BAT0}%}${else}${battery_percent BAT0}%${endif}${color}${if_empty ${battery_time BAT0}}${else}${alignr}(${template1}${format_time ${battery_time BAT0} "\hh \mm"}${color})${endif}${endif}
${voffset 10}${font Monofur:size=8}${GOTO 50}${font}Processes: ${font Monofur:size=8}${color1}${processes}${color}
${voffset 10}${GOTO 50}${font}Threads: ${font Monofur:size=8}${color1}${running_threads}${color}
${voffset 10}${GOTO 50}${font}Connections: ${font Monofur:size=8}${color1}${tcp_portmon 1 65535 count}${color}
${image ~/.conky/conky-xanimos/img/system.png -p 0,0}${image ~/.conky/conky-xanimos/img/units/uptime.png -p 19,42 -s 16x16}${image ~/.conky/conky-xanimos/img/units/batt.png -p 18,62 -s 20x20}${image ~/.conky/conky-xanimos/img/units/processes.png -p 18,86 -s 20x20}${image ~/.conky/conky-xanimos/img/units/freq.png -p 18,109 -s 20x20}${image ~/.conky/conky-xanimos/img/units/connections.png -p 19,133 -s 18x18}]];
conky.text22 = [[
${GOTO 50}${font}GPU: ${font Monofur:size=8}${nvidia temp}°C | ${font Monofur:size=8}${nvidia gpufreq}Mhz | ${execi 5 nvidia-settings -q [gpu:0]/UsedDedicatedGPUMemory -t}MiB
]];

42
configs/conky_txt Normal file
View File

@ -0,0 +1,42 @@
conky.config = {
-- ------------------------- Windows Settings
own_window = true,
own_window_type = 'normal',
own_window_transparent = false,
own_window_hints = 'undecorated,sticky,below,skip_taskbar,skip_pager',
own_window_argb_visual = true,
own_window_argb_value = 0,
double_buffer = true,
background = true,
-- ------------------------- Position
alignment = 'bottom_right',
minimum_width = 100,
minimum_height = 30,
gap_x = 45,
gap_y = 10,
-- ------------------------- Font
use_xft = true,
xftalpha = 0.1,
override_utf8_locale = true,
draw_borders = false,
draw_outline = false,
draw_shades = false,
-- ------------------------- Color
default_color = 'DCDCDC',
color0 = '24D9D9',
color4 = '4D4D4D',
-- ------------------------- Other
update_interval = 36000,
};
conky.text = [[
${font GE Inspira:bold:pixelsize=30}${color}Linux ${color0}Mint${color}.
]];

12
conky_start.sh Executable file
View File

@ -0,0 +1,12 @@
#!/bin/bash
killall conky
#conky -c ~/.conky/conky-xanimos/configs/conky_bg &
#conky -c ~/.conky/conky-xanimos/configs/conky_clock &
#conky -c ~/.conky/conky-xanimos/configs/conky_txt &
conky -p 3 -c ~/.conky/conky-xanimos/configs/conky_files &
conky -p 6 -c ~/.conky/conky-xanimos/configs/conky_system &
conky -p 5 -c ~/.conky/conky-xanimos/configs/conky_cpu &
conky -p 7 -c ~/.conky/conky-xanimos/configs/conky_ram
conky -p 4 -c ~/.conky/conky-xanimos/configs/conky_network &
exit

BIN
img/bg.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 69 KiB

BIN
img/bg2.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 69 KiB

BIN
img/cpu.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

BIN
img/files.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

BIN
img/networkhigh.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

BIN
img/networklow.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

BIN
img/networkmid.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

BIN
img/nonetwork.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

BIN
img/ram.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

BIN
img/system.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

BIN
img/units/batt.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

BIN
img/units/connections.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

BIN
img/units/freq.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

BIN
img/units/hdd.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

BIN
img/units/proc.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

BIN
img/units/processes.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

BIN
img/units/timeleft.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

BIN
img/units/uptime.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

218
lua/files_ring.lua Normal file
View File

@ -0,0 +1,218 @@
--==============================================================================
-- seamod_rings.lua
--
-- Date : 05/02/2012
-- Author : SeaJey
-- Version : v0.1
-- License : Distributed under the terms of GNU GPL version 2 or later
--
-- This version is a modification of lunatico_rings.lua wich is modification of conky_orange.lua
--
-- conky_orange.lua: http://gnome-look.org/content/show.php?content=137503&forumpage=0
-- lunatico_rings.lua: http://gnome-look.org/content/show.php?content=142884
--==============================================================================
require 'cairo'
--------------------------------------------------------------------------------
-- gauge DATA
gauge = {
{
name='fs_used_perc', arg='/', max_value=100,
x=135, y=180,
graph_radius=110,
graph_thickness=5,
graph_start_angle=-60,
graph_unit_angle=1.2, graph_unit_thickness=2.7,
graph_bg_colour=0xffffff, graph_bg_alpha=0.1,
graph_fg_colour=0xFFFFFF, graph_fg_alpha=0.3,
hand_fg_colour=0x1793d0, hand_fg_alpha=1.0,
txt_radius=120,
txt_weight=0, txt_size=0,
txt_fg_colour=0x1793d0, txt_fg_alpha=1.0,
graduation_radius=28,
graduation_thickness=0, graduation_mark_thickness=1,
graduation_unit_angle=27,
graduation_fg_colour=0xFFFFFF, graduation_fg_alpha=0.3,
caption='',
caption_weight=1, caption_size=9.0,
caption_fg_colour=0xFFFFFF, caption_fg_alpha=0.3,
},
{
name='fs_used_perc', arg='/home', max_value=100,
x=135, y=180,
graph_radius=110,
graph_thickness=5,
graph_start_angle=-60,
graph_unit_angle=1.2, graph_unit_thickness=2.7,
graph_bg_colour=0xffffff, graph_bg_alpha=0.1,
graph_fg_colour=0xFFFFFF, graph_fg_alpha=0.3,
hand_fg_colour=0x1793d0, hand_fg_alpha=0.7,
txt_radius=135,
txt_weight=0, txt_size=0,
txt_fg_colour=0x1793d0, txt_fg_alpha=0.7,
graduation_radius=28,
graduation_thickness=0, graduation_mark_thickness=1,
graduation_unit_angle=27,
graduation_fg_colour=0xFFFFFF, graduation_fg_alpha=0.3,
caption='',
caption_weight=1, caption_size=9.0,
caption_fg_colour=0xFFFFFF, caption_fg_alpha=0.3,
},
}
-------------------------------------------------------------------------------
-- rgb_to_r_g_b
-- converts color in hexa to decimal
--
function rgb_to_r_g_b(colour, alpha)
return ((colour / 0x10000) % 0x100) / 255., ((colour / 0x100) % 0x100) / 255., (colour % 0x100) / 255., alpha
end
-------------------------------------------------------------------------------
-- angle_to_position
-- convert degree to rad and rotate (0 degree is top/north)
--
function angle_to_position(start_angle, current_angle)
local pos = current_angle + start_angle
return ( ( pos * (2 * math.pi / 360) ) - (math.pi / 2) )
end
-------------------------------------------------------------------------------
-- draw_gauge_ring
-- displays gauges
--
function draw_gauge_ring(display, data, value)
local max_value = data['max_value']
local x, y = data['x'], data['y']
local graph_radius = data['graph_radius']
local graph_thickness, graph_unit_thickness = data['graph_thickness'], data['graph_unit_thickness']
local graph_start_angle = data['graph_start_angle']
local graph_unit_angle = data['graph_unit_angle']
local graph_bg_colour, graph_bg_alpha = data['graph_bg_colour'], data['graph_bg_alpha']
local graph_fg_colour, graph_fg_alpha = data['graph_fg_colour'], data['graph_fg_alpha']
local hand_fg_colour, hand_fg_alpha = data['hand_fg_colour'], data['hand_fg_alpha']
local graph_end_angle = (max_value * graph_unit_angle) % 360
-- background ring
cairo_arc(display, x, y, graph_radius, angle_to_position(graph_start_angle, 0), angle_to_position(graph_start_angle, graph_end_angle))
cairo_set_source_rgba(display, rgb_to_r_g_b(graph_bg_colour, graph_bg_alpha))
cairo_set_line_width(display, graph_thickness)
cairo_stroke(display)
-- arc of value
local val = value % (max_value + 1)
local start_arc = 0
local stop_arc = 0
local i = 1
while i <= val do
start_arc = (graph_unit_angle * i) - graph_unit_thickness
stop_arc = (graph_unit_angle * i)
cairo_arc(display, x, y, graph_radius, angle_to_position(graph_start_angle, start_arc), angle_to_position(graph_start_angle, stop_arc))
cairo_set_source_rgba(display, rgb_to_r_g_b(graph_fg_colour, graph_fg_alpha))
cairo_stroke(display)
i = i + 1
end
local angle = start_arc
-- hand
start_arc = (graph_unit_angle * val) - (graph_unit_thickness * 2)
stop_arc = (graph_unit_angle * val)
cairo_arc(display, x, y, graph_radius, angle_to_position(graph_start_angle, start_arc), angle_to_position(graph_start_angle, stop_arc))
cairo_set_source_rgba(display, rgb_to_r_g_b(hand_fg_colour, hand_fg_alpha))
cairo_stroke(display)
-- graduations marks
local graduation_radius = data['graduation_radius']
local graduation_thickness, graduation_mark_thickness = data['graduation_thickness'], data['graduation_mark_thickness']
local graduation_unit_angle = data['graduation_unit_angle']
local graduation_fg_colour, graduation_fg_alpha = data['graduation_fg_colour'], data['graduation_fg_alpha']
if graduation_radius > 0 and graduation_thickness > 0 and graduation_unit_angle > 0 then
local nb_graduation = graph_end_angle / graduation_unit_angle
local i = 0
while i < nb_graduation do
cairo_set_line_width(display, graduation_thickness)
start_arc = (graduation_unit_angle * i) - (graduation_mark_thickness / 2)
stop_arc = (graduation_unit_angle * i) + (graduation_mark_thickness / 2)
cairo_arc(display, x, y, graduation_radius, angle_to_position(graph_start_angle, start_arc), angle_to_position(graph_start_angle, stop_arc))
cairo_set_source_rgba(display,rgb_to_r_g_b(graduation_fg_colour,graduation_fg_alpha))
cairo_stroke(display)
cairo_set_line_width(display, graph_thickness)
i = i + 1
end
end
-- text
local txt_radius = data['txt_radius']
local txt_weight, txt_size = data['txt_weight'], data['txt_size']
local txt_fg_colour, txt_fg_alpha = data['txt_fg_colour'], data['txt_fg_alpha']
local movex = txt_radius * math.cos(angle_to_position(graph_start_angle, angle))
local movey = txt_radius * math.sin(angle_to_position(graph_start_angle, angle))
cairo_select_font_face (display, "ubuntu", CAIRO_FONT_SLANT_NORMAL, txt_weight)
cairo_set_font_size (display, txt_size)
cairo_set_source_rgba (display, rgb_to_r_g_b(txt_fg_colour, txt_fg_alpha))
cairo_move_to (display, x + movex - (txt_size / 2), y + movey + 3)
cairo_show_text (display, value)
cairo_stroke (display)
-- caption
local caption = data['caption']
local caption_weight, caption_size = data['caption_weight'], data['caption_size']
local caption_fg_colour, caption_fg_alpha = data['caption_fg_colour'], data['caption_fg_alpha']
local tox = graph_radius * (math.cos((graph_start_angle * 2 * math.pi / 360)-(math.pi/2)))
local toy = graph_radius * (math.sin((graph_start_angle * 2 * math.pi / 360)-(math.pi/2)))
cairo_select_font_face (display, "ubuntu", CAIRO_FONT_SLANT_NORMAL, caption_weight);
cairo_set_font_size (display, caption_size)
cairo_set_source_rgba (display, rgb_to_r_g_b(caption_fg_colour, caption_fg_alpha))
cairo_move_to (display, x + tox + 5, y + toy + 1)
-- bad hack but not enough time !
if graph_start_angle < 105 then
cairo_move_to (display, x + tox - 30, y + toy + 1)
end
cairo_show_text (display, caption)
cairo_stroke (display)
end
-------------------------------------------------------------------------------
-- go_gauge_rings
-- loads data and displays gauges
--
function go_gauge_rings(display)
local function load_gauge_rings(display, data)
local str, value = '', 0
str = string.format('${%s %s}',data['name'], data['arg'])
str = conky_parse(str)
value = tonumber(str)
draw_gauge_ring(display, data, value)
end
for i in pairs(gauge) do
load_gauge_rings(display, gauge[i])
end
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_gauge_rings(display)
end
cairo_surface_destroy(cs)
cairo_destroy(display)
end