SEARCH

Enter your search query in the box above ^, or use the forum search tool.

You are not logged in.

#4801 2013-02-23 19:39:39

Sector11
77345 ¡#
From: SR11 Cockpit
Registered: 2010-05-05
Posts: 12,802
Website

Re: The New Monster Conky Thread

Dobbie03 wrote:

@Sector11, it does more than help. Wow, thanks so much for the tips.  I was in full on "hope this works" mode when I made this conky and I don't know how many other conky configs I had to borrow little parts from.  Thanks for the help!

Not a problem, it's something I enjoy doing.

BTW, once you turn on a font

${font some_name:size=11}

it's set for as many lines of code as there is until until you change it

${font some_other_name:size=11}

or turn it off

${font}

at which time the default font is activated.

Online

Be excellent to each other!

#4802 2013-02-23 19:44:14

Dobbie03
Resident Metaller
From: New Zealand
Registered: 2009-08-15
Posts: 1,575

Re: The New Monster Conky Thread

Sector11 wrote:
Dobbie03 wrote:

@Sector11, it does more than help. Wow, thanks so much for the tips.  I was in full on "hope this works" mode when I made this conky and I don't know how many other conky configs I had to borrow little parts from.  Thanks for the help!

Not a problem, it's something I enjoy doing.

BTW, once you turn on a font

${font some_name:size=11}

it's set for as many lines of code as there is until until you change it

${font some_other_name:size=11}

or turn it off

${font}

at which time the default font is activated.

Thanks I will keep that in mind for next time big_smile

Offline

#4803 2013-02-23 19:47:28

Sector11
77345 ¡#
From: SR11 Cockpit
Registered: 2010-05-05
Posts: 12,802
Website

Re: The New Monster Conky Thread

@ ichase

Thank you for this.  Like I said over on Teo's thread try adding:

# Force UTF8? requires XFT ###
override_utf8_locale yes

TEXT

that should fix the problem.

I'm not guaranteeing it but it has worked in the past and it's been in ALL my conkys almost from day one.  If I'm not mistaken it's because of that same problem.

I'll get back you you later tonight or tomorrow with a link.

Online

#4804 2013-02-23 19:49:11

Sector11
77345 ¡#
From: SR11 Cockpit
Registered: 2010-05-05
Posts: 12,802
Website

Re: The New Monster Conky Thread

sevensage wrote:

Sector11, wow!  I'll be reading that 2 or 3 more times. Thank-you!

You're welcome
big_smile  I hope it helps...

Online

#4805 2013-02-23 20:47:46

ansem_of_nexus
#! CrunchBanger
Registered: 2012-09-19
Posts: 234

Re: The New Monster Conky Thread

I have an interesting question. Is it possible to make a conky or lua script aware of another. I mean if conky A is running or not running, conky B will know and change a value/string accordingly to show that status?


You can find my work here

Make everything ok button

Offline

#4806 2013-02-23 21:03:56

ichase
#! CrunchBanger
Registered: 2011-03-16
Posts: 137

Re: The New Monster Conky Thread

Sector11 wrote:

@ ichase

Thank you for this.  Like I said over on Teo's thread try adding:

# Force UTF8? requires XFT ###
override_utf8_locale yes

TEXT

that should fix the problem.

I'm not guaranteeing it but it has worked in the past and it's been in ALL my conkys almost from day one.  If I'm not mistaken it's because of that same problem.

I'll get back you you later tonight or tomorrow with a link.

Sector 11 Thank you very much, that fixed it  big_smile I knew it had to be something very simple and changing a simple no to yes is pretty darn simple.  big_smile

Thanks again

Ian

Offline

#4807 2013-02-23 22:57:01

Sector11
77345 ¡#
From: SR11 Cockpit
Registered: 2010-05-05
Posts: 12,802
Website

Re: The New Monster Conky Thread

@ ansem_of_nexus

bash script, maybe?

I'm not up on those but GrouchyGaijin wrote a script that can KFC (Kentucky Fried Conky) a specific conky to maybe something along those lines:

#!/bin/bash
## Original idea by: GrouchyGaijin
## This idea by: Stinkeye - Jan 2013
## With another tweak by: arclance
## Final tweak by: Sector11
## click to start, click to stop

##if pgrep -f "conky -c ~/Conky/S11_v9.conkyrc"
##then
##	pkill -xf "conky -c ~/Conky/S11_v9.conkyrc"
##else
##	gnome-terminal -e "conky -c ~/Conky/S11_v9.conkyrc"
##fi

## not running in a terminal
## remove: gnome-terminal -e

if pgrep -f "conky -c $1"
then
	pkill -xf "conky -c $1"
else
	conky -c "$1"
fi

if that can "determine" what conky to kill and restart maybe it can be modified.

${if_running 'if pgrep -f "conky -c ~/Conky/A"'}do this${else}do this one${endif}

... just a thought ...

@ ichase

I was pretty certain that was it, but didn't want to write it in stone.  big_smile
getting out my hammer and chisel now ...

Just got back now to continue that other thing.

Online

#4808 2013-02-24 14:46:00

nomad
Member
Registered: 2012-08-16
Posts: 10
Website

Re: The New Monster Conky Thread

background yes
    use_xft yes
    Terminus:bold:size=8
    xftalpha 1
    update_interval 1.0
    total_run_times 0
    own_window yes
    own_window_transparent yes
    own_window_type desktop
    own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
    double_buffer yes
    minimum_size 200 200
    maximum_width 265
    draw_shades yes
    draw_outline no
    draw_borders no
    draw_graph_borders yes
    default_color white
    default_shade_color black
    default_outline_color white
    alignment top_right
    gap_x 2
    gap_y 2
    no_buffers yes
    uppercase no
    cpu_avg_samples 2
    override_utf8_locale no


    TEXT
    ${font Terminus:bold:size=7}SYSTEM ZERO${hr 1}
    ${font Terminus:normal:size=7}${exec echo '#!'}$sysname$kernel$alignr$machine
    Host:$alignr${exec hostname}
    Uptime:$alignr$uptime
    File System: $alignr${fs_type}
    EST:$alignr${time %H:%M:%S}
    Day:$alignr${time %A %m.%d.%y}
    Battery:$alignr${battery_percent}%${battery_bar 3,95}

    ${font Terminus:bold:size=7}PROCESSORS ${hr 1}
    ${font Terminus:normal:size=6}Temp:${alignr}${acpitemp}C
    CPU1: $alignr${cpu cpu1}% ${cpubar cpu1 3,95}
    CPU2: $alignr${cpu cpu2}% ${cpubar cpu2 3,95}
    CPU3: $alignr${cpu cpu3}% ${cpubar cpu3 3,95}
    CPU4: $alignr${cpu cpu4}% ${cpubar cpu4 3,95}
   
    ${font Terminus:bold:size=7}MEMORY${hr 1}
    ${font Terminus:normal:size=7}RAM:$alignr $mem/$memmax ${membar 3,95}
    ${font Terminus:bold:size=8}SYS:$alignr${fs_used /}/${fs_size /} #${fs_bar 3,95}
    ${font Terminus:bold:size=8}HOME:$alignr${fs_used /home/nomad}/${fs_size /home/nomad} #${fs_bar 3,95}
    ${font Terminus:bold:size=7}LOADS${hr 1}
    ${font Terminus:normal:size=7}${top_mem name 1}${alignr}${top mem 1} %
    ${top_mem name 2}${alignr}${top mem 2} %
    ${top_mem name 3}${alignr}${top mem 3} %
    ${top_mem name 4}${alignr}${top mem 4} %
    ${top_mem name 5}${alignr}${top mem 5} %
    #{top_mem name 6}${alignr}${top mem 6} %
    #{top_mem name 7}${alignr}${top mem 7} %
    #{top_mem name 8}${alignr}${top mem 8} %

    ${font Terminus:bold:size=7}NETWORK${hr 1}
    ${font Terminus:normal:size=7}ESSID:$alignr ${wireless_essid wlan0}
    IP:$alignr${execi 3600 wget -O - http://ip.tupeux.com | tail}
    Node:$alignr${addr eth0} | ${addr wlan0}
    In:$alignr eth0:${downspeed eth0} | wlan0:${downspeed wlan0}
    Out:$alignr eth0:${upspeed eth0} | wlan0:${upspeed wlan0}
   
    ${font Terminus:bold:size=7}CONNECTIONS${hr 1}
    ${font Terminus:normal:size=7}${tcp_portmon 32768 61000 rhost 0} ${alignr} ${tcp_portmon 32768 61000 rservice    0}
    ${tcp_portmon 32768 61000 rhost 1} ${alignr} ${tcp_portmon 32768 61000 rservice    1}
    ${tcp_portmon 32768 61000 rhost 2} ${alignr} ${tcp_portmon 32768 61000 rservice    2}
    ${tcp_portmon 32768 61000 rhost 3} ${alignr} ${tcp_portmon 32768 61000 rservice    3}
    ${tcp_portmon 32768 61000 rhost 4} ${alignr} ${tcp_portmon 32768 61000 rservice    4}
    ${tcp_portmon 32768 61000 rhost 5} ${alignr} ${tcp_portmon 32768 61000 rservice    5}
    ${tcp_portmon 32768 61000 rhost 6} ${alignr} ${tcp_portmon 32768 61000 rservice    6}
    ${tcp_portmon 32768 61000 rhost 7} ${alignr} ${tcp_portmon 32768 61000 rservice    7}
    ${tcp_portmon 32768 61000 rhost 8} ${alignr} ${tcp_portmon 32768 61000 rservice    8}
    ${tcp_portmon 32768 61000 rhost 9} ${alignr} ${tcp_portmon 32768 61000 rservice    9}
   
   
#${cpugraph cpu1}
#${downspeedgraph eth0}s
#${upspeedgraph eth0}

#“I experimented on my own,” he says. “I burned the shit out of some. I went through different ones trying to find the perfect one. I found a decent one that worked perfect with mine.” -goonabouts

Last edited by nomad (2013-03-06 04:23:44)


Happy Birthday and Spraypaint an Angel on Your Trailer.

Offline

#4809 2013-02-24 15:24:38

ichase
#! CrunchBanger
Registered: 2011-03-16
Posts: 137

Re: The New Monster Conky Thread

Decided to play with the fonts and color for the Weather conky.  Kind of make things more uniformed with the info conky on the right.  I am a big fan of the Radio Space font <---- Click link if you want it smile

I think I may have thrown the spacing off a little. (actually at first A LOT but got it back close to right big_smile  )

98814d239049992.jpg

Offline

#4810 2013-02-24 15:28:37

Sector11
77345 ¡#
From: SR11 Cockpit
Registered: 2010-05-05
Posts: 12,802
Website

Re: The New Monster Conky Thread

OPC use to mean Other People's Cigarettes, now it means Other Peoples Conkys, add that with MPOS (Modifying Other People's Stuff) and it can be quite interesting. devil

Personally, for me these are kinda small but would sit well on a netbook I suppose - later I think I'll take that HUD2 and make it larger.
adtkneuw.jpg

clock_conky - on the top left (obvious)

#  author  : SLK
#  version : v2011011601
#  license : Distributed under the terms of GNU GPL version 2 or later
#
#=== Modified by: Sector11 09 Oct 12 ===========================================
# killall conky && conky -c /media/5/.conky/conky5/clock_conky &
###  Begin Window Settings  ##################################################
# Create own window instead of using desktop (required in nautilus)
own_window yes
own_window_type normal
own_window_transparent yes
own_window_hints undecorated,sticky,below,skip_taskbar,skip_pager
#own_window_colour black
own_window_class Conky
own_window_title Clock

### ARGB can be used for real transparency
### NOTE that a composite manager is required for real transparency.
### This option will not work as desired (in most cases) in conjunction with
### own_window_type override
own_window_argb_visual yes

### When ARGB visuals are enabled, this use this to modify the alpha value
### Valid range is 0-255, where 0 is 0% opacity, and 255 is 100% opacity.
#own_window_argb_value 200

# Use the Xdbe extension? (eliminates flicker)
# It is highly recommended to use own window with this one
# so double buffer won't be so big.
double_buffer yes

minimum_size 156 156 ## width, height
maximum_width 156  ## width

gap_x 5 # left-right
gap_y 5 # up-down

alignment top_left
###################################################  End Window Settings  ###
###  Font Settings  #########################################################
# Use Xft (anti-aliased font and stuff)
use_xft yes
xftfont Monofur:pixelsize=6

# Alpha of Xft font. Must be a value at or between 1 and 0 ###
xftalpha 0
# Force UTF8? requires XFT ###
override_utf8_locale yes

uppercase no
######################################################  End Font Settings  ###
###  Color Settings  #########################################################
draw_shades yes
default_shade_color black

draw_outline no # amplifies text if yes
default_outline_color black

default_color DCDCDC #220 220 220	Gainsboro
color0 8FBC8F #143 188 143	DarkSeaGreen
color1 778899 #119 136 153	LightSlateGray
color2 FF8C00 #255 140   0	DarkOrange
color3 7FFF00 #127 255   0	Chartreuse
color4 FFA07A #255 160 122	LightSalmon
color5 FFDEAD #255 222 173	NavajoWhite
color6 00BFFF #  0 191 255	DeepSkyBlue
color7 00FFFF #  0 255 255	Cyan
color8 FFFF00 #255 255   0	Yellow
color9 B22222 #178  34  34	FireBrick
#####################################################  End Color Settings  ###
###  Borders Section  ########################################################
draw_borders no
# Stippled borders?
stippled_borders 0
# border margins
border_inner_margin 0
border_outer_margin 0
# border width
border_width 0
# graph borders
draw_graph_borders no #yes
default_graph_size 15 40
#####################################################  End Borders Secton  ###
###  Miscellaneous Section  ##################################################

# Boolean value, if true, Conky will be forked to background when started.
background no

# Adds spaces around certain objects to stop them from moving other things
# around, this only helps if you are using a mono font
# Options: right, left or none
use_spacer none

# Default and Minimum size is 256 - needs more for single commands that
# "call" a lot of text IE: bash scripts
text_buffer_size 256

# Subtract (file system) buffers from used memory?
no_buffers yes

# change GiB to G and MiB to M
short_units yes

# Like it says, ot pads the decimals on % values
# doesn't seem to work since v1.7.1
pad_percents 2

##############################################  End Miscellaneous Section  ###
###  LUA Settings  ###########################################################
## Above and After TEXT - requires a composite manager or blinks.
##
# lua_load ~/Conky/LUA/draw-bg.lua
#TEXT
#${lua conky_draw_bg 10 0 0 0 0 0x000000 0.6}
#
## ${lua conky_draw_bg corner_radius x_position y_position width height color alpha}
##
## OR Both above TEXT (No composite manager required - no blinking!)
#
lua_load ~/Conky/LUA/draw-bg.lua
#lua_draw_hook_pre draw_bg 10 0 0 0 0 0x000000 0.3
#
lua_load /media/5/.conky/conky5/clock_conky.lua
lua_draw_hook_pre main
#
#######################################################  End LUA Settings  ###
# The all important - How often conky refreshes.
# If you have a "Crey" try: 0.2 - smokin' - but watch the CPU useage go UP!
update_interval 1


TEXT
${lua conky_draw_bg 10 0 0 0 0 0x000000 0.1}






${goto 70}${font monofur:bold:size=10}${time %a}
${goto 65}${color7}${font digitalk:size=22}${time %d}${font}
${goto 55}${color2}${font monofur:bold:size=10}${time %b}${color3} ${font digitalk:size=12}${time %y}${font}

clock_conky.lua

--==============================================================================
--  Modifired from: conky_orange.lua
--  author  : SLK
--  version : v2011011601
--  license : Distributed under the terms of GNU GPL version 2 or later
--
--  Sector11: 23 Feb 13 - clock_conky.lua
--==============================================================================

require 'cairo'

--------------------------------------------------------------------------------
--                                                                    clock DATA
-- HOURS
clock_h = {
    {
    name='time',                   arg='%H',                    max_value=12,
    x=78,                          y=80,
    graph_radius=53,
    graph_thickness=3,
    graph_unit_angle=30,           graph_unit_thickness=30,
    graph_bg_colour=0xFFFFFF,      graph_bg_alpha=0.0,
    graph_fg_colour=0xFFFFFF,      graph_fg_alpha=0.3,
    txt_radius=34,
    txt_weight=1,                  txt_size=12.0,
    txt_fg_colour=0xFFFFFF,        txt_fg_alpha=0.6,
    graduation_radius=53,
    graduation_thickness=6,        graduation_mark_thickness=2,
    graduation_unit_angle=30,
    graduation_fg_colour=0xFFFFFF, graduation_fg_alpha=0.3,
    },
}
-- MINUTES
clock_m = {
    {
    name='time',                   arg='%M',                    max_value=60,
    x=78,                          y=80,
    graph_radius=57,
    graph_thickness=2,
    graph_unit_angle=6,            graph_unit_thickness=6,
    graph_bg_colour=0xFFFFFF,      graph_bg_alpha=0.1,
    graph_fg_colour=0xFFFFFF,      graph_fg_alpha=0.3,
    txt_radius=70,
    txt_weight=1,                  txt_size=12.0,
    txt_fg_colour=0xFFFFFF,        txt_fg_alpha=0.6,
    graduation_radius=57,
    graduation_thickness=0,        graduation_mark_thickness=2,
    graduation_unit_angle=30,
    graduation_fg_colour=0xFFFFFF, graduation_fg_alpha=0.3,
    },
}
-- SECONDS
clock_s = {
    {
    name='time',                   arg='%S',                    max_value=60,
    x=78,                          y=80,
    graph_radius=50,
    graph_thickness=2,
    graph_unit_angle=6,            graph_unit_thickness=2,
    graph_bg_colour=0xFFFFFF,      graph_bg_alpha=0.0,
    graph_fg_colour=0xFFFFFF,      graph_fg_alpha=0.3,
    txt_radius=42,
    txt_weight=1,                  txt_size=9.0,
    txt_fg_colour=0xffFFFF,        txt_fg_alpha=0.2,
    graduation_radius=0,
    graduation_thickness=0,        graduation_mark_thickness=0,
    graduation_unit_angle=0,
    graduation_fg_colour=0xFFFFFF, graduation_fg_alpha=0.0,
    },
}

--------------------------------------------------------------------------------
--                                                                 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_clock_ring
-- displays clock
--
function draw_clock_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_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']

    -- background ring
    cairo_arc(display, x, y, graph_radius, 0, 2 * math.pi)
    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)
    local i = 1
    while i <= val do
        cairo_arc(display, x, y, graph_radius,(  ((graph_unit_angle * i) - graph_unit_thickness)*(2*math.pi/360)  )-(math.pi/2),((graph_unit_angle * i) * (2*math.pi/360))-(math.pi/2))
        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 = (graph_unit_angle * i) - graph_unit_thickness

    -- 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 = 360 / graduation_unit_angle
        local i = 1
        while i <= nb_graduation do
            cairo_set_line_width(display, graduation_thickness)
            cairo_arc(display, x, y, graduation_radius, (((graduation_unit_angle * i)-(graduation_mark_thickness/2))*(2*math.pi/360))-(math.pi/2),(((graduation_unit_angle * i)+(graduation_mark_thickness/2))*(2*math.pi/360))-(math.pi/2))
            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 * 2 * math.pi / 360)-(math.pi/2)))
    local movey = txt_radius * (math.sin((angle * 2 * math.pi / 360)-(math.pi/2)))
    cairo_select_font_face (display, "monofur", 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);
end

-------------------------------------------------------------------------------
--                                                               go_clock_rings
-- loads data and displays clock
--
function go_clock_rings(display)
    local function load_clock_rings(display, data)
        local str, value = '', 0
        str = string.format('${%s %s}',data['name'], data['arg'])
        str = conky_parse(str)
        value = tonumber(str)
        draw_clock_ring(display, data, value)
    end

    for i in pairs(clock_h) do
        load_clock_rings(display, clock_h[i])
    end
    for i in pairs(clock_m) do
        load_clock_rings(display, clock_m[i])
    end
    for i in pairs(clock_s) do
        load_clock_rings(display, clock_s[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 end]]
        go_clock_rings(display)
        --go_gauge_rings(display)


cairo_destroy(cr)
cairo_surface_destroy(cs)
cr=nil
end-- end main function

conky_HUD - bottom middle

#  version : v2011011601
#  license : Distributed under the terms of GNU GPL version 2 or later
#  Edited for #! Debian SID - OpenBox - by Sector11
#==============================================================================

background yes
update_interval 1

cpu_avg_samples 2
net_avg_samples 2

double_buffer yes
no_buffers yes
text_buffer_size 256
gap_x 0
gap_y 40
minimum_size 250 0
maximum_width 250
own_window yes
own_window_type override
own_window_transparent yes
own_window_type normal
own_window_hints undecorated,sticky,skip_taskbar,skip_pager,below
own_window_argb_visual yes
border_inner_margin 0
border_outer_margin 0
alignment bm

draw_shades yes
default_shade_color black
draw_outline no
draw_borders no
draw_graph_borders no

override_utf8_locale yes
use_xft yes
xftfont Monofur:bold:size=10
xftalpha 0.5
uppercase no

short_units


default_color DCDCDC #220 220 220	Gainsboro
color0 8FBC8F #143 188 143	DarkSeaGreen
color1 00FFBB #green
color2 FF8C00 #255 140   0	DarkOrange
color3 7FFF00 #127 255   0	Chartreuse
color4 FFA07A #255 160 122	LightSalmon
color5 FFDEAD #255 222 173	NavajoWhite
color6 00BFFF #  0 191 255	DeepSkyBlue
color7 00FFFF #  0 255 255	Cyan
color8 FFFF00 #255 255   0	Yellow
color9 B22222 #178  34  34	FireBrick

lua_load /media/5/.conky/conky6/conky_HUD.lua
lua_draw_hook_post main

lua_load ~/Conky/LUA/draw-bg.lua
lua_draw_hook_pre draw_bg 8 0 0 0 0 0x000000 0.1

TEXT

  ${font digitalk:bold:size=12}${time %H:%M}${goto 200}${time %d %m}${color}${font}


${goto 110}SDA
${goto 30}MEM${goto 100}${color1}/ ${fs_size /}${color}

${goto 170}CPU
${goto 100}${color5}/home ${fs_size /home}${color4}${goto 206}1${goto 216}2${goto 226}3${goto 236}${color8}A${color}

conky_HUD.lua

--==============================================================================
--                              conky_HUD.lua
--
--  author  : SLK
--  version : v2011062101
--  license : Distributed under the terms of GNU GPL version 2 or later
--
--==============================================================================

require 'cairo'

--------------------------------------------------------------------------------
--                                                                    gauge DATA
gauge = {
{
    name='cpu',                    arg='cpu0',                  max_value=100,
    x=180,                         y=120,
    graph_radius=60,
    graph_thickness=5,
    graph_start_angle=0,
    graph_unit_angle=0.9,          graph_unit_thickness=0.9,
    graph_bg_colour=0xFFFF00,      graph_bg_alpha=0.3,
    graph_fg_colour=0xFFFF00,      graph_fg_alpha=0.0,
    hand_fg_colour=0xFFFF00,       hand_fg_alpha=1.0,
    txt_radius=60,				-- yellow
    txt_weight=1,                  txt_size=10.0,
    txt_fg_colour=0xFFFFff,        txt_fg_alpha=0.8,
    graduation_radius=30,
    graduation_thickness=0,        graduation_mark_thickness=1,
    graduation_unit_angle=27,
    graduation_fg_colour=0xFFFF00, graduation_fg_alpha=0.3,
    caption='',
    caption_weight=1,              caption_size=8.0,
    caption_fg_colour=0xFFFFFF,    caption_fg_alpha=0.3,
},
{
    name='cpu',                    arg='cpu1',                  max_value=100,
    x=180,                         y=120,
    graph_radius=50,
    graph_thickness=5,
    graph_start_angle=0,
    graph_unit_angle=0.9,          graph_unit_thickness=0.9,
    graph_bg_colour=0xFFA07A,      graph_bg_alpha=0.3,
    graph_fg_colour=0xFFA07A,      graph_fg_alpha=0.0,
    hand_fg_colour=0xFFA07A,       hand_fg_alpha=1.0,
    txt_radius=50,				-- green
    txt_weight=1,                  txt_size=10.0,
    txt_fg_colour=0xffffff,        txt_fg_alpha=0.8,
    graduation_radius=55,
    graduation_thickness=5,        graduation_mark_thickness=2,
    graduation_unit_angle=27,
    graduation_fg_colour=0xFFA07A, graduation_fg_alpha=0.3,
    caption='',
    caption_weight=1,              caption_size=8.0,
    caption_fg_colour=0xFFFFFF,    caption_fg_alpha=0.3,
},
{
    name='cpu',                    arg='cpu2',                  max_value=100,
    x=180,                         y=120,
    graph_radius=40,
    graph_thickness=5,
    graph_start_angle=0,
    graph_unit_angle=0.9,          graph_unit_thickness=0.9,
    graph_bg_colour=0xFFA07A,      graph_bg_alpha=0.3,
    graph_fg_colour=0xFFA07A,      graph_fg_alpha=0.0,
    hand_fg_colour=0xFFA07A,       hand_fg_alpha=1.0,
    txt_radius=40,				-- green
    txt_weight=1,                  txt_size=10.0,
    txt_fg_colour=0xffffff,        txt_fg_alpha=0.8,
    graduation_radius=30,
    graduation_thickness=0,        graduation_mark_thickness=1,
    graduation_unit_angle=27,
    graduation_fg_colour=0xFFA07A, graduation_fg_alpha=0.3,
    caption='',
    caption_weight=1,              caption_size=8.0,
    caption_fg_colour=0xFFFFFF,    caption_fg_alpha=0.3,
},
{
    name='cpu',                    arg='cpu3',                  max_value=100,
    x=180,                         y=120,
    graph_radius=30,
    graph_thickness=5,
    graph_start_angle=0,
    graph_unit_angle=0.9,          graph_unit_thickness=0.9,
    graph_bg_colour=0xFFA07A,      graph_bg_alpha=0.3,
    graph_fg_colour=0xFFA07A,      graph_fg_alpha=0.0,
    hand_fg_colour=0xFFA07A,       hand_fg_alpha=1.0,
    txt_radius=30,				-- green
    txt_weight=1,                  txt_size=10.0,
    txt_fg_colour=0xffffff,        txt_fg_alpha=0.8,
    graduation_radius=35,
    graduation_thickness=5,        graduation_mark_thickness=2,
    graduation_unit_angle=27,
    graduation_fg_colour=0xFFA07A, graduation_fg_alpha=0.3,
    caption='',
    caption_weight=1,              caption_size=8.0,
    caption_fg_colour=0xFFFFFF,    caption_fg_alpha=0.3,
},
{
    name='memperc',                arg='',                      max_value=100,
    x=40,                          y=85,
    graph_radius=34,
    graph_thickness=5,
    graph_start_angle=180,
    graph_unit_angle=2,            graph_unit_thickness=2,
    graph_bg_colour=0x00BFFF,      graph_bg_alpha=0.3,
    graph_fg_colour=0x00BFFF,      graph_fg_alpha=0.0,
    hand_fg_colour=0x00BFFF,       hand_fg_alpha=1.0,
    txt_radius=20,
    txt_weight=1,                  txt_size=10.0,
    txt_fg_colour=0xffffff,        txt_fg_alpha=0.8,
    graduation_radius=24,
    graduation_thickness=6,        graduation_mark_thickness=2,
    graduation_unit_angle=10,
    graduation_fg_colour=0x00BFFF, graduation_fg_alpha=0.3,
    caption='',
    caption_weight=1,              caption_size=10.0,
    caption_fg_colour=0xFFFFFF,    caption_fg_alpha=0.5,
},
{
    name='fs_used_perc',           arg='/',                     max_value=100,
    x=120,                         y=70,
    graph_radius=40,
    graph_thickness=4,
    graph_start_angle=210,
    graph_unit_angle=2,            graph_unit_thickness=2,
    graph_bg_colour=0x00FFBB,      graph_bg_alpha=0.3,
    graph_fg_colour=0x00FFBB,      graph_fg_alpha=0.0,
    hand_fg_colour=0x00FFBB,       hand_fg_alpha=1.0,
    txt_radius=32,
    txt_weight=1,                  txt_size=10.0,
    txt_fg_colour=0xffffff,        txt_fg_alpha=0.8,
    graduation_radius=46,
    graduation_thickness=0,        graduation_mark_thickness=2,
    graduation_unit_angle=20,
    graduation_fg_colour=0x00FFBB, graduation_fg_alpha=0.3,
    caption='',
    caption_weight=1,              caption_size=8.0,
    caption_fg_colour=0xFFFFFF,    caption_fg_alpha=0.5,
},
{
    name='fs_used_perc',           arg='/home/',                max_value=100,
    x=120,                         y=70,
    graph_radius=50,
    graph_thickness=8,
    graph_start_angle=210,
    graph_unit_angle=2,            graph_unit_thickness=2,
    graph_bg_colour=0xFFDEAD,      graph_bg_alpha=0.3,
    graph_fg_colour=0xFFDEAD,      graph_fg_alpha=0.0,
    hand_fg_colour=0xFFDEAD,       hand_fg_alpha=1.0,
    txt_radius=60,
    txt_weight=1,                  txt_size=10.0,
    txt_fg_colour=0xffffff,        txt_fg_alpha=0.8,
    graduation_radius=58,
    graduation_thickness=4,        graduation_mark_thickness=2,
    graduation_unit_angle=20,
    graduation_fg_colour=0xFFDEAD, graduation_fg_alpha=0.3,
    caption='',
    caption_weight=1,              caption_size=8.0,
    caption_fg_colour=0xFFFFFF,    caption_fg_alpha=0.5,
},
}

-------------------------------------------------------------------------------
--                                                                 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

conky_HUD2 - bottom left

#=== borrowed from: === & Voyager Linux === http://voyager.legtux.org/ =========
#                               conkyrc_orange
#
#  author  : SLK
#  version : v2011011601
#  license : Distributed under the terms of GNU GPL version 2 or later
#
#=== Sector11 09 Oct 12 =======================================================
# killall conky && conky -c /media/5/.conky/conky6/conkyrc_HUD2 &
###  Begin Window Settings  ##################################################
# Create own window instead of using desktop (required in nautilus)
own_window yes
own_window_type normal
own_window_transparent yes
own_window_hints undecorated,sticky,below,skip_taskbar,skip_pager
#own_window_colour black
own_window_class Conky
own_window_title HUD 2

### ARGB can be used for real transparency
### NOTE that a composite manager is required for real transparency.
### This option will not work as desired (in most cases) in conjunction with
### own_window_type override
own_window_argb_visual yes

### When ARGB visuals are enabled, this use this to modify the alpha value
### Valid range is 0-255, where 0 is 0% opacity, and 255 is 100% opacity.
#own_window_argb_value 200

# Use the Xdbe extension? (eliminates flicker)
# It is highly recommended to use own window with this one
# so double buffer won't be so big.
double_buffer yes

minimum_size 250 275 ## width, height
maximum_width 250  ## width

gap_x 5 # left-right
gap_y 40 # up-down

#alignment top_right
#alignment top_left
alignment bottom_left
###################################################  End Window Settings  ###
###  Font Settings  #########################################################
# Use Xft (anti-aliased font and stuff)
use_xft yes
xftfont Monofur:bold:size=10

# Alpha of Xft font. Must be a value at or between 1 and 0 ###
xftalpha 0
# Force UTF8? requires XFT ###
override_utf8_locale yes

draw_shades no
default_shade_color black

draw_outline no # amplifies text if yes
default_outline_color black

uppercase no
######################################################  End Font Settings  ###
###  Color Settings  #########################################################
default_shade_color grey
default_outline_color black

default_color DCDCDC #220 220 220	Gainsboro
color0 8FBC8F #143 188 143	DarkSeaGreen
color1 778899 #119 136 153	LightSlateGray
color2 FF8C00 #255 140   0	DarkOrange
color3 7FFF00 #127 255   0	Chartreuse
color4 FFA07A #255 160 122	LightSalmon
color5 FFDEAD #255 222 173	NavajoWhite
color6 00BFFF #  0 191 255	DeepSkyBlue
color7 00FFFF #  0 255 255	Cyan
color8 FFFF00 #255 255   0	Yellow
color9 B22222 #178  34  34	FireBrick
#####################################################  End Color Settings  ###
###  Borders Section  ########################################################
draw_borders no
# Stippled borders?
stippled_borders 0
# border margins
border_inner_margin 0
border_outer_margin 0
# border width
border_width 0
# graph borders
draw_graph_borders no #yes
default_graph_size 15 40
#####################################################  End Borders Secton  ###
###  Miscellaneous Section  ##################################################

# Boolean value, if true, Conky will be forked to background when started.
background no

# Adds spaces around certain objects to stop them from moving other things
# around, this only helps if you are using a mono font
# Options: right, left or none
use_spacer none

# Default and Minimum size is 256 - needs more for single commands that
# "call" a lot of text IE: bash scripts
text_buffer_size 256

# Subtract (file system) buffers from used memory?
no_buffers yes

# change GiB to G and MiB to M
short_units yes

# Like it says, ot pads the decimals on % values
# doesn't seem to work since v1.7.1
pad_percents 2

##############################################  End Miscellaneous Section  ###
###  LUA Settings  ###########################################################
## Above and After TEXT - requires a composite manager or blinks.
##
# lua_load ~/Conky/LUA/draw-bg.lua
#TEXT
#${lua conky_draw_bg 10 0 0 0 0 0x000000 0.6}
#
## ${lua conky_draw_bg corner_radius x_position y_position width height color alpha}
##
## OR Both above TEXT (No composite manager required - no blinking!)
#
lua_load ~/Conky/LUA/draw-bg.lua
lua_draw_hook_pre draw_bg 10 0 0 0 0 0x000000 0.1
#
lua_load /media/5/.conky/conky6/conky_HUD2.lua
lua_draw_hook_post main
#
#######################################################  End LUA Settings  ###
# The all important - How often conky refreshes.
# If you have a "Crey" try: 0.2 - smokin' - but watch the CPU useage go UP!
update_interval 1


TEXT




  MB ${color0}${platform f71882fg.2560 temp 2}°\
${goto 105}${color}SDA ${color0}${execi 15 hddtemp -n /dev/sda}°${color}\
${goto 190}GPU ${color0}${nvidia temp}°${font}${color}
${goto 100}/ ${color0}${fs_size /}${goto 190}${nvidia gpufreq}MHz${color}
${goto 105}
${goto 105}
${goto 30}${color}MEM${goto 95}/H ${color0}${fs_size /home}${color}
${goto 165}${color}CPU
${goto 180}${color0}${platform f71882fg.2560 temp 1}°${color}${goto 206}1${goto 216}2${goto 226}3${goto 236}${color8}A${color}
${goto 10}${color0}${nvidia memfreq}MHz${goto 190}${freq_g} GHz${color}
${goto 110}${font monofur:bold:size=10}${time %a}
${goto 105}${color7}${font digitalk:size=22}${time %d}${font}
${goto 95}${color2}${font monofur:bold:size=10}${time %b}${color3} ${font digitalk:size=12}${time %y}${font}

conky_HUD2.lua

--==============================================================================
--                              conky_HUD.lua
--
--  author  : SLK
--  version : v2011062101
--  license : Distributed under the terms of GNU GPL version 2 or later
--
--==============================================================================

require 'cairo'

--------------------------------------------------------------------------------
--                                                                    gauge DATA
gauge = {
{
    name='cpu',                    arg='cpu0',                  max_value=100,
    x=180,                         y=150,
    graph_radius=60,
    graph_thickness=5,
    graph_start_angle=0,
    graph_unit_angle=0.9,          graph_unit_thickness=0.9,
    graph_bg_colour=0xFFFF00,      graph_bg_alpha=0.3,
    graph_fg_colour=0xFFFF00,      graph_fg_alpha=0.0,
    hand_fg_colour=0xFFFF00,       hand_fg_alpha=1.0,
    txt_radius=60,				-- yellow
    txt_weight=1,                  txt_size=10.0,
    txt_fg_colour=0xFFFF00,        txt_fg_alpha=0.8,
    graduation_radius=30,
    graduation_thickness=0,        graduation_mark_thickness=1,
    graduation_unit_angle=27,
    graduation_fg_colour=0xFFFF00, graduation_fg_alpha=0.3,
    caption='',
    caption_weight=1,              caption_size=8.0,
    caption_fg_colour=0xFFFFFF,    caption_fg_alpha=0.3,
},
{
    name='cpu',                    arg='cpu1',                  max_value=100,
    x=180,                         y=150,
    graph_radius=50,
    graph_thickness=5,
    graph_start_angle=0,
    graph_unit_angle=0.9,          graph_unit_thickness=0.9,
    graph_bg_colour=0x00BFFF,      graph_bg_alpha=0.3,
    graph_fg_colour=0x00BFFF,      graph_fg_alpha=0.0,
    hand_fg_colour=0x00BFFF,       hand_fg_alpha=1.0,
    txt_radius=50,				-- green
    txt_weight=1,                  txt_size=10.0,
    txt_fg_colour=0x00BFFF,        txt_fg_alpha=0.8,
    graduation_radius=55,
    graduation_thickness=5,        graduation_mark_thickness=2,
    graduation_unit_angle=27,
    graduation_fg_colour=0x00BFFF, graduation_fg_alpha=0.3,
    caption='',
    caption_weight=1,              caption_size=8.0,
    caption_fg_colour=0xFFFFFF,    caption_fg_alpha=0.3,
},
{
    name='cpu',                    arg='cpu2',                  max_value=100,
    x=180,                         y=150,
    graph_radius=40,
    graph_thickness=5,
    graph_start_angle=0,
    graph_unit_angle=0.9,          graph_unit_thickness=0.9,
    graph_bg_colour=0x00BFFF,      graph_bg_alpha=0.3,
    graph_fg_colour=0x00BFFF,      graph_fg_alpha=0.0,
    hand_fg_colour=0x00BFFF,       hand_fg_alpha=1.0,
    txt_radius=40,
    txt_weight=1,                  txt_size=10.0,
    txt_fg_colour=0x00BFFF,        txt_fg_alpha=0.8,
    graduation_radius=30,
    graduation_thickness=0,        graduation_mark_thickness=1,
    graduation_unit_angle=27,
    graduation_fg_colour=0x00BFFF, graduation_fg_alpha=0.3,
    caption='',
    caption_weight=1,              caption_size=8.0,
    caption_fg_colour=0xFFFFFF,    caption_fg_alpha=0.3,
},
{
    name='cpu',                    arg='cpu3',                  max_value=100,
    x=180,                         y=150,
    graph_radius=30,
    graph_thickness=5,
    graph_start_angle=0,
    graph_unit_angle=0.9,          graph_unit_thickness=0.9,
    graph_bg_colour=0x00BFFF,      graph_bg_alpha=0.3,
    graph_fg_colour=0x00BFFF,      graph_fg_alpha=0.0,
    hand_fg_colour=0x00BFFF,       hand_fg_alpha=1.0,
    txt_radius=30,
    txt_weight=1,                  txt_size=10.0,
    txt_fg_colour=0x00BFFF,        txt_fg_alpha=0.8,
    graduation_radius=35,
    graduation_thickness=5,        graduation_mark_thickness=2,
    graduation_unit_angle=27,
    graduation_fg_colour=0x00BFFF, graduation_fg_alpha=0.3,
    caption='',
    caption_weight=1,              caption_size=8.0,
    caption_fg_colour=0xFFFFFF,    caption_fg_alpha=0.3,
},
{
    name='memperc',                arg='',                      max_value=100,
    x=40,                          y=115,
    graph_radius=34,
    graph_thickness=5,
    graph_start_angle=180,
    graph_unit_angle=2,            graph_unit_thickness=2,
    graph_bg_colour=0x00BFFF,      graph_bg_alpha=0.3,
    graph_fg_colour=0x00BFFF,      graph_fg_alpha=0.0,
    hand_fg_colour=0x00BFFF,       hand_fg_alpha=1.0,
    txt_radius=20,
    txt_weight=1,                  txt_size=10.0,
    txt_fg_colour=0x00BFFF,        txt_fg_alpha=0.8,
    graduation_radius=24,
    graduation_thickness=6,        graduation_mark_thickness=2,
    graduation_unit_angle=10,
    graduation_fg_colour=0x00BFFF, graduation_fg_alpha=0.3,
    caption='',
    caption_weight=1,              caption_size=10.0,
    caption_fg_colour=0xFFFFFF,    caption_fg_alpha=0.5,
},
{
    name='fs_used_perc',           arg='/',                     max_value=100,
    x=120,                         y=70,
    graph_radius=40,
    graph_thickness=4,
    graph_start_angle=210,
    graph_unit_angle=2,            graph_unit_thickness=2,
    graph_bg_colour=0x00BFFF,      graph_bg_alpha=0.3,
    graph_fg_colour=0x00BFFF,      graph_fg_alpha=0.0,
    hand_fg_colour=0x00BFFF,       hand_fg_alpha=1.0,
    txt_radius=32,
    txt_weight=1,                  txt_size=10.0,
    txt_fg_colour=0x00BFFF,        txt_fg_alpha=0.8,
    graduation_radius=46,
    graduation_thickness=0,        graduation_mark_thickness=2,
    graduation_unit_angle=20,
    graduation_fg_colour=0x00BFFF, graduation_fg_alpha=0.3,
    caption='',
    caption_weight=1,              caption_size=8.0,
    caption_fg_colour=0xFFFFFF,    caption_fg_alpha=0.5,
},
{
    name='fs_used_perc',           arg='/home/',                max_value=100,
    x=120,                         y=70,
    graph_radius=50,
    graph_thickness=8,
    graph_start_angle=210,
    graph_unit_angle=2,            graph_unit_thickness=2,
    graph_bg_colour=0x00BFFF,      graph_bg_alpha=0.3,
    graph_fg_colour=0x00BFFF,      graph_fg_alpha=0.0,
    hand_fg_colour=0x00BFFF,       hand_fg_alpha=1.0,
    txt_radius=65,
    txt_weight=1,                  txt_size=10.0,
    txt_fg_colour=0x00BFFF,        txt_fg_alpha=0.8,
    graduation_radius=58,
    graduation_thickness=4,        graduation_mark_thickness=2,
    graduation_unit_angle=20,
    graduation_fg_colour=0x00BFFF, graduation_fg_alpha=0.3,
    caption='',
    caption_weight=1,              caption_size=8.0,
    caption_fg_colour=0xFFFFFF,    caption_fg_alpha=0.5,
},
}
-------------------------------------------------------------------------------
--                                                                 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 or 0) % (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


--------------------------------------------------------------------------------
--                                                                    clock DATA
-- HOURS
clock_h = {
    {
    name='time',                   arg='%H',                    max_value=12,
    x=120,                          y=200,
    graph_radius=53,
    graph_thickness=3,
    graph_unit_angle=30,           graph_unit_thickness=30,
    graph_bg_colour=0x00BFFF,      graph_bg_alpha=0.0,
    graph_fg_colour=0x00BFFF,      graph_fg_alpha=0.3,
    txt_radius=34,
    txt_weight=1,                  txt_size=15.0,
    txt_fg_colour=0xFFDEAD,        txt_fg_alpha=0.9,
    graduation_radius=53,
    graduation_thickness=6,        graduation_mark_thickness=2,
    graduation_unit_angle=30,
    graduation_fg_colour=0xFFFFFF, graduation_fg_alpha=0.3,
    },
}
-- MINUTES
clock_m = {
    {
    name='time',                   arg='%M',                    max_value=60,
    x=120,                          y=200,
    graph_radius=57,
    graph_thickness=2,
    graph_unit_angle=6,            graph_unit_thickness=6,
    graph_bg_colour=0x00BFFF,      graph_bg_alpha=0.1,
    graph_fg_colour=0x00BFFF,      graph_fg_alpha=0.3,
    txt_radius=65,
    txt_weight=1,                  txt_size=15.0,
    txt_fg_colour=0xFFDEAD,        txt_fg_alpha=0.9,
    graduation_radius=57,
    graduation_thickness=0,        graduation_mark_thickness=2,
    graduation_unit_angle=30,
    graduation_fg_colour=0xFFFFFF, graduation_fg_alpha=0.3,
    },
}
-- SECONDS
clock_s = {
    {
    name='time',                   arg='%S',                    max_value=60,
    x=120,                          y=200,
    graph_radius=50,
    graph_thickness=2,
    graph_unit_angle=6,            graph_unit_thickness=2,
    graph_bg_colour=0xFFFF00,      graph_bg_alpha=0.0,
    graph_fg_colour=0xFFFF00,      graph_fg_alpha=0.2,
    txt_radius=42,
    txt_weight=0,                  txt_size=8.0,
    txt_fg_colour=0xFFDEAD,        txt_fg_alpha=0.9,
    graduation_radius=0,
    graduation_thickness=0,        graduation_mark_thickness=0,
    graduation_unit_angle=0,
    graduation_fg_colour=0xFFFFFF, graduation_fg_alpha=0.0,
    },
}

--------------------------------------------------------------------------------
--                                                                 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_clock_ring
-- displays clock
--
function draw_clock_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_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']

    -- background ring
    cairo_arc(display, x, y, graph_radius, 0, 2 * math.pi)
    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)
    local i = 1
    while i <= val do
        cairo_arc(display, x, y, graph_radius,(  ((graph_unit_angle * i) - graph_unit_thickness)*(2*math.pi/360)  )-(math.pi/2),((graph_unit_angle * i) * (2*math.pi/360))-(math.pi/2))
        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 = (graph_unit_angle * i) - graph_unit_thickness

    -- 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 = 360 / graduation_unit_angle
        local i = 1
        while i <= nb_graduation do
            cairo_set_line_width(display, graduation_thickness)
            cairo_arc(display, x, y, graduation_radius, (((graduation_unit_angle * i)-(graduation_mark_thickness/2))*(2*math.pi/360))-(math.pi/2),(((graduation_unit_angle * i)+(graduation_mark_thickness/2))*(2*math.pi/360))-(math.pi/2))
            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 * 2 * math.pi / 360)-(math.pi/2)))
    local movey = txt_radius * (math.sin((angle * 2 * math.pi / 360)-(math.pi/2)))
    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);
end

-------------------------------------------------------------------------------
--                                                               go_clock_rings
-- loads data and displays clock
--
function go_clock_rings(display)
    local function load_clock_rings(display, data)
        local str, value = '', 0
        str = string.format('${%s %s}',data['name'], data['arg'])
        str = conky_parse(str)
        value = tonumber(str)
        draw_clock_ring(display, data, value)
    end

    for i in pairs(clock_h) do
        load_clock_rings(display, clock_h[i])
    end
    for i in pairs(clock_m) do
        load_clock_rings(display, clock_m[i])
    end
    for i in pairs(clock_s) do
        load_clock_rings(display, clock_s[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)
        go_clock_rings(display)
    end

    cairo_surface_destroy(cs)
    cairo_destroy(display)
end

Online

#4811 2013-02-24 16:16:05

Sector11
77345 ¡#
From: SR11 Cockpit
Registered: 2010-05-05
Posts: 12,802
Website

Re: The New Monster Conky Thread

ichase wrote:

Decided to play with the fonts and color for the Weather conky.  Kind of make things more uniformed with the info conky on the right.  I am a big fan of the Radio Space font <---- Click link if you want it smile

I think I may have thrown the spacing off a little. (actually at first A LOT but got it back close to right big_smile  )

http://thumbnails106.imagebam.com/23905/98814d239049992.jpg

There are a few things you can do to help you with "spacing" stuff in conky.

1. use a test image to cover the actual image that conky is calling for example:

${image $HOME/Accuweather_Conky_USA_Images/cc.png -p 0,60 -s 180x108}${image /media/5/red+x.png -p 0,60 -s 180x108}

Because "red+x.png" is called after the weather image and has the same -p and -s options it will cover the real image exactly - a sample:
acwF1Q2d.jpg

That's using red+x.png before it had the X in it - here it is: advAmbiJ.jpg

I made this because I do a lot of editing with conky and images.  big_smile

2. Next comes "screenruler" - very handy app: acxhhCLU.jpg
For a conky editor this is like a Colt 45 was for Wyatt Earp ... can be called up multiple times and in different scales (right click) or mouse wheel click to rotate - a must have (Opinion) big_smile

3. Make space for the temperatures you may have. ie summers of +"100" for °F and "-99" - notice the extremes each have three characters.  If you use a mono font for those it makes it easier to scale things.

That just a few of the more important (again an opinion).

Online

#4812 2013-02-24 16:27:16

ichase
#! CrunchBanger
Registered: 2011-03-16
Posts: 137

Re: The New Monster Conky Thread

S11, gave you conky_HUD a try but got everything but the rings.
Changed the path in the conkyrc to /Conky_Scripts/lua/draw_bg.lua and /Conky_Scripts/lua/conky_HUD.lua

When launching the conkyrc where I have placed in the home folder I get the following output

conky -c .conkyrc_HUD
Conky: .conkyrc_HUD: 56: no such configuration: 'lua_load'
Conky: .conkyrc_HUD: 57: no such configuration: 'lua_draw_hook_post'
Conky: .conkyrc_HUD: 59: no such configuration: 'lua_load'
Conky: .conkyrc_HUD: 60: no such configuration: 'lua_draw_hook_pre'
Conky: forked to background, pid is 11374

As always, "I" am the one doing something wrong but not sure as of what.  This is my first venture into running any kind of conky with lua scripts.  smile

Offline

#4813 2013-02-24 17:14:57

Sector11
77345 ¡#
From: SR11 Cockpit
Registered: 2010-05-05
Posts: 12,802
Website

Re: The New Monster Conky Thread

ichase wrote:

As always, "I" am the one doing something wrong but not sure as of what.  This is my first venture into running any kind of conky with lua scripts.  smile

Should have seen me with mrpeachy - How do I run it - a LOT!

When you say changed the path to:

  • /Conky_Scripts/lua/draw_bg.lua, and

  • /Conky_Scripts/lua/conky_HUD.lua


did you forget the ~ ??

  • ~/Conky_Scripts/lua/draw_bg.lua, and

  • ~/Conky_Scripts/lua/conky_HUD.lua

Like:

lua_load ~/Conky_Scripts/lua/conky_HUD.lua
lua_draw_hook_post main

lua_load ~/Conky_Scripts/lua/draw_bg.lua
lua_draw_hook_pre draw_bg 8 0 0 0 0 0x000000 0.1

Last edited by Sector11 (2013-02-24 17:17:52)

Online

#4814 2013-02-24 17:16:55

ichase
#! CrunchBanger
Registered: 2011-03-16
Posts: 137

Re: The New Monster Conky Thread

Sector11 wrote:

There are a few things you can do to help you with "spacing" stuff in conky.

1. use a test image to cover the actual image that conky is calling for example:

${image $HOME/Accuweather_Conky_USA_Images/cc.png -p 0,60 -s 180x108}${image /media/5/red+x.png -p 0,60 -s 180x108}

Because "red+x.png" is called after the weather image and has the same -p and -s options it will cover the real image exactly - a sample:
http://t.imgbox.com/acwF1Q2d.jpg

That's using red+x.png before it had the X in it - here it is: http://t.imgbox.com/advAmbiJ.jpg

I made this because I do a lot of editing with conky and images.  big_smile

2. Next comes "screenruler" - very handy app: http://t.imgbox.com/acxhhCLU.jpg
For a conky editor this is like a Colt 45 was for Wyatt Earp ... can be called up multiple times and in different scales (right click) or mouse wheel click to rotate - a must have (Opinion) big_smile

3. Make space for the temperatures you may have. ie summers of +"100" for °F and "-99" - notice the extremes each have three characters.  If you use a mono font for those it makes it easier to scale things.

That just a few of the more important (again an opinion).

S11, thanks for the tips.  Just installed gnome-screenruler from the AUR in Arch, yes, can see where that tool can be quite handy.  Will need to do some more work and reading to fully understand using the red+x.png with helping with the spacing.  But moving forward and expect once I get a better understanding of it, it will be a lot easier than I am thinking it is now.  wink

Thanks again for ALL of the effort you exhaust in helping all of us.

Ian

Offline

#4815 2013-02-24 17:35:51

Sector11
77345 ¡#
From: SR11 Cockpit
Registered: 2010-05-05
Posts: 12,802
Website

Re: The New Monster Conky Thread

@ ichase

Using "red+x.png" is absolutely simple.

Where you see an image call in conky, no matter where:

${image $HOME/Accuweather_Conky_USA_Images/cc.png -p 0,60 -s 180x108}

copy and past it behind itself so there are two:

${image $HOME/Accuweather_Conky_USA_Images/cc.png -p 0,60 -s 180x108}${image $HOME/Accuweather_Conky_USA_Images/cc.png -p 0,60 -s 180x108}

back to back.

In the second instance change (example) $HOME/Accuweather_Conky_USA_Images/cc.png
to:
/path_to/the_image/red+x.png

I'm a three finger typist and use to copy past /media/5/Conky/images/red+x.png from my file manager - I know it off the top of my head now so I type it.  Faster than opening a file manger cruising to the directory and highlighting the file copying it and then pasting it in my text editor.  big_smile

Last edited by Sector11 (2013-02-24 17:42:33)

Online

#4816 2013-02-25 12:43:24

schwim
#! Die Hard
From: Interweb's #1 Devotee
Registered: 2012-10-11
Posts: 713
Website

Re: The New Monster Conky Thread

Hi there everyone!

I've installed Openbox on an Ubu 12.10 minimal install. I've also installed xcompmgr and conky. The issue I'm having is that the very same conky config that gives me partial transparency in #! is only giving me full transparency in my Ubu install.

I installed xcompmgr and am starting it with the following options:

xcompmgr -cfF -t-9 -l-11 -r9 -o.95 -D6 &

And here's my conky:

background yes
use_xft yes
xftfont Liberation Sans:size=9
xftalpha 1
update_interval 1.0
total_run_times 0
own_window yes
own_window_transparent yes
own_window_type desktop
own_window_argb_visual yes
own_window_argb_value 150
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
double_buffer yes
draw_shades yes
draw_outline no
draw_borders no
draw_graph_borders no
# default_color 808080
default_color ff8000
default_shade_color 000000
default_outline_color 828282
alignment top_right
gap_x 8
gap_y 40
no_buffers yes
uppercase no
cpu_avg_samples 2
override_utf8_locale no
maximum_width 200
minimum_size 200 965
##############################################
# Output
##############################################
.... stuff....

I've tried swapping some options but nothing seems to allow own_window_argb_value to set a partial transparency.

Does anyone have any idea what I might be able to do to get it?

Thanks for your time!

Offline

#4817 2013-02-25 14:32:48

PackRat
#! Die Hard
From: USA
Registered: 2011-03-03
Posts: 1,396

Re: The New Monster Conky Thread

try it with:

own_window_transparent no

and let the compositor handle the transparency.

More about transparency here.

if that doesn't work, maybe post your question with the conkyrc in the #! Monster Conky Thread where it will get more views.

Were you using xcompmgr in #! as well, or was that compton (or it's predecessor)? You may need to install compton.

Last edited by PackRat (2013-02-25 14:39:27)


"It does not require many words to speak the truth." - Chief Joseph, Nez Perce tribe

Offline

#4818 2013-02-25 15:02:04

schwim
#! Die Hard
From: Interweb's #1 Devotee
Registered: 2012-10-11
Posts: 713
Website

Re: The New Monster Conky Thread

Thanks a bunch for the reply packrat!  Unfortunately, modifying to reflect "yes" caused conky to disappear completely off-screen and all windows kind of fell apart, losing their content, menus and handles.  Moving the mouse around caused it to return, so I was able to revert the change immediately.



I will try compton instead of xcompmgr and see if that resolves my issue.  Thanks a bunch for your time!

Offline

#4819 2013-02-25 15:26:25

schwim
#! Die Hard
From: Interweb's #1 Devotee
Registered: 2012-10-11
Posts: 713
Website

Re: The New Monster Conky Thread

Well, that didn't seem to change anything. I stole cb-compositor and compton.conf from the #! install and it's still not acting in the same manner.

Offline

#4820 2013-02-25 17:17:30

jed
#! CrunchBanger
From: Detachment 7
Registered: 2012-08-28
Posts: 193
Website

Re: The New Monster Conky Thread

After a lot of tweaking and a little help from the master, Sector11, finally got it how I want it.  Credits to McLovin for the bargraph.lua used in the left hand Conky, and to mrpeachy, for his mounted.lua, and also on the right side his v9000 weather script.  Bottom right credits to VastOne, for the gmail parser and the awesome GMB Layouts!  And thanks also to jst_joe, for getting rid of the green and replacing it with blue, in my favorite wallpaper!  You'll need some fonts as well...  Google is your friend!

finalconky1.png

system conky;

######################
# - Conky settings - #
# -Based on a conky- #
# -by McLovins Bars- #
######################

background no
update_interval 1
cpu_avg_samples 2
total_run_times 0
override_utf8_locale yes
 
double_buffer yes
#no_buffers yes
 
text_buffer_size 10240
imlib_cache_size 10240

minimum_size 300 1080
maximum_width 300

gap_x 15
gap_y 5
#####################
# - Text settings - #
#####################
use_xft yes
xftfont Santana:size=10
xftalpha .8
 
uppercase no

# Text alignment, other possible values are commented
#alignment middle_left
#alignment middle_middle
#alignment middle_right
#alignment top_middle
alignment top_left
#alignment top_right
#alignment bottom_left
#alignment bottom_right
#alignment bottom_middle

######################
# - Color settings - #
######################
color0 c3c3c3 #mid gray
color1 FF0000 #red
color2 A4FFA4 #light green
color3 007EFF #bright blue
color4 E3E3E3 #very light gray
color5 c6771a #an orange shade
color6 CA8718 #a dust like color
color7 FFE500 #a darker yellow color
color8 C3FF00 #lime green
color9 227992 #bars-blue #another blue 48a3fd
default_color c3c3c3
default_shade_color gray
default_outline_color black
#############################
# - Window specifications - #
#############################
own_window yes
own_window_transparent yes
own_window_type normal
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
own_window_class conky-semi
own_window_title clicky
#own_window_argb_visual yes
#own_window_argb_value 255

border_inner_margin 0
border_outer_margin 0

#########################
# - Graphics settings - #
#########################
draw_shades no
draw_outline no
draw_borders no
stippled_borders 0
draw_graph_borders no

####
## Load Lua for bargraphs (required)
## Set the path to your script here.
#
#lua_load ~/conky/draw-bg.lua
lua_load ~/conky/bargraph.lua
lua_draw_hook_pre main_bars
lua_load ~/conky/LUA/mounted.lua
TEXT
${lua get_mounted_data 3}#${lua conky_draw_bg 10 0 0 0 0 0x363636 0.4}
#${alignc}SYSTEM
${goto 6}${voffset 4}${color 547EC8}${font xspiralmental:size=14}G${color}${font}${voffset -4}${goto 32}Distro:${alignr}${execi 2600 cat /etc/issue.net}-VSIDO
${goto 6}${voffset 4}${color 547EC8}${font xspiralmental:size=14}Z${color}${font}${voffset -4}${goto 32}Kernel:${alignr}${kernel} (${execi 3600 uname -m})
${goto 6}${voffset 4}${color 547EC8}${font StyleBats:size=14}o${color}${font}${voffset -4}${goto 32}Uptime:${alignr}${uptime}
${goto 6}${voffset 4}${color 547EC8}${font StyleBats:size=16}q${color}${font}${voffset -4}${goto 32}Processes:${alignr}${processes} ($running_processes running)
#${goto 6}${voffset 5}${font PizzaDude Bullets:size=14}J${font}${voffset -4}${goto 32}${voffset -4}Security updates: ${goto 285}${execi 600 /usr/lib/update-notifier/apt-check 2>&1 |cut -d ';' -f 1}
#${goto 32}Normal updates: ${goto 285}${execi 600 /usr/lib/update-notifier/apt-check 2>&1 |cut -d ';' -f 2}
${color 547EC8}${hr}${color}
${goto 6}${color 951C1C}${font Weather:size=22}x${color}${font}${goto 32}${voffset -2}Motherboard Temp: ${alignr}${hwmon temp 1}º C${font}
${goto 6}${color 951C1C}${font Weather:size=22}x${color}${font}${goto 32}${voffset -2}CPU Socket Temp: ${alignr}${hwmon temp 2}º C${font}
#${goto 6}${color 547EC8}${font PizzaDude Bullets:size=16}e${color}${font}${goto 32}${voffset -2}Physical CPU Temp: ${alignr}${hwmon temp 3}º C${font}
${color 547EC8}${hr}${color}
${goto 46}${color 547EC8}${font Poky:size=14}P${color}${voffset}${font}${voffset -4}${goto 28}${alignc}${execi 1000 cat /proc/cpuinfo | egrep -m 'model name' | sed -e 's/model name.*: //' | cut -c41-47} ${exec cat /proc/cpuinfo | egrep -m 1 'model name' | sed -e 's/model name.*: //' | cut -c1-5} ${exec cat /proc/cpuinfo | egrep -m 1 'model name' | sed -e 's/model name.*: //' | cut -c10-13}-${exec cat /proc/cpuinfo | egrep -m 1 'model name' | sed -e 's/model name.*: //' | cut -c19-20} ${exec cat /proc/cpuinfo | egrep -m 1 'model name' | sed -e 's/model name.*: //' | cut -c28-49}
${goto 70}${color 951C1C}${font Weather:size=22}x${color}${font}${voffset -4}${goto 85}Physical CPU Temp: ${alignr}${goto 200}${hwmon temp 3}º C${font}
${alignc}Avg Usage of Quad Core CPU: ${cpu cpu0}%
${alignc}Load:  ${loadavg}
${goto 83}${color 951C1C}${font Weather:size=22}x${color}${font}${goto 32}${voffset -4}${alignc}Core 1 Temp: ${execi 10 sensors | grep "Core 1" | cut -d "+" -f2 | cut -c1-2}º C
${goto 6}${color 547EC8}${font Poky:size=14}P${color}${font}${voffset -4}${goto 28}CPU1: ${freq_g 1}Gh ${alignr}${cpu cpu1}%
${goto 6}${color 547EC8}${font Poky:size=14}P${color}${font}${voffset -4}${goto 28}CPU2: ${freq_g 2}Gh ${alignr}${cpu cpu2}%
${goto 83}${color 951C1C}${font Weather:size=22}x${color}${font}${goto 32}${voffset -4}${alignc}Core 2 Temp: ${execi 10 sensors | grep "Core 2" | cut -d "+" -f2 | cut -c1-2}º C
${goto 6}${color 547EC8}${font Poky:size=14}P${color}${font}${voffset -4}${goto 28}CPU3: ${freq_g 3}Gh ${alignr}${cpu cpu3}%
${goto 6}${color 547EC8}${font Poky:size=14}P${color}${font}${voffset -4}${goto 28}CPU4: ${freq_g 4}Gh ${alignr}${cpu cpu4}%
${goto 83}${color 951C1C}${font Weather:size=22}x${color}${font}${goto 32}${voffset -4}${alignc}Core 3 Temp: ${execi 10 sensors | grep "Core 3" | cut -d "+" -f2 | cut -c1-2}º C
${goto 6}${color 547EC8}${font Poky:size=14}P${color}${font}${voffset -4}${goto 28}CPU5: ${freq_g 5}Gh ${alignr}${cpu cpu5}%
${goto 6}${color 547EC8}${font Poky:size=14}P${color}${font}${voffset -4}${goto 28}CPU6: ${freq_g 6}Gh ${alignr}${cpu cpu6}%
${goto 83}${color 951C1C}${font Weather:size=22}x${color}${font}${goto 32}${voffset -4}${alignc}Core 4 Temp: ${execi 10 sensors | grep "Core 0" | cut -d "+" -f2 | cut -c1-2}º C
${goto 6}${color 547EC8}${font Poky:size=14}P${color}${font}${voffset -4}${goto 28}CPU7: ${freq_g 7}Gh ${alignr}${cpu cpu7}%
${goto 6}${color 547EC8}${font Poky:size=14}P${color}${font}${voffset -4}${goto 28}CPU8: ${freq_g 8}Gh ${alignr}${cpu cpu8}%

${goto 66}${voffset 4}${color 547EC8}${font Poky:size=14}M${color}${font}${voffset -8}${goto 32}${alignc}Used RAM: ${mem}${voffset -4}
${voffset 4}${goto 32}${alignc}Total RAM: ${memmax}
${voffset}${goto 32}${alignc}Swap:  ${swap} ${color}/ ${color}${swapmax}

${goto 7.5}${voffset 4}${color 547EC8}${font Poky:size=15}a${color}${font}${goto 32}${voffset -10}Highest:${goto 153}CPU${alignr}RAM
${goto 32}${voffset -5.5}${color 547EC8}${hr}${color}
${voffset -1}${goto 32}${top name 1} ${goto 150}${top cpu 1}${alignr }${top mem 1}
${voffset -1}${goto 32}${top name 2} ${goto 150}${top cpu 2}${alignr }${top mem 2}
${voffset -1}${goto 32}${top name 3} ${goto 150}${top cpu 3}${alignr }${top mem 3}
${voffset -1}${goto 32}${top name 4} ${goto 150}${top cpu 4}${alignr }${top mem 4}

#${voffset -1}${alignc}   SSD 
FSYS${color} = ${lua mount 1 total}${goto 100}${color8}SIZE${goto 150}${color7}FREE${goto 200}${color1}USED${goto 255}${color}MOUNT
${voffset -5} ${color 547EC8}${stippled_hr 5 1}${color}
 ${color6}${lua mount 1 fsys 9}${goto 100}${color8}${lua mount 1 size}${goto 150}${color7}${lua mount 1 free}${goto 200}${color1}${lua mount 1 use%}${goto 260}${color}${lua mount 1 mount}
 ${color6}${lua mount 2 fsys 9}${goto 100}${color8}${lua mount 2 size}${goto 150}${color7}${lua mount 2 free}${goto 200}${color1}${lua mount 2 use%}${goto 260}${color}${lua mount 2 mount}
 ${color6}${lua mount 3 fsys 9}${goto 100}${color8}${lua mount 3 size}${goto 150}${color7}${lua mount 3 free}${goto 200}${color1}${lua mount 3 use%}${goto 260}${color}${lua mount 3 mount}
 ${color6}${lua mount 4 fsys 9}${goto 100}${color8}${lua mount 4 size}${goto 150}${color7}${lua mount 4 free}${goto 200}${color1}${lua mount 4 use%}${goto 260}${color}${lua mount 4 mount}
${goto 3}${color 547EC8}${font Martin Vogel's Symbols:size=20}h${color}${font}${voffset -4}${goto 32}Disk I/O: ${diskio}${alignr}${voffset -10}${diskiograph 18,160 00D7FF FF452A -l -t}

${alignc}  NETWORK      ${alignr}${gw_iface} ${voffset -3}
${color 547EC8}${font PizzaDude Bullets:size=16}M${color}${font}${goto 32}${voffset -4}Upload Speed: ${upspeedf wlan0}${font}${alignr}Total: ${totalup wlan0}
${color 547EC8}${font PizzaDude Bullets:size=16}S${color}${font}${goto 32}${voffset -4}Download Speed: ${downspeedf wlan0}${font}${goto 32}${alignr}Total: ${totaldown wlan0}

${color 547EC8}${font Poky:size=16}w${color}${font}${goto 32}${voffset -20}Router IP: ${alignr}${gw_ip}
${goto 32}Local IP:  ${alignr}${addr wlan0}
${goto 32}Public IP: ${alignr}${execi 300 wget -q -O - checkip.dyndns.org | sed -e 's/.*Current IP Address: //' -e 's/<.*$//'}
${goto 32}Signal : ${alignr}${wireless_link_qual_perc wlan0}%

${color 547EC8}${font Poky:size=19}Q${color}${font}${goto 32}${voffset -9}Battery${alignr}${battery_percent BAT1}%
${alignc}${battery_time BAT1}
${color 547EC8}${stippled_hr 5 1}${color}
${color 547EC8}${font Poky:size=16}q${color}${font}${goto 32}${voffset -4}Updates${execpi 3600 ~/conky/header.sh}
${color 547EC8}${hr}${color}
 ${alignc}${color 547EC8}Live:  ${color}${execpi 900 conkyEmail --servertype=POP --servername=pop3.live.com --ssl --username=youremail --password=yourpassword --mailinfo=0}
 ${alignc}${color 547EC8}Hotmail:  ${color}${execpi 900 conkyEmail --servertype=POP --servername=pop3.live.com --ssl --username=youremail --password=yourpassword --mailinfo=0}

mounted.lua

--[[partitions for conky by mrpeachy

##instructions
##load script
lua_load ~/lua/mounted.lua
## first lua command below text:
## ${lua get_mounted_data interval}, where interval is a number.  This starts data gathering
## to get output:
## ${lua mount partition_number data_type text_length}, where partition number is a number
## text_length is optional, lets you specify the max number of characters the function returns. only affects fsys and mount data options
## data_type can be
## total - shows total number of partitions mounted, requires a partition_number also, use 1, could be used in an if_match
## fsys - shows filesystem
## size - shows space used in appropriate units
## free - shows free space in appropriate units
## use% - shows % used
## mount - shows mountpoint

TEXT
CPU %: ${cpu cpu0} ${lua get_mounted_data 10}
TOTAL PARTITIONS MOUNTED: ${lua mount 1 total}
FSYS${goto 100}SIZE${goto 200}USED%${goto 300}MOUNT
${lua mount 1 fsys}${goto 100}${lua mount 1 size}${goto 200}${lua mount 1 use%}${goto 300}${lua mount 1 mount 10}
${lua mount 2 fsys}${goto 100}${lua mount 2 size}${goto 200}${lua mount 2 use%}${goto 300}${lua mount 2 mount 10}
${lua mount 3 fsys}${goto 100}${lua mount 3 size}${goto 200}${lua mount 3 use%}${goto 300}${lua mount 3 mount 10}
${lua mount 4 fsys}${goto 100}${lua mount 4 size}${goto 200}${lua mount 4 use%}${goto 300}${lua mount 4 mount 10}

]]

conky_start=1
function conky_get_mounted_data(interval)
local updates=tonumber(conky_parse("${updates}"))
timer=(updates % interval)
if timer==0 or conky_start==1 then
fsys={}
size={}
used={}
avail={}
uperc={}
mount={}
local file = io.popen("df -h")
	for line in file:lines() do
		if string.find(line,"/dev/")~=nil then
		local s,f,fs=string.find(line,"^([%d%a%p]*)%s")
		table.insert(fsys,fs)
		local s,f,sz=string.find(line,"%s*([%d%a%p]*)%s",f)
		table.insert(size,sz)
		local s,f,us=string.find(line,"%s*([%d%a%p]*)%s",f)
		table.insert(used,us)
		local s,f,av=string.find(line,"%s*([%d%a%p]*)%s",f)
		table.insert(avail,av)
		local s,f,up=string.find(line,"%s*([%d%a%p]*)%s",f)
		table.insert(uperc,up)
		local s,f,mn=string.find(line,"%s*([%d%a%p]*)%s*$",f)
		table.insert(mount,mn)
		end
	end
file:close()
conky_start=nil
end--timed section
return ""
end

function conky_mount(n,d,c)--n=partition_number,d=data_type,c=number of characters to return
d=tostring(d)
n=tonumber(n)
c=tonumber(c) or 0
if d=="total" then
data=#fsys or 1
elseif d=="fsys" then
data=fsys[n] or ""
	if c~=0 then
	data=string.sub(data,1,c) or ""
	end
elseif d=="size" then
data=size[n] or ""
elseif d=="used" then
data=used[n] or ""
elseif d=="free" then
data=avail[n] or ""
elseif d=="use%" then
data=uperc[n] or ""
elseif d=="mount" then
data=mount[n] or ""
	if c~=0 then
	data=string.sub(data,1,c) or ""
	end
else
data="check data type"
end
return data
end--end main function

bargraph.lua

--[[ BARGRAPH WIDGET
	To call the script in a conky, use, before TEXT
	lua_load /path/to/the/script/bargraph.lua
	lua_draw_hook_pre main_rings
        and add one line (blank or not) after TEXT

	
Parameters are :
3 parameters are mandatory
name	- the name of the conky variable to display, for example for {$cpu cpu0}, just write name="cpu"
arg		- the argument of the above variable, for example for {$cpu cpu0}, just write arg="cpu0"
		  arg can be a numerical value if name=""
max		- the maximum value the above variable can reach, for example, for {$cpu cpu0}, just write max=100
	
Optional parameters:
x,y		- coordinates of the starting point of the bar, default = middle of the conky window
cap		- end of cap line, ossibles values are r,b,s (for round, butt, square), default="b"
		  http://www.cairographics.org/samples/set_line_cap/
angle	- angle of rotation of the bar in degress, default = 0 (i.e. a vertical bar)
		  set to 90 for an horizontal bar
skew_x	- skew bar around x axis, default = 0
skew_y	- skew bar around y axis, default = 0
blocks  - number of blocks to display for a bar (values >0) , default= 10
height	- height of a block, default=10 pixels
width	- width of a block, default=20 pixels
space	- space between 2 blocks, default=2 pixels
angle_bar	- this angle is used to draw a bar on a circular way (ok, this is no more a bar !) default=0
radius		- for cicular bars, internal radius, default=0
			  with radius, parameter width has no more effect.

Colours below are defined into braces {colour in hexadecimal, alpha}
fg_colour	- colour of a block ON, default= {0x00FF00,1}
bg_colour	- colour of a block OFF, default = {0x00FF00,0.5}
alarm		- threshold, values after this threshold will use alarm_colour colour , default=max
alarm_colour - colour of a block greater than alarm, default=fg_colour
smooth		- (true or false), create a gradient from fg_colour to bg_colour, default=false 
mid_colour	- colours to add to gradient, with this syntax {position into the gradient (0 to1), colour hexa, alpha}
			  for example, this table {{0.25,0xff0000,1},{0.5,0x00ff00,1},{0.75,0x0000ff,1}} will add
			  3 colurs to gradient created by fg_colour and alarm_colour, default=no mid_colour
led_effect	- add LED effects to each block, default=no led_effect
			  if smooth=true, led_effect is not used
			  possibles values : "r","a","e" for radial, parallelel, perdendicular to the bar (just try!)
			  led_effect has to be used with theses colours :
fg_led		- middle colour of a block ON, default = fg_colour
bg_led		- middle colour of a block OFF, default = bg_colour
alarm_led	- middle colour of a block > ALARM,  default = alarm_colour

reflection parameters, not avaimable for circular bars
reflection_alpha    - add a reflection effect (values from 0 to 1) default = 0 = no reflection
                      other values = starting opacity
reflection_scale    - scale of the reflection (default = 1 = height of text)
reflection_length   - length of reflection, define where the opacity will be set to zero
					  calues from 0 to 1, default =1
reflection			- position of reflection, relative to a vertical bar, default="b"
					  possibles values are : "b","t","l","r" for bottom, top, left, right
draw_me     - if set to false, text is not drawn (default = true or 1)
              it can be used with a conky string, if the string returns 1, the text is drawn :
              example : "${if_empty ${wireless_essid wlan0}}${else}1$endif",
]]

require 'cairo'

----------------START OF PARAMETERS ----------
function conky_main_bars()
	local bars_settings={
		{	--[ Graph for MOBO Temp ]--
			name="hwmon temp 1",
			arg="hwmon temp 1",
			max=100,
			alarm=100,
			bg_colour={0x000000,0.75},
			bg_led={0x3c3c3c,0.5},
			fg_colour={0x000000,1},
			fg_led={0x48a3fd,1},
			alarm_colour={0xff0000,0},
		    alarm_led={0xff0000,1},
			blocks=35,
			x=158, y=106,
			height=2,width=10,
			angle=90,
			led_effect="e",
			space=1,
			cap="r",
			},	
		{	--[ Graph for CPU Socket Temp ]--
			name="hwmon temp 2",
			arg="hwmon temp 2",
			max=100,
			alarm=100,
			bg_colour={0x000000,0.75},
			bg_led={0x3c3c3c,0.5},
			fg_colour={0x000000,1},
			fg_led={0x48a3fd,1},
			alarm_colour={0xff0000,0},
		    alarm_led={0xff0000,1},
			blocks=35,
			x=158, y=133,
			height=2,width=10,
			angle=90,
			led_effect="e",
			space=1,
			cap="r",
			},	
--[[		{	--[ Graph for Physical CPU Temp ]--
			name="hwmon temp 3",
			arg="hwmon temp 3",
			max=100,
			alarm=100,
			bg_colour={0x000000,0.75},
			bg_led={0x3c3c3c,0.5},
			fg_colour={0x000000,1},
			fg_led={0x48a3fd,1},
			alarm_colour={0xff0000,0},
		    alarm_led={0xff0000,1},
			blocks=35,
			x=158, y=133,
			height=2,width=10,
			angle=90,
			led_effect="e",
			space=1,
			cap="r",
			},	
]]		{	--[ Graph for CPU1 Left ]--
			name="cpu",
			arg="cpu1",
			max=100,
			alarm=60,
			bg_colour={0x000000,0.75},
			bg_led={0x3c3c3c,0.5},
			fg_colour={0x000000,1},
			fg_led={0x48a3fd,1},--color was 2a95b4
			alarm_colour={0xff0000,0},
		    alarm_led={0xff0000,1},
			blocks=17,
			x=187, y=275,
			height=3,width=7,
			angle=273,
			led_effect="e",
			space=1,
			cap="r",
			},
		{	--[ Graph for CPU1 Right ]--
			name="cpu",
			arg="cpu1",
			max=100,
			alarm=60,
			bg_colour={0x000000,0.75},
			bg_led={0x3c3c3c,0.5},
			fg_colour={0x000000,1},
			fg_led={0x48a3fd,1},
			alarm_colour={0xff0000,0},
		    alarm_led={0xff0000,1},
			blocks=17,
			x=185, y=268,
			height=3,width=7,
			angle=90,
			led_effect="e",
			space=1,
			cap="r",
			},
		{	--[ Graph for CPU2 Left]--
			name="cpu",
			arg="cpu2",
			max=100,
			alarm=60,
			bg_colour={0x000000,0.75},
			bg_led={0x3c3c3c,0.5},
			fg_colour={0x000000,1},
			fg_led={0x48a3fd,1},
			alarm_colour={0xff0000,0},
		    alarm_led={0xff0000,1},
			blocks=17,
			x=187, y=292,
			height=3,width=7,
			angle=270,
			led_effect="e",
			space=1,
			cap="r",
			},
		{	--[ Graph for CPU2 Right]--
			name="cpu",
			arg="cpu2",
			max=100,
			alarm=60,
			bg_colour={0x000000,0.75},
			bg_led={0x3c3c3c,0.5},
			fg_colour={0x000000,1},
			fg_led={0x48a3fd,1},
			alarm_colour={0xff0000,0},
		    alarm_led={0xff0000,1},
			blocks=17,
			x=185, y=285,
			height=3,width=7,
			angle=90,
			led_effect="e",
			space=1,
			cap="r",
			},
		{	--[ Graph for CPU3 Left ]--
			name="cpu",
			arg="cpu3",
			max=100,
			alarm=60,
			bg_colour={0x000000,0.75},
			bg_led={0x3c3c3c,0.5},
			fg_colour={0x000000,1},
			fg_led={0x48a3fd,1},
			alarm_colour={0xff0000,0},
		    alarm_led={0xff0000,1},
			blocks=17,
			x=187, y=337,
			height=3,width=7,
			angle=270,
			led_effect="e",
			space=1,
			cap="r",
			},
		{	--[ Graph for CPU3 Right ]--
			name="cpu",
			arg="cpu3",
			max=100,
			alarm=60,
			bg_colour={0x000000,0.75},
			bg_led={0x3c3c3c,0.5},
			fg_colour={0x000000,1},
			fg_led={0x48a3fd,1},
			alarm_colour={0xff0000,0},
		    alarm_led={0xff0000,1},
			blocks=17,
			x=185, y=330,
			height=3,width=7,
			angle=90,
			led_effect="e",
			space=1,
			cap="r",
			},
		{	--[ Graph for CPU4 Left ]--
			name="cpu",
			arg="cpu4",
			max=100,
			alarm=60,
			bg_colour={0x000000,0.75},
			bg_led={0x3c3c3c,0.5},
			fg_colour={0x000000,1},
			fg_led={0x48a3fd,1},
			alarm_colour={0xff0000,0},
		    alarm_led={0xff0000,1},
			blocks=17,
			x=187, y=356,
			height=3,width=7,
			angle=270,
			led_effect="e",
			space=1,
			cap="r",
			},
		{	--[ Graph for CPU4 Right ]--
			name="cpu",
			arg="cpu4",
			max=100,
			alarm=60,
			bg_colour={0x000000,0.75},
			bg_led={0x3c3c3c,0.5},
			fg_colour={0x000000,1},
			fg_led={0x48a3fd,1},
			alarm_colour={0xff0000,0},
		    alarm_led={0xff0000,1},
			blocks=17,
			x=185, y=349,
			height=3,width=7,
			angle=90,
			led_effect="e",
			space=1,
			cap="r",
			},
		{	--[ Graph for CPU5 Left ]--
			name="cpu",
			arg="cpu5",
			max=100,
			alarm=60,
			bg_colour={0x000000,0.75},
			bg_led={0x3c3c3c,0.5},
			fg_colour={0x000000,1},
			fg_led={0x48a3fd,1},
			alarm_colour={0xff0000,0},
		    alarm_led={0xff0000,1},
			blocks=17,
			x=187, y=401,
			height=3,width=7,
			angle=270,
			led_effect="e",
			space=1,
			cap="r",
			},
		{	--[ Graph for CPU5 Right ]--
			name="cpu",
			arg="cpu5",
			max=100,
			alarm=60,
			bg_colour={0x000000,0.75},
			bg_led={0x3c3c3c,0.5},
			fg_colour={0x000000,1},
			fg_led={0x48a3fd,1},
			alarm_colour={0xff0000,0},
		    alarm_led={0xff0000,1},
			blocks=17,
			x=185, y=394,
			height=3,width=7,
			angle=90,
			led_effect="e",
			space=1,
			cap="r",
			},
		{	--[ Graph for CPU6 Left ]--
			name="cpu",
			arg="cpu6",
			max=100,
			alarm=60,
			bg_colour={0x000000,0.75},
			bg_led={0x3c3c3c,0.5},
			fg_colour={0x000000,1},
			fg_led={0x48a3fd,1},
			alarm_colour={0xff0000,0},
		    alarm_led={0xff0000,1},
			blocks=17,
			x=187, y=420,
			height=3,width=7,
			angle=270,
			led_effect="e",
			space=1,
			cap="r",
			},
		{	--[ Graph for CPU6 Right ]--
			name="cpu",
			arg="cpu6",
			max=100,
			alarm=60,
			bg_colour={0x000000,0.75},
			bg_led={0x3c3c3c,0.5},
			fg_colour={0x000000,1},
			fg_led={0x48a3fd,1},
			alarm_colour={0xff0000,0},
		    alarm_led={0xff0000,1},
			blocks=17,
			x=185, y=413,
			height=3,width=7,
			angle=90,
			led_effect="e",
			space=1,
			cap="r",
			},
		{	--[ Graph for CPU7 Left ]--
			name="cpu",
			arg="cpu7",
			max=100,
			alarm=60,
			bg_colour={0x000000,0.75},
			bg_led={0x3c3c3c,0.5},
			fg_colour={0x000000,1},
			fg_led={0x48a3fd,1},
			alarm_colour={0xff0000,0},
		    alarm_led={0xff0000,1},
			blocks=17,
			x=187, y=466,
			height=3,width=7,
			angle=270,
			led_effect="e",
			space=1,
			cap="r",
			},
		{	--[ Graph for CPU7 Right ]--
			name="cpu",
			arg="cpu7",
			max=100,
			alarm=60,
			bg_colour={0x000000,0.75},
			bg_led={0x3c3c3c,0.5},
			fg_colour={0x000000,1},
			fg_led={0x48a3fd,1},
			alarm_colour={0xff0000,0},
		    alarm_led={0xff0000,1},
			blocks=17,
			x=185, y=459,
			height=3,width=7,
			angle=90,
			led_effect="e",
			space=1,
			cap="r",
			},
		{	--[ Graph for CPU8 Left ]--
			name="cpu",
			arg="cpu8",
			max=100,
			alarm=60,
			bg_colour={0x000000,0.75},
			bg_led={0x3c3c3c,0.5},
			fg_colour={0x000000,1},
			fg_led={0x48a3fd,1},
			alarm_colour={0xff0000,0},
		    alarm_led={0xff0000,1},
			blocks=17,
			x=187, y=485,
			height=3,width=7,
			angle=270,
			led_effect="e",
			space=1,
			cap="r",
			},
		{	--[ Graph for CPU8 Right ]--
			name="cpu",
			arg="cpu8",
			max=100,
			alarm=60,
			bg_colour={0x000000,0.75},
			bg_led={0x3c3c3c,0.5},
			fg_colour={0x000000,1},
			fg_led={0x48a3fd,1},
			alarm_colour={0xff0000,0},
		    alarm_led={0xff0000,1},
			blocks=17,
			x=185, y=478,
			height=3,width=7,
			angle=90,
			led_effect="e",
			space=1,
			cap="r",
			},
		{	--[ Graph for Memory ]--
			name="memperc",
			arg="",
			max=100,
			alarm=60,
			bg_colour={0x000000,0.75},
			bg_led={0x3c3c3c,0.5},
			fg_colour={0x000000,1},
			fg_led={0x48a3fd,1},
			alarm_colour={0xff0000,0},
		    alarm_led={0xff0000,1},
			x=63,y=550,
			blocks=89,
			space=0,
			height=2,width=12,
			angle=90,
			led_effect="e",
			cap="r",
			},
--[[		{	--[ Graph for Root ]--
			name="fs_used_perc",
			arg="/",
			max=100,
			alarm=75,
			bg_colour={0x000000,0.75},
			bg_led={0x3c3c3c,0.5},
			fg_colour={0x000000,1},
			fg_led={0x48a3fd,1},
			alarm_colour={0xff0000,0},
		    alarm_led={0xff0000,1},
			blocks=92,
			x=65, y=500,
			height=2,width=10,
			angle=90,
			led_effect="e",
			space=0,
			cap="r",
			},	
		{	--[ Graph for Home ]--
			name="fs_used_perc",
			arg="/home",
			max=100,
			alarm=75,
			bg_colour={0x000000,0.75},
			bg_led={0x3c3c3c,0.5},
			fg_colour={0x000000,1},
			fg_led={0x48a3fd,1},
			alarm_colour={0xff0000,0},
		    alarm_led={0xff0000,1},
			blocks=92,
			x=65, y=557,
			height=2,width=10,
			angle=90,
			led_effect="e",
			space=0,
			cap="r",
			},	
]]		{	--[ Graph for WiFi Signal strength ]--
			name="wireless_link_qual_perc",
			arg="wlan0",
			max=100,
			alarm=100,
			bg_colour={0x000000,0.75},
			bg_led={0x3c3c3c,0.5},
			fg_colour={0x000000,1},
			fg_led={0x48a3fd,1},
			alarm_colour={0xff0000,0},
		    alarm_led={0xff0000,1},
			blocks=62,
			x=78, y=880,
			height=2,width=10,
			angle=90,
			led_effect="e",
			space=1,
			cap="r",
			},	
		{	--[ Graph for Battery power ]--
			name="battery_percent",
			arg="BAT1",
			max=100,
			alarm=100,
			bg_colour={0x000000,0.75},
			bg_led={0x3c3c3c,0.5},
			fg_colour={0x000000,1},
			fg_led={0x48a3fd,1},
			alarm_colour={0xff0000,0},
		    alarm_led={0xff0000,1},
			blocks=60,
			x=80, y=916,
			height=2,width=10,
			angle=90,
			led_effect="e",
			space=1,
			cap="r",
			},	
		 }
-----------END OF PARAMETERS--------------


    
	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)    
	--prevent segmentation error when reading cpu state
    if tonumber(conky_parse('${updates}'))>3 then
        for i in pairs(bars_settings) do
        	
        	draw_multi_bar_graph(bars_settings[i])
        	
        end
    end
	cairo_destroy(cr)
	cairo_surface_destroy(cs)
	cr=nil

end



function draw_multi_bar_graph(t)
	cairo_save(cr)
	--check values
	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	
	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'")
		return
	end
	if t.name==nil then t.name="" end
	if t.arg==nil then t.arg="" end

	--set default values	
	if t.x == nil		then t.x = conky_window.width/2 end
	if t.y == nil		then t.y = conky_window.height/2 end
	if t.blocks == nil	then t.blocks=10 end
	if t.height == nil	then t.height=10 end
	if t.angle == nil 	then t.angle=0 end
	t.angle = t.angle*math.pi/180
	--line cap style
	if t.cap==nil		then t.cap = "b" end
	local cap="b"
	for i,v in ipairs({"s","r","b"}) do 
		if v==t.cap then cap=v end
	end
	local delta=0
	if t.cap=="r" or t.cap=="s" then delta = t.height end
	if cap=="s" then 	cap = CAIRO_LINE_CAP_SQUARE
	elseif cap=="r" then
		cap = CAIRO_LINE_CAP_ROUND
	elseif cap=="b" then
		cap = CAIRO_LINE_CAP_BUTT
	end
	--end line cap style
	--if t.led_effect == nil	then t.led_effect="r" end
	if t.width == nil	then t.width=20 end
	if t.space == nil	then t.space=2 end
	if t.radius == nil	then t.radius=0 end
	if t.angle_bar == nil	then t.angle_bar=0 end
	t.angle_bar = t.angle_bar*math.pi/360 --halt angle
	
	--colours
	if t.bg_colour == nil 	then t.bg_colour = {0x00FF00,0.5} end
	if #t.bg_colour~=2 		then t.bg_colour = {0x00FF00,0.5} end
	if t.fg_colour == nil 	then t.fg_colour = {0x00FF00,1} end
	if #t.fg_colour~=2 		then t.fg_colour = {0x00FF00,1} end
	if t.alarm_colour == nil 	then t.alarm_colour = t.fg_colour end
	if #t.alarm_colour~=2 		then t.alarm_colour = t.fg_colour end

	if t.mid_colour ~= nil then	
		for i=1, #t.mid_colour do    
		    if #t.mid_colour[i]~=3 then 
		    	print ("error in mid_color table")
		    	t.mid_colour[i]={1,0xFFFFFF,1} 
		    end
		end
    end
    
	if t.bg_led ~= nil and #t.bg_led~=2	then t.bg_led = t.bg_colour end
	if t.fg_led ~= nil and #t.fg_led~=2	then t.fg_led = t.fg_colour end
	if t.alarm_led~= nil and #t.alarm_led~=2 then t.alarm_led = t.fg_led end
	
	if t.led_effect~=nil then
		if t.bg_led == nil then t.bg_led = t.bg_colour end
		if t.fg_led == nil 	then t.fg_led = t.fg_colour end
		if t.alarm_led == nil  then t.alarm_led = t.fg_led end
	end
	

	if t.alarm==nil then t.alarm = t.max end --0.8*t.max end
	if t.smooth == nil then t.smooth = false end

	if t.skew_x == nil then 
		t.skew_x=0 
	else
		t.skew_x = math.pi*t.skew_x/180	
	end
	if t.skew_y == nil then 
		t.skew_y=0
	else
		t.skew_y = math.pi*t.skew_y/180	
	end
	
	if t.reflection_alpha==nil then t.reflection_alpha=0 end
	if t.reflection_length==nil then t.reflection_length=1 end
	if t.reflection_scale==nil then t.reflection_scale=1 end
	
	--end of default values
	

 	local function rgb_to_r_g_b(col_a)
		return ((col_a[1] / 0x10000) % 0x100) / 255., ((col_a[1] / 0x100) % 0x100) / 255., (col_a[1] % 0x100) / 255., col_a[2]
	end
	
	
	--functions used to create patterns

	local function create_smooth_linear_gradient(x0,y0,x1,y1)
		local pat = cairo_pattern_create_linear (x0,y0,x1,y1)
		cairo_pattern_add_color_stop_rgba (pat, 0, rgb_to_r_g_b(t.fg_colour))
		cairo_pattern_add_color_stop_rgba (pat, 1, rgb_to_r_g_b(t.alarm_colour))
		if t.mid_colour ~=nil then
			for i=1, #t.mid_colour do
				cairo_pattern_add_color_stop_rgba (pat, t.mid_colour[i][1], rgb_to_r_g_b({t.mid_colour[i][2],t.mid_colour[i][3]}))
			end
		end
		return pat
	end

	local function create_smooth_radial_gradient(x0,y0,r0,x1,y1,r1)
		local pat =  cairo_pattern_create_radial (x0,y0,r0,x1,y1,r1)
		cairo_pattern_add_color_stop_rgba (pat, 0, rgb_to_r_g_b(t.fg_colour))
		cairo_pattern_add_color_stop_rgba (pat, 1, rgb_to_r_g_b(t.alarm_colour))
		if t.mid_colour ~=nil then
			for i=1, #t.mid_colour do
				cairo_pattern_add_color_stop_rgba (pat, t.mid_colour[i][1], rgb_to_r_g_b({t.mid_colour[i][2],t.mid_colour[i][3]}))
			end
		end
		return pat
	end
	
	local function create_led_linear_gradient(x0,y0,x1,y1,col_alp,col_led)
		local pat = cairo_pattern_create_linear (x0,y0,x1,y1) ---delta, 0,delta+ t.width,0)
		cairo_pattern_add_color_stop_rgba (pat, 0.0, rgb_to_r_g_b(col_alp))
		cairo_pattern_add_color_stop_rgba (pat, 0.5, rgb_to_r_g_b(col_led))
		cairo_pattern_add_color_stop_rgba (pat, 1.0, rgb_to_r_g_b(col_alp))
		return pat
	end

	local function create_led_radial_gradient(x0,y0,r0,x1,y1,r1,col_alp,col_led,mode)
		local pat = cairo_pattern_create_radial (x0,y0,r0,x1,y1,r1)
		if mode==3 then
			cairo_pattern_add_color_stop_rgba (pat, 0, rgb_to_r_g_b(col_alp))				
			cairo_pattern_add_color_stop_rgba (pat, 0.5, rgb_to_r_g_b(col_led))
			cairo_pattern_add_color_stop_rgba (pat, 1, rgb_to_r_g_b(col_alp))				
		else
			cairo_pattern_add_color_stop_rgba (pat, 0, rgb_to_r_g_b(col_led))
			cairo_pattern_add_color_stop_rgba (pat, 1, rgb_to_r_g_b(col_alp))				
		end
		return pat
	end






	local function draw_single_bar()
		--this fucntion is used for bars with a single block (blocks=1) but 
		--the drawing is cut in 3 blocks : value/alarm/background
		--not zvzimzblr for circular bar
		local function create_pattern(col_alp,col_led,bg)
			local pat
			
			if not t.smooth then
				if t.led_effect=="e" then
					pat = create_led_linear_gradient (-delta, 0,delta+ t.width,0,col_alp,col_led)
				elseif t.led_effect=="a" then
					pat = create_led_linear_gradient (t.width/2, 0,t.width/2,-t.height,col_alp,col_led)
				elseif  t.led_effect=="r" then
					pat = create_led_radial_gradient (t.width/2, -t.height/2, 0, t.width/2,-t.height/2,t.height/1.5,col_alp,col_led,2)
				else
					pat = cairo_pattern_create_rgba  (rgb_to_r_g_b(col_alp))
				end
			else
				if bg then
					pat = cairo_pattern_create_rgba  (rgb_to_r_g_b(t.bg_colour))
				else
					pat = create_smooth_linear_gradient(t.width/2, 0, t.width/2,-t.height)
				end
			end
			return pat
		end
		
		local y1=-t.height*pct/100
		local y2,y3
		if pct>(100*t.alarm/t.max) then 
			y1 = -t.height*t.alarm/100
			y2 = -t.height*pct/100
			if t.smooth then y1=y2 end
		end
		
		if t.angle_bar==0 then
		
			--block for fg value
			local pat = create_pattern(t.fg_colour,t.fg_led,false)
			cairo_set_source(cr,pat)
			cairo_rectangle(cr,0,0,t.width,y1)
			cairo_fill(cr)
			cairo_pattern_destroy(pat)
		
			-- block for alarm value			
			if not t.smooth and y2 ~=nil then 
				pat = create_pattern(t.alarm_colour,t.alarm_led,false)
				cairo_set_source(cr,pat)
				cairo_rectangle(cr,0,y1,t.width,y2-y1)
				cairo_fill(cr)
				y3=y2
				cairo_pattern_destroy(pat)
			else
				y2,y3=y1,y1
			end
			-- block for bg value
			cairo_rectangle(cr,0,y2,t.width,-t.height-y3)
			pat = create_pattern(t.bg_colour,t.bg_led,true)
			cairo_set_source(cr,pat)
			cairo_pattern_destroy(pat)
			cairo_fill(cr)
		end		
	end  --end single bar
	





	local function draw_multi_bar()
		--function used for bars with 2 or more blocks
		for pt = 1,t.blocks do 
			--set block y
			local y1 = -(pt-1)*(t.height+t.space)
			local light_on=false
			
			--set colors
			local col_alp = t.bg_colour
			local col_led = t.bg_led
			if pct>=(100/t.blocks) or pct>0 then --ligth on or not the block
				if pct>=(pcb*(pt-1))  then 
					light_on = true
					col_alp = t.fg_colour
					col_led = t.fg_led
					if pct>=(100*t.alarm/t.max) and (pcb*pt)>(100*t.alarm/t.max) then 
						col_alp = t.alarm_colour 
						col_led = t.alarm_led 
					end
				end
			end

			--set colors
			--have to try to create gradients outside the loop ?
			local pat 
			
			if not t.smooth then
				if t.angle_bar==0 then
					if t.led_effect=="e" then
						pat = create_led_linear_gradient (-delta, 0,delta+ t.width,0,col_alp,col_led)
					elseif t.led_effect=="a" then
						pat = create_led_linear_gradient (t.width/2, -t.height/2+y1,t.width/2,0+t.height/2+y1,col_alp,col_led)					
					elseif  t.led_effect=="r" then
						pat = create_led_radial_gradient (t.width/2, y1, 0, t.width/2,y1,t.width/1.5,col_alp,col_led,2)	
					else
						pat = cairo_pattern_create_rgba  (rgb_to_r_g_b(col_alp))
					end
				else
					 if t.led_effect=="a"  then
						 pat = create_led_radial_gradient (0, 0, t.radius+(t.height+t.space)*(pt-1),
														 0, 0, t.radius+(t.height+t.space)*(pt),						 
											 col_alp,col_led,3)	
					else
						pat = cairo_pattern_create_rgba  (rgb_to_r_g_b(col_alp))					
					end
					
				end
			else
				
				if light_on then
					if t.angle_bar==0 then
						pat = create_smooth_linear_gradient(t.width/2, t.height/2, t.width/2,-(t.blocks-0.5)*(t.height+t.space))
					else
						pat = create_smooth_radial_gradient(0, 0, (t.height+t.space),  0,0,(t.blocks+1)*(t.height+t.space),2)
					end
				else		
					pat = cairo_pattern_create_rgba  (rgb_to_r_g_b(t.bg_colour))
				end
			end
			cairo_set_source (cr, pat)
			cairo_pattern_destroy(pat)

			--draw a block
			if t.angle_bar==0 then
				cairo_move_to(cr,0,y1)
				cairo_line_to(cr,t.width,y1)
			else		
				cairo_arc( cr,0,0,
					t.radius+(t.height+t.space)*(pt)-t.height/2,
					 -t.angle_bar -math.pi/2 ,
					 t.angle_bar -math.pi/2)
			end
			cairo_stroke(cr)
		end	
	end
	
	
	
	
	local function setup_bar_graph()
		--function used to retrieve the value to display and to set the cairo structure
		if t.blocks ~=1 then t.y=t.y-t.height/2 end
		
		local value = 0
		if t.name ~="" then
			value = tonumber(conky_parse(string.format('${%s %s}', t.name, t.arg)))
			--$to_bytes doesn't work when value has a decimal point,
			--https://garage.maemo.org/plugins/ggit/browse.php/?p=monky;a=commitdiff;h=174c256c81a027a2ea406f5f37dc036fac0a524b;hp=d75e2db5ed3fc788fb8514121f67316ac3e5f29f
			--http://sourceforge.net/tracker/index.php?func=detail&aid=3000865&group_id=143975&atid=757310
			--conky bug?
			--value = (conky_parse(string.format('${%s %s}', t.name, t.arg)))
			--if string.match(value,"%w") then
			--	value = conky_parse(string.format('${to_bytes %s}',value))
			--end
		else
			value = tonumber(t.arg)
		end

		if value==nil then value =0 end
		
		pct = 100*value/t.max
		pcb = 100/t.blocks
		
		cairo_set_line_width (cr, t.height)
		cairo_set_line_cap  (cr, cap)
		cairo_translate(cr,t.x,t.y)
		cairo_rotate(cr,t.angle)

		local matrix0 = cairo_matrix_t:create()
		tolua.takeownership(matrix0)
		cairo_matrix_init (matrix0, 1,t.skew_y,t.skew_x,1,0,0)
		cairo_transform(cr,matrix0)

	
		
		--call the drawing function for blocks
		if t.blocks==1 and t.angle_bar==0 then
			draw_single_bar()
			if t.reflection=="t" or t.reflection=="b" then cairo_translate(cr,0,-t.height) end
		else
			draw_multi_bar()
		end

		--dot for reminder
		--[[
		if t.blocks ~=1 then
			cairo_set_source_rgba(cr,1,0,0,1)
			cairo_arc(cr,0,t.height/2,3,0,2*math.pi)
			cairo_fill(cr)
		else
			cairo_set_source_rgba(cr,1,0,0,1)
			cairo_arc(cr,0,0,3,0,2*math.pi)
			cairo_fill(cr)
		end]]
		
		--call the drawing function for reflection and prepare the mask used		
		if t.reflection_alpha>0 and t.angle_bar==0 then
			local pat2
			local matrix1 = cairo_matrix_t:create()
			tolua.takeownership(matrix1)
			if t.angle_bar==0 then
				pts={-delta/2,(t.height+t.space)/2,t.width+delta,-(t.height+t.space)*(t.blocks)}
				if t.reflection=="t" then
					cairo_matrix_init (matrix1,1,0,0,-t.reflection_scale,0,-(t.height+t.space)*(t.blocks-0.5)*2*(t.reflection_scale+1)/2)
					pat2 = cairo_pattern_create_linear (t.width/2,-(t.height+t.space)*(t.blocks),t.width/2,(t.height+t.space)/2)
				elseif t.reflection=="r" then
					cairo_matrix_init (matrix1,-t.reflection_scale,0,0,1,delta+2*t.width,0)
					pat2 = cairo_pattern_create_linear (delta/2+t.width,0,-delta/2,0)
				elseif t.reflection=="l" then
					cairo_matrix_init (matrix1,-t.reflection_scale,0,0,1,-delta,0)
					pat2 = cairo_pattern_create_linear (-delta/2,0,delta/2+t.width,-0)
				else --bottom
					cairo_matrix_init (matrix1,1,0,0,-1*t.reflection_scale,0,(t.height+t.space)*(t.reflection_scale+1)/2)
					pat2 = cairo_pattern_create_linear (t.width/2,(t.height+t.space)/2,t.width/2,-(t.height+t.space)*(t.blocks))
				end
			end
			cairo_transform(cr,matrix1)

			if t.blocks==1 and t.angle_bar==0 then
				draw_single_bar()
				cairo_translate(cr,0,-t.height/2) 
			else
				draw_multi_bar()
			end
			
			
			cairo_set_line_width(cr,0.01)
			cairo_pattern_add_color_stop_rgba (pat2, 0,0,0,0,1-t.reflection_alpha)
			cairo_pattern_add_color_stop_rgba (pat2, t.reflection_length,0,0,0,1)
			if t.angle_bar==0 then
				cairo_rectangle(cr,pts[1],pts[2],pts[3],pts[4])
			end
			cairo_clip_preserve(cr)
			cairo_set_operator(cr,CAIRO_OPERATOR_CLEAR)
			cairo_stroke(cr)
			cairo_mask(cr,pat2)
			cairo_pattern_destroy(pat2)
			cairo_set_operator(cr,CAIRO_OPERATOR_OVER)
			
		end --reflection
		pct,pcb=nil
	end --setup_bar_graph()
	
	--start here !
	setup_bar_graph()
	cairo_restore(cr)
end

header.sh

#!/bin/sh
# conkyheader.sh
# by Crinos512
# Usage:
#  ${execp ~/conky/Manuel318/conkyheader.sh}
#OSVer=""`lsb_release -i | cut -f 2| tr "[:upper:]" "[:lower:]"`" ( "`lsb_release -r | cut -f 2`" )"
#WMVer=`Xfwm --version`
Updates=`aptitude search "~U" | wc -l | tail`
#Conky=`\{conky_version\}}`

#echo "\${voffset -20}\${font Diamond Fantasy:style=Bold:pixelsize=20}\${alignc}\${color}\$nodename\${font}"
#echo "\${font Liberation Sans:style=Bold:pixelsize=11}\${alignc}~ \$kernel \$machine ~"
#echo "\${alignc}~ $OSVer ~ $WMVer ~"
echo "\${alignr} $Updates System Updates"
#echo "\${alignc}~ $Conky  ~"
#echo "\${alignc}~ Uptime: \$uptime_short ~\${color}\${font}"
#echo "\${voffset 0}  \${color}( Conky \${conky_version}\${alignr}\${exec conkyForecast -V} )\${color}   "
#echo "\${font Diamond Fantasy:style=Bold:pixelsize=14}\${offset 10}NUM: \${exec xset q | grep Num |awk '{print " "\$8}'}\${alignr}CAPS \${exec xset q | grep Caps |awk '{print " "\$4}'}\${font}   "
exit 0

Last edited by jed (2013-02-25 22:07:37)

Offline

#4821 2013-02-25 19:17:55

PackRat
#! Die Hard
From: USA
Registered: 2011-03-03
Posts: 1,396

Re: The New Monster Conky Thread

@jed

post the conkyrc and bargraph.lua for the left side conky, please.


"It does not require many words to speak the truth." - Chief Joseph, Nez Perce tribe

Offline

#4822 2013-02-25 21:58:24

jed
#! CrunchBanger
From: Detachment 7
Registered: 2012-08-28
Posts: 193
Website

Re: The New Monster Conky Thread

@PackRat, edited post to include files....
You'll need some fonts as well, best found at Google...

Jed

Offline

#4823 2013-02-25 23:43:12

lwfitz
#! Die Hard
From: Monrovia, CA
Registered: 2012-01-19
Posts: 886
Website

Re: The New Monster Conky Thread

New one Im working on

taGw5Zg

Offline

#4824 2013-02-26 04:28:11

PackRat
#! Die Hard
From: USA
Registered: 2011-03-03
Posts: 1,396

Re: The New Monster Conky Thread

jed wrote:

@PackRat, edited post to include files....
You'll need some fonts as well, best found at Google...

Jed

Thanks - looks like I have some font installing and editing to do  tongue

admOlo2n.jpg

Last edited by PackRat (2013-02-26 04:31:06)


"It does not require many words to speak the truth." - Chief Joseph, Nez Perce tribe

Offline

Be excellent to each other!

#4825 2013-02-26 08:30:06

lwfitz
#! Die Hard
From: Monrovia, CA
Registered: 2012-01-19
Posts: 886
Website

Re: The New Monster Conky Thread

2013-02-25--13618653211919x1079scrot.png

Teos weather script to go along with conky_weather2 can be found here
Im using the Accuweather_Conky_USA_Images script w/ my edited images (included in the images download)

All the images can be found here


conky_system

max_specials 10000
max_user_text 15000
background no
use_xft yes
xftfont sans:size=9
xftalpha 1
total_run_times 0
own_window yes
own_window_argb_visual no
own_window_transparent yes
own_window_type desktop
own_window_title conky
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
double_buffer yes
minimum_size 1825 100
maximum_width 1825
draw_shades no
draw_outline no
draw_borders no
draw_graph_borders no
default_color white
default_shade_color black
default_outline_color white
alignment tl
gap_x 57
gap_y -10
no_buffers yes
uppercase no
cpu_avg_samples 2
override_utf8_locale yes
text_buffer_size 100000
top_name_width 5
update_interval 1
default_color FFFFFF
temperature_unit fahrenheit

TEXT
${image /home/luke/Conky/amd_fx.png -s 75x75 -p 15,20}${image /home/luke/Conky/thermometer.png -s 68x83 -p 275,20}${image /home/luke/Conky/vengance.png -s 185x55 -p 365,35}${image /home/luke/Conky/ssd.png -s 90x65 -p 725,30}${image /home/luke/Conky/nvidia.png -s 70x75 -p 1340,27}${image /home/luke/Conky/router.png -s 90x65 -p 1500,25}

${voffset 8}${font WhiteRabbit:size=12}${goto 110}CPU1 ${goto 155}${cpu cpu1}% ${goto 200}CPU2 ${goto 245}${cpu cpu2}%
${voffset 5}${goto 110}CPU3 ${goto 155}${cpu cpu3}% ${goto 200}CPU4 ${goto 245}${cpu cpu4}%${voffset 6}${goto 335}${hwmon 3 temp 1}F${voffset -9}${goto 530}${mem}${goto 600} /${memmax}${voffset 12}${goto 850}/root${voffset -7}${goto 920}${fs_used /}${goto 1000} -Used${goto 1090}${voffset 7}/home${voffset -7}${goto 1165}${fs_used /home} ${goto 1242} -Used ${voffset 5}${goto 1425}${nvidia temp}F${voffset -5}${goto 1630}Download ${goto 1730}${downspeed eth0}
${voffset 3}${goto 110}CPU5 ${goto 155}${cpu cpu5}% ${goto 200}CPU6 ${goto 245}${cpu cpu6}%${voffset -3}${goto 530}${swap}${goto 600} /${swapmax}${voffset 3} ${font WhiteRabbit:size=18}${voffset -7}${font WhiteRabbit:size=12}${goto 920}${fs_size /}${goto 1000} -Total${voffset 2}${font WhiteRabbit:size=12}${goto 1165}${fs_size /home} ${goto 1242} -Total ${goto 1630}Upload ${goto 1730}${upspeed eth0}

conky_drives

max_specials 10000
max_user_text 15000
background no
use_xft yes
xftfont sans:size=9
xftalpha 1
total_run_times 0
own_window yes
own_window_argb_visual no
own_window_transparent yes
own_window_type normal
own_window_title conky
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
double_buffer yes
minimum_size 165 225
maximum_width 165
draw_shades no
draw_outline no
draw_borders no
draw_graph_borders no
default_color white
default_shade_color black
default_outline_color white
alignment middle_left
gap_x 10
gap_y 150
no_buffers yes
uppercase no
cpu_avg_samples 2
override_utf8_locale yes
text_buffer_size 100000
top_name_width 5
update_interval 1
default_color FFFFFF
temperature_unit fahrenheit
short_units yes

TEXT
${image /home/luke/Conky/drive.png -s 40x45 -p 2,10}
${font WhiteRabbit:size=14}${goto 50}Software
${voffset 3}${font WhiteRabbit:size=12}${goto 50}${fs_used /media/sdb1} ${goto 108}/${fs_size /media/sdb1}${voffset -3}

${image /home/luke/Conky/drive.png -s 40x45 -p 2,65}
${font WhiteRabbit:size=14}${goto 50}External
${voffset 3}${font WhiteRabbit:size=12}${goto 50}${fs_used /media/sde5} ${goto 108}/${fs_size /media/sde5}${voffset -3}

${image /home/luke/Conky/drive.png -s 40x45 -p 2,120}
${font WhiteRabbit:size=14}${goto 50}Music
${voffset 3}${font WhiteRabbit:size=12}${goto 50}${fs_used /media/sde6} ${goto 108}/${fs_size /media/sde6}${voffset -3}

${image /home/luke/Conky/drive.png -s 40x45 -p 2,177}
${font WhiteRabbit:size=14}${goto 50}Storage
${voffset 3}${font WhiteRabbit:size=12}${goto 50}${fs_used /media/storage} ${goto 108}/${fs_size /media/storage}${voffset -3}

${image /home/luke/Conky/drive.png -s 40x45 -p 2,233}
${font WhiteRabbit:size=14}${goto 50}Videos
${voffset 3}${font WhiteRabbit:size=12}${goto 50}${fs_used /media/sdc1} ${goto 108}/${fs_size /media/sdc1}

conky_weather2

max_specials 10000
max_user_text 15000
background no
use_xft yes
xftfont sans:size=9
xftalpha 1
total_run_times 0
own_window yes
own_window_argb_visual no
own_window_transparent yes
own_window_type normal
own_window_title conky
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
double_buffer yes
minimum_size 350 360
maximum_width 350
draw_shades no
draw_outline no
draw_borders no
draw_graph_borders no
default_color white
default_shade_color black
default_outline_color white
alignment bottom_left
gap_x 10
gap_y 10
no_buffers yes
uppercase no
cpu_avg_samples 6
override_utf8_locale yes
text_buffer_size 100000
top_name_width 5
update_interval 1
default_color FFFFFF
temperature_unit fahrenheit
# Like it says, ot pads the decimals on % values
# doesn't seem to work since v1.7.1
pad_percents 2
format_human_readable yes
short_units yes
update_interval 1
imlib_cache_size 0

#   Maximum size of user text buffer, i.e. layout below TEXT line in config file
#  (default is 16384 bytes)
# max_user_text 16384

# Desired output unit of all objects displaying a temperature. Parameters are
# either "fahrenheit" or "celsius". The default unit is degree Celsius.
temperature_unit Fahrenheit

TEXT


${font WhiteRabbit:size=15}${goto 30}Temp ${goto 288}Feels${voffset 10}
${font WhiteRabbit:size=20}${goto 25}${execpi 600 sed -n '4p' $HOME/Accuweather_Conky_USA_Images/curr_cond}°F ${goto 286}${execpi 600 sed -n '5p' $HOME/Accuweather_Conky_USA_Images/curr_cond}°F
${font WhiteRabbit:size=11}${texeci 500 bash $HOME/Accuweather_Conky_USA_Images/acc_usa_images}${image $HOME/Accuweather_Conky_USA_Images/cc.png -p 75,10 -s 240x225}




${font WhiteRabbit:size=15}${goto 30}Dawn ${goto 285}Dusk
${voffset 10}${font WhiteRabbit:size=17}${goto 15}${execpi 600 sed -n '15p' $HOME/Accuweather_Conky_USA_Images/curr_cond}${goto 262}${execpi 600 sed -n '16p' $HOME/Accuweather_Conky_USA_Images/curr_cond}${voffset -10}

${font WhiteRabbit:size=13}${goto 30}${execpi 600 sed -n '6p' $HOME/Accuweather_Conky_USA_Images/tod_ton}${goto 145}${execpi 600 sed -n '11p' $HOME/Accuweather_Conky_USA_Images/tod_ton}${goto 265}${execpi 600 sed -n '16p' $HOME/Accuweather_Conky_USA_Images/tod_ton}

${font WhiteRabbit:size=10}${goto 100}${execpi 600 sed -n '9p' $HOME/Accuweather_Conky_USA_Images/tod_ton}°F${goto 215}${execpi 600 sed -n '14p' $HOME/Accuweather_Conky_USA_Images/tod_ton}°F${goto 330}${execpi 600 sed -n '19p' $HOME/Accuweather_Conky_USA_Images/tod_ton}°F
${voffset 5}${font WhiteRabbit:size=10}${goto 100}${execpi 600 sed -n '10p' $HOME/Accuweather_Conky_USA_Images/tod_ton}°F${goto 215}${execpi 600 sed -n '15p' $HOME/Accuweather_Conky_USA_Images/tod_ton}°F${goto 330}${execpi 600 sed -n '20p' $HOME/Accuweather_Conky_USA_Images/tod_ton}°F${image $HOME/Accuweather_Conky_USA_Images/7.png -p 20,212 -s 80x67}${image $HOME/Accuweather_Conky_USA_Images/12.png -p 138,212 -s 80x67}${image $HOME/Accuweather_Conky_USA_Images/17.png -p 256,212 -s 80x67}${voffset -5}



${font WhiteRabbit:size=13}${goto 30}${execpi 600 sed -n '21p' $HOME/Accuweather_Conky_USA_Images/tod_ton}${goto 145}${execpi 600 sed -n '1p' $HOME/Accuweather_Conky_USA_Images/last_days}${goto 265}${execpi 600 sed -n '6p' $HOME/Accuweather_Conky_USA_Images/last_days}

${font WhiteRabbit:size=10}${goto 100}${execpi 600 sed -n '24p' $HOME/Accuweather_Conky_USA_Images/tod_ton}°F${goto 215}${execpi 600 sed -n '4p' $HOME/Accuweather_Conky_USA_Images/last_days}°F${goto 330}${execpi 600 sed -n '9p' $HOME/Accuweather_Conky_USA_Images/last_days}°F
${voffset 5}${font WhiteRabbit:size=10}${goto 100}${execpi 600 sed -n '25p' $HOME/Accuweather_Conky_USA_Images/tod_ton}°F${goto 215}${execpi 600 sed -n '5p' $HOME/Accuweather_Conky_USA_Images/last_days}°F${goto 330}${execpi 600 sed -n '10p' $HOME/Accuweather_Conky_USA_Images/last_days}°F${image $HOME/Accuweather_Conky_USA_Images/22.png -p 20,299 -s 80x67}${image $HOME/Accuweather_Conky_USA_Images/N2.png -p 138,299 -s 80x67}${image $HOME/Accuweather_Conky_USA_Images/N7.png -p 256,299 -s 80x67}${voffset -5}

conky_clock

max_specials 10000
max_user_text 15000
background no
use_xft yes
xftfont sans:size=9
xftalpha 1
total_run_times 0
own_window yes
own_window_argb_visual no
own_window_transparent yes
own_window_type normal
own_window_title conky
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
double_buffer yes
minimum_size 275 250
maximum_width 275
draw_shades no
draw_outline no
draw_borders no
draw_graph_borders no
default_color white
default_shade_color black
default_outline_color white
alignment middle_middle
gap_x 140
gap_y 250
no_buffers yes
uppercase no
cpu_avg_samples 2
override_utf8_locale yes
text_buffer_size 100000
top_name_width 5
update_interval 1
default_color FFFFFF
temperature_unit fahrenheit

#### Load Lua #####
lua_load ~/Conky/s11_clock.lua
lua_draw_hook_pre main


TEXT
${image /home/luke/Conky/ClockFace.png -s 225x225 -p 0,0}

s11_clock.lua

--[[ multiple analogue clocks by mrpeachy - 18 Jun 2012
 21 Jun 2012 - Chronograph modifications by Sector11
 22 Jun 2012 - again with mrpeachy's help day names, numbers and month names
 12 Nov 2012 - memory leak plugged - mrpeachy
 14 Nov 2012 - Personnalisation - Didier-T (forum Ubuntu.fr)
 26 Nov 2012 - The Clock - Sector11 (small version)

use in conkyrc

lua_load /path/Chronograph.lua
lua_draw_hook_pre main
TEXT

 -- INDEX
 -- ### CLOCK POSITION - AND DEFAULTS ###
 -- ### SET BORDER OPTIONS FOR "CLOCKS" ### -- I don't know how to remove this - NOT NEEDED
 --     See lines 39 to 41 for overall size changes
 -- ### START DIAL B ### Day Names Dial ###
 --     See Lines 84 - 87 and 131 for changes
 -- ### START DIAL C ### Month Names Dial ###
 --     See Lines 150 -153 and 198 for changes
 -- ### START DIAL D ### Day Numbers Dial ###
 --     See Lines 234 & 265 for  changes
 -- ### START CLOCK A ###
 --     See Lines  &  and 441 & 467 changes
 -- MARKS AROUND CLOCK A -- Large Main 24 HR Clock
 -- CLOCK A HOUR HAND
 -- CLOCK A MINUTE HAND SETUP
 -- CLOCK A SECOND HAND SETUP

NOTE:  Putting ### CLOCK A ### last insures that it's functions are written
       over the other dials.
]]

require 'cairo'
 -- ### CLOCK POSITION - AND DEFAULTS ##########################################
local init={
center_x=117,
center_y=112,
radius=80,
lang="English", -- English French Greek Spanish
hour=12, -- 12 | 24
second=true, --true | false - Seconds: dots and numbers IF 12HR
line=true, -- true | false - Part Second Hand
color=0xFF0000, --color for day, day number and month IF NO SECOND HAND
alpha=1 --alpha for day, day number and month IF NO SECOND HAND
}

 -- ONLY NEED ONE COPY OF THIS FUNCTION
function rgb_to_r_g_b(col,alp)
  return ((col / 0x10000) % 0x100) / 255, ((col / 0x100) % 0x100) / 255, (col % 0x100) / 255, alp
end
local colr, colg, colb, cola=rgb_to_r_g_b(init.color,init.alpha)

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)
cr = cairo_create(cs)
local extents=cairo_text_extents_t:create()
tolua.takeownership(extents)

 -- ### CLOCK 12|24 HR SELECTOR ############################
local clock_type_A=init.hour
 -- ############################ CLOCK 12|24 HR SELECTOR ###

 -- ### SET BORDER OPTIONS FOR "CLOCKS" ####################
--local clock_border_width=0
 -- set color and alpha for clock border
--local cbr,cbg,cbb,cba=1,1,1,1 -- full opaque white
 -- gap from clock border to minute marks
local b_to_m=0
 -- #################### SET BORDER OPTIONS FOR "CLOCKS" ###

 -- ### START DIAL B ### Day Names Dial ####################
 -- DIAL POSITION
local center_x=init.center_x
local center_y=init.center_y
local radius=22
 -- FONT
cairo_select_font_face (cr, "CorporateMonoExtraBold", CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
cairo_set_font_size (cr, 14)
 -- TABLE OF TEXT -- in order
if init.lang == "English" then text_days={"Sun","Mon","Tue","Wed","Thr","Fri","Sat",} end
if init.lang == "French" then text_days={"dim","lun","mar","mer","jeu","ven","sam",} end
if init.lang == "Greek" then text_days={"ΔΕΥ","ΤΡΙ","ΤΕΤ","ΠΕΜ","ΠΑΡ","ΣΑΒ","ΚΥΡ",} end
if init.lang == "Spanish" then text_days={"dom","lun","mar","mie","jue","vie","sab",} end

local day_number=tonumber(os.date("%w"))
if init.handday == true then
  for i=1,7 do
 -- work out points
    local point=(math.pi/180)*((360/7)*(i-1))
    local x=0+radius*(math.sin(point))
    local y=0-radius*(math.cos(point))
 -- CALCULATE CENTRE OF TEXT
    local text=text_days[i]--gets text from table
    cairo_text_extents(cr,text,extents)
    local width=extents.width
    local height=extents.height
    cairo_move_to(cr,center_x+x-(width/2),center_y+y+(height/2))
    cairo_show_text (cr, text)
    cairo_stroke (cr)    
  end
else
  for i=1,7 do -- working out points
    if day_number == i-1 then
      cairo_set_source_rgba (cr,0,1,1,0) -- active colour
    else
      cairo_set_source_rgba (cr,1,1,1,0.0) -- non-active day names
    end
    local point=(math.pi/180)*((360/7)*(i-1))
    local x=0+radius*(math.sin(point))
    local y=0-radius*(math.cos(point))
 -- CALCULATE CENTRE OF TEXT
    local text=text_days[i]--gets text from table
    cairo_text_extents(cr,text,extents)
    local width=extents.width
    local height=extents.height
    cairo_move_to(cr,center_x+x-(width/2),center_y+y+(height/2))
    cairo_show_text (cr, text)
    cairo_stroke (cr)
  end
 -- INNER POINTS POSITION, radius smaller than text circle
  local radius=7
  for i=1,7 do
    if day_number == i-1 then
      cairo_set_source_rgba (cr,0,1,1,0) -- active colour
    else
      cairo_set_source_rgba (cr,1,1,1,0.0) -- non-active
    end
    local point=(math.pi/180)*((360/7)*(i-1))
    local x=0+radius*(math.sin(point))
    local y=0-radius*(math.cos(point))
    cairo_arc (cr,center_x+x,center_y+y,1,0,2*math.pi)
    cairo_stroke (cr)
  end
end
 -- ######################################### END DIAL B ###

 -- ### START DIAL C ### Month Names Dial ##################
 -- DIAL POSITION
local center_x=init.center_x --(+85)
local center_y=init.center_y
local radius=53
 -- FONT
cairo_select_font_face (cr, "CorporateMonoExtraBold", CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
cairo_set_font_size (cr, 14)
 -- TABLE OF TEXT -- in order
if init.lang == "English" then text_days={"Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec",} end
if init.lang == "French" then text_days={"jan","fév","mar","avr","mai","jui","jul","aôu","sep","oct","nov","déc",} end
if init.lang == "Greek" then text_days={"ΙΑΝ","ΦΕΒ","ΜΑΡ","ΑΠΡ","ΜΑΙ","ΙΟΥ","ΙΟΥ","ΑΥΓ","ΣΕΠ","ΟΚΤ","ΝΟΕ","ΔΕΚ",} end
if init.lang == "Spanish" then text_days={"ene","feb","mar","abr","may","jun","jul","ago","sep","oct","nov","dic",} end

local this_month=tonumber(os.date("%m"))
if init.handmonth == true then
  for i=1,12 do
 -- OUTER POINTS POSTION FOR -- ### START DIAL D ## TEXT
    local point=(math.pi/180)*((360/12)*(i-1))
    local x=0+radius*(math.sin(point))
    local y=0-radius*(math.cos(point))
 -- CALCULATE CENTRE OF TEXT
    local text=text_days[i]--gets text from table
    cairo_text_extents(cr,text,extents)
    local width=extents.width
    local height=extents.height
    cairo_move_to(cr,center_x+x-(width/2),center_y+y+(height/2))
    cairo_show_text (cr, text)
    cairo_stroke (cr)
  end
else
  for i=1,12 do
    if this_month == i then
      cairo_set_source_rgba (cr,0,1,1,0) -- active month colour
    else
      cairo_set_source_rgba (cr,1,1,1,0.0) -- non-active month names
    end
 -- OUTTER POINTS POSTION FOR TEXT
    local point=(math.pi/180)*((360/12)*(i-1))
    local x=0+radius*(math.sin(point))
    local y=0-radius*(math.cos(point))
 -- CALCULATE CENTRE OF TEXT
    local text=text_days[i]--gets text from table
    cairo_text_extents(cr,text,extents)
    local width=extents.width
    local height=extents.height
    cairo_move_to(cr,center_x+x-(width/2),center_y+y+(height/2))
    cairo_show_text (cr, text)
    cairo_stroke (cr)
  end
 -- INNER POINTS POSITION, radius smaller than text circle
  local radius=38
  for i=1,12 do
    if this_month == i then
      cairo_set_source_rgba (cr,0,1,1,0) -- active colour
	 else
      cairo_set_source_rgba (cr,1,1,1,0.0) -- dots for non-active month names
    end
    local point=(math.pi/180)*((360/12)*(i-1))
    local x=0+radius*(math.sin(point))
    local y=0-radius*(math.cos(point))
    cairo_arc (cr,center_x+x,center_y+y,1,0,2*math.pi)
    cairo_stroke (cr)
  end
end
 -- ######################################### END DIAL C ###

 -- ### START DIAL D ### Day Numbers Dial ##################
 -- GET NUMBER OF DAYS IN CURRENT MONTH
 -- calculate Feb, then set up table
year4num=os.date("%Y")
t1=os.time({year=year4num,month=03,day=01,hour=00,min=0,sec=0});
t2=os.time({year=year4num,month=02,day=01,hour=00,min=0,sec=0});
if init.hour == 12 then
  febdaynum=tonumber((os.difftime(t1,t2))/(12*60*60))
else
  febdaynum=tonumber((os.difftime(t1,t2))/(24*60*60))
end
 -- MONTH TABLE
monthdays={31,febdaynum,31,30,31,30,31,31,30,31,30,31}
this_month=tonumber(os.date("%m"))
number_days=monthdays[this_month]
 -- TEXT positioning
local center_x=init.center_x
local center_y=init.center_y
local radius=85
cairo_select_font_face (cr, "Liquid Crystal", CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_BOLD);
cairo_set_font_size (cr, 20)
local this_day=tonumber(os.date("%d"))
  for i=1,number_days do
 -- OUTTER POINTS POSTION FOR TEXT
    local point=(math.pi/180)*((360/number_days)*(i-1))
    local x=0+radius*(math.sin(point))
    local y=0-radius*(math.cos(point))
 -- CALCULATE CENTRE OF TEXT
    --only print even numbers
    if math.mod(i, 2) == 0 and math.mod(this_day, 2)==0 then
    text=string.format("%02d",i) --formats numbers to double digits
    elseif math.mod(i, 2) ~= 0 and math.mod(this_day, 2)~=0 then
    text=string.format("%02d",i) --formats numbers to double digits
    else
    text=""
    end --odd even matching
    cairo_text_extents(cr,text,extents)
    local width=extents.width
    local height=extents.height
	if i==this_day then
     cairo_set_source_rgba (cr,0,1,1,0) -- active colour
	else
	cairo_set_source_rgba (cr,1,1,1,0) -- dim inactive numbers
	end
     cairo_move_to(cr,center_x+x-(width/2),center_y+y+(height/2))
     cairo_show_text (cr, text)
     cairo_stroke (cr)
  end
 -- INNER POINTS POSITION, radius smaller than text circle
  local radius=70
  for i=1,number_days do
    local point=(math.pi/180)*((360/number_days)*(i-1))
    local x=0+radius*(math.sin(point))
    local y=0-radius*(math.cos(point))
	if i==this_day then
     cairo_set_source_rgba (cr,0,1,1,0) -- active colour
	else
	cairo_set_source_rgba (cr,0,0,1,.0) -- dim the points
	end
    cairo_arc (cr,center_x+x,center_y+y,1,0,2*math.pi)
    cairo_stroke (cr)
  end
 -- ######################################### END DIAL D ###

 -- ### START CLOCK A ######################################
 -- SET MARKS ###
 -- MARKS AROUND CLOCK A -- Large Main 24 HR Clock
local number_marks_A=init.hour
 -- set mark length
local m_length_A=0 -- doesn't work but can't delete
 -- set mark width
local m_width_A=0 -- doesn't work but can't delete
 -- set mark line cap type
local m_cap=CAIRO_LINE_CAP_ROUND
 -- set mark color and alpha,red blue green alpha
local mr,mg,mb,ma=1,1,1,0 -- opaque white -- doesn't work but can't delete
 -- SETUP HOUR HANDS ###
 -- CLOCK A HOUR HAND
hh_length_A=65
 -- set hour hand width
hh_width_A=4
 -- set hour hand line cap
hh_cap=CAIRO_LINE_CAP_ROUND
 -- set hour hand color
 -- hhr,hhg,hhb,hha=1,0,1,0 -- fully opaque white --doesn't work
 -- SETUP MINUTE HANDS ###
 -- CLOCK A MINUTE HAND SETUP
 -- set length of minute hand
mh_length_A=85
 -- set minute hand width
mh_width_A=4
 -- set minute hand line cap
mh_cap=CAIRO_LINE_CAP_ROUND
 -- set minute hand color
--mhr,mhg,mhb,mha=1,1,1,0.5 -- fully opaque white --doesn't work

 -- SETUP SECOND HAND ###
 -- CLOCK A SECOND HAND SETUP -- DOESN'T WORK - Why ???????????????????????????
 -- set length of seconds hand -- yes I know it is commented out!
--sh_length_A=150
 -- set hour hand width
--sh_width_A=2
 -- set hour hand line cap
--sh_cap=CAIRO_LINE_CAP_ROUND
 -- set seconds hand color
--shr,shg,shb,sha=1,0,0,1 -- fully opaque red

 -- PART SECOND HAND
--position
--get seconds value
local seconds=tonumber(os.date("%S"))
--calculate rotation of second hand in degrees
if init.line == true then
  local arc=(math.pi/180)*((360/60)*seconds)
  --calculate point 1
  local radius1=100
  local x1=0+radius1*math.sin(arc)
  local y1=0-radius1*math.cos(arc)
  --calculate point 2
  local radius2=107
  local x2=0+radius2*math.sin(arc)
  local y2=0-radius2*math.cos(arc)
  --draw line connecting points
  cairo_move_to (cr, center_x+x1,center_y+y1)
  cairo_line_to (cr, center_x+x2, center_y+y2)
  cairo_set_source_rgba (cr,255/255,255/255,255/255,1) -- PART SECOND HAND
  cairo_stroke (cr)
end

 -- CLOCK A ### 12 HR TIME ###
 -- CLOCK SETTINGS
clock_radius=0 --does not work
clock_centerx=init.center_x -- centre of Clock hands
clock_centery=init.center_y -- centre of Clock hands
 -- DRAWING CODE
 -- DRAW MARKS
 -- stuff that can be moved outside of the loop, needs only be set once
 -- calculate end and start radius for marks
m_end_rad=clock_radius-b_to_m
m_start_rad=m_end_rad-m_length_A -- WHAT IS THIS??
 -- set line cap type
cairo_set_line_cap  (cr, m_cap)
 -- set line width
cairo_set_line_width (cr,m_width_A)
 -- set color and alpha for marks
cairo_set_source_rgba (cr,mr,mg,mb,ma)
 -- START LOOP FOR HOUR MARKS
for i=1,number_marks_A do
 -- drawing code using the value of i to calculate degrees
 -- calculate start point for 12/24 hour mark
radius=m_start_rad
point=(math.pi/180)*((i-1)*(360/number_marks_A))
x=0+radius*(math.sin(point))
y=0-radius*(math.cos(point))
 -- set start point for line
cairo_move_to (cr,clock_centerx+x,clock_centery+y)
 -- calculate end point for 12/24 hour mark
radius=m_end_rad
point=(math.pi/180)*((i-1)*(360/number_marks_A))
x=0+radius*(math.sin(point))
y=0-radius*(math.cos(point))
 -- set path for line
cairo_line_to (cr,clock_centerx+x,clock_centery+y)
 -- draw the line
cairo_stroke (cr)
end -- of for loop
 -- HOUR MARKS -- ???????????????????????????????????????????????????????????????
 -- TIME CALCULATIONS CLOCK A
if clock_type_A==12 then
hours=tonumber(os.date("%I"))
 -- convert hours to seconds
h_to_s=hours*60*60
elseif clock_type_A==24 then
hours=tonumber(os.date("%H"))
 -- convert hours to seconds
h_to_s=hours*60*60
end
minutes=tonumber(os.date("%M"))
 -- convert minutes to seconds
m_to_s=minutes*60
 -- get current seconds
seconds=tonumber(os.date("%S"))
 -- DRAW HOUR HAND ###
 -- get hours minutes seconds as just seconds
hsecs=h_to_s+m_to_s+seconds
 -- calculate degrees for each second
hsec_degs=hsecs*(360/(60*60*clock_type_A)) -- use equation ~ eliminate decimals
 -- set radius to calculate hand points
radius=hh_length_A
 -- set start line coordinates, the center of the circle
cairo_move_to (cr,clock_centerx,clock_centery)
 -- calculate coordinates for end of hour hand
point=(math.pi/180)*hsec_degs
x=0+radius*(math.sin(point))
y=0-radius*(math.cos(point))
 -- describe the line we will draw
cairo_line_to (cr,clock_centerx+x,clock_centery+y)
 -- set up line attributes and draw line
cairo_set_line_width (cr,hh_width_A)
cairo_set_source_rgba (cr,1,1,1,.75) -- active colour Hour Hand ================
cairo_set_line_cap  (cr, hh_cap)
cairo_stroke (cr)
 -- DRAW MINUTE HAND
 -- get minutes and seconds just as seconds
msecs=m_to_s+seconds
 -- calculate degrees for each second
msec_degs=msecs*0.1
 -- set radius to calculate hand points
radius=mh_length_A
 -- set start line coordinates, the center of the circle
cairo_move_to (cr,clock_centerx,clock_centery)
 -- calculate coordinates for end of minute hand
point=(math.pi/180)*msec_degs
x=0+radius*(math.sin(point))
y=0-radius*(math.cos(point))
 -- describe the line we will draw
cairo_line_to (cr,clock_centerx+x,clock_centery+y)
 -- set up line attributes and draw line
cairo_set_line_width (cr,mh_width_A)
cairo_set_source_rgba (cr,1,1,1,.75) -- active colour Minute Hand ==============
cairo_set_line_cap  (cr, mh_cap)
cairo_stroke (cr)
 -- ### CLOCK A ###
local center_x=init.center_x -- Centre of the HR / Min Numbers
local center_y=init.center_y -- Centre of the HR / Min Numbers
local radius=init.radius -- 12/24 HR CLOCK Hours/Minutes radius -- seeline 42
cairo_select_font_face (cr, "WhiteRabbit", CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_BOLD);
cairo_set_font_size (cr, 25)
cairo_set_source_rgba (cr,1,1,1,0) -- HR Clock numbers
 -- TABLE OF TEXT -- in order
if init.hour == 12 then
  text_days={"12","01","02","03","04","05","06","07","08","09","10","11",}
  for i=1,12 do
 -- OUTTER POINTS POSTION FOR TEXT
    local point=(math.pi/180)*((360/12)*(i-1))
    local x=0+radius*(math.sin(point))
    local y=0-radius*(math.cos(point))
 -- CALCULATE CENTRE OF TEXT
    local text=text_days[i]--gets text from table
    cairo_text_extents(cr,text,extents)
    local width=extents.width
    local height=extents.height
    cairo_move_to(cr,center_x+x-(width/2),center_y+y+(height/2))
    cairo_show_text (cr, text)
    cairo_set_source_rgba (cr,1,1,1,0)
    cairo_stroke (cr)
  end
 -- INNER POINTS POSITION, radius smaller than text circle
  local radius=111 -- 12 HR Clock
  for i=1,12 do
    local point=(math.pi/180)*((360/12)*(i-1))
    local x=0+radius*(math.sin(point))
    local y=0-radius*(math.cos(point))
    cairo_arc (cr,center_x+x,center_y+y,1,0,2*math.pi)
    cairo_set_source_rgba (cr,1,1,1,0)
    cairo_stroke (cr)
  end
end
if init.hour == 24 then
  text_days={"00","01","02","03","04","05","06","07","08","09","10","11","12","13","14","15","16","17","18","19","20","21","22","23",}
  for i=1,24 do
 -- OUTTER POINTS POSTION FOR TEXT
    local point=(math.pi/180)*((360/24)*(i-1))
    local x=0+radius*(math.sin(point))
    local y=0-radius*(math.cos(point))
 -- CALCULATE CENTRE OF TEXT
    local text=text_days[i]--gets text from table
    cairo_text_extents(cr,text,extents)
    local width=extents.width
    local height=extents.height
    cairo_move_to(cr,center_x+x-(width/2),center_y+y+(height/2))
    cairo_show_text (cr, text)
    cairo_stroke (cr)
  end
 -- INNER POINTS POSITION, radius smaller than text circle
  local radius=99 -- 24 HR Clock
  for i=1,24 do
    local point=(math.pi/180)*((360/24)*(i-1))
    local x=0+radius*(math.sin(point))
    local y=0-radius*(math.cos(point))
    cairo_arc (cr,center_x+x,center_y+y,1,0,2*math.pi)
    cairo_set_source_rgba (cr,1,1,1,0)
    cairo_stroke (cr)
  end
end

 -- ############################################################################
 -- POSITION FOR TEXT HOUR NUMBERS
  if init.hour == 12 and init.second == true then
    text_days={"","01","02","03","04","","06","07","08","09","","11","12","13","14","","16","17","18","19","","21","22","23","24","","26","27","28","29","","31","32","33","34","","36","37","38","39","","41","42","43","44","","46","47","48","49","","51","52","53","54","","56","57","58","59","",}
 -- INNER POINTS POSITION, radius smaller than text circle
    cairo_set_source_rgba (cr,1,1,1,.5) -- does not work -- settings moved
    cairo_select_font_face (cr, "WhiteRabbit", CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
    for i=1,60 do
      local radius=99 -- dots for seconds A Clock
      local point=(math.pi/180)*((360/60)*(i-1))
      local x=0+radius*(math.sin(point))
      local y=0-radius*(math.cos(point))
      if seconds == i-1 then
        cairo_set_source_rgba (cr,255/255,0/255,0/255,0) -- does not work - settings moved
      else 
        if i-1 == 0 or i-1 == 5 or i-1 == 10 or i-1 == 15 or i-1 == 25 or i-1 == 30 or i-1 == 35 or i-1 == 40 or i-1 == 45 or i-1 == 50 or i-1 == 55 then
          cairo_set_source_rgba (cr,1,1,1,0) -- active colour
        else
          cairo_set_source_rgba (cr,1,1,1,0) -- dots for seconds A Clock
        end
      end
      cairo_arc (cr,center_x+x,center_y+y,1/2,0,2*math.pi)
      cairo_stroke (cr)
    end
    radius=radius-3
    cairo_set_font_size (cr, 9)
    for i=1,60 do
 -- OUTTER POINTS POSTION FOR TEXT
      local point=(math.pi/180)*((360/60)*(i-1))
      local x=0+radius*(math.sin(point))
      local y=0-radius*(math.cos(point))
 -- CALCULATE CENTRE OF TEXT
      local text=text_days[i]--gets text from table
      if seconds == tonumber(text) then
      cairo_set_source_rgba (cr,1,1,1,0) -- active colour
      else
        cairo_set_source_rgba (cr,1,1,1,0) -- seconds numbers
      end
      cairo_text_extents(cr,text,extents)
      local width=extents.width
      local height=extents.height
      cairo_move_to(cr,center_x+x-(width/2),center_y+y+(height/2))
      cairo_show_text (cr, text)
      cairo_stroke (cr)
    end
  end
 -- ############################################################################
cairo_stroke (cr)
cairo_destroy(cr)
cairo_surface_destroy(cs)
cr=nil
end -- end main function

Teos weather script to go along with conky_weather2 can be found here
Im using the Accuweather_Conky_USA_Images script w/ my edited images (included in the images download)

All the images can be found here

Last edited by lwfitz (2013-02-26 08:30:38)

Offline

Board footer

Powered by FluxBB

Copyright © 2012 CrunchBang Linux.
Proudly powered by Debian. Hosted by Linode.
Debian is a registered trademark of Software in the Public Interest, Inc.

Debian Logo