SEARCH

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

You are not logged in.

#3626 2012-11-05 22:35:35

mrpeachy
20% cooler
From: The Everfree Forest
Registered: 2009-11-08
Posts: 3,460

Re: Conky v1.9 Thread

ansem_of_nexus wrote:

Can I just say that this:
http://ompldr.org/tZzVwaA

changing line
cairo_set_source_rgba(cr,1,1,1,1) --white
to
cairo_set_source_rgba(cr,.39,.4,.41,.4) --gray

ok so my question is how do I get it to a solid line color as I have failed to. the gray color would be #656667 the default color of conky

ah... the lighter dots you see are the result of each of the individual lines overlapping due to using the rounded ends
you only see it because you have set your alpha to less that 1

you can get lines to join up, but not using this method, the for loop can only draw individual lines
i can think of some ways around it but nothing particularly easy to implement

easiest way is to set aplha to 1 smile

Offline

Be excellent to each other!

#3627 2012-11-05 22:45:56

mrpeachy
20% cooler
From: The Everfree Forest
Registered: 2009-11-08
Posts: 3,460

Re: Conky v1.9 Thread

ansem_of_nexus wrote:

mrpeachy your "how to: using lua scripts in conky" needs a warning label that reads:

Warning:
If you have the intent to sit down and read from the beginning to the end of this guide, my opinion is that you are crazy and should try something less mentally traumatic like what they do to your brain during mummification. If you would still like to try, things you might want to have on hand while reading. 1: a rag as drooling on your keyboard makes it hard to type, 2: a bottle of eye drops as your eyes will most likely resemble the Sahara desert after not blinking enough for that length of time, and 3: somethings to reconstitute your brain when it goes on strike and liquefies itself.


other than that, thank you for the guide

how about
"the author takes no responsibility of any ailment suffered from the reading of this guide
including, but not limited to
weeping
sobbing
wailing
shrieking
blindness
fatigue
vomiting
listlessness
club foot
trench mouth
sudden adult death syndrome
monkey pox
galactorrhea
formication
gynecomastia
and rhinotillexomania"

Last edited by mrpeachy (2012-11-05 22:46:13)

Offline

#3628 2012-11-05 22:50:20

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

Re: Conky v1.9 Thread

mrpeachy wrote:

ah... the lighter dots you see are the result of each of the individual lines overlapping due to using the rounded ends
you only see it because you have set your alpha to less that 1

you can get lines to join up, but not using this method, the for loop can only draw individual lines
i can think of some ways around it but nothing particularly easy to implement

easiest way is to set aplha to 1 smile

So changing line joint from round to butt won't kill the overlap we are seeing? And is there any gray that has alpha of 1?


You can find my work here

Make everything ok button

Offline

#3629 2012-11-05 22:53:37

mrpeachy
20% cooler
From: The Everfree Forest
Registered: 2009-11-08
Posts: 3,460

Re: Conky v1.9 Thread

ansem_of_nexus wrote:
mrpeachy wrote:

ah... the lighter dots you see are the result of each of the individual lines overlapping due to using the rounded ends
you only see it because you have set your alpha to less that 1

you can get lines to join up, but not using this method, the for loop can only draw individual lines
i can think of some ways around it but nothing particularly easy to implement

easiest way is to set aplha to 1 smile

So changing line joint from round to butt won't kill the overlap we are seeing? And is there any gray that has alpha of 1?

with line butt and thicker lines you see gaps between the lines
as long as you keep your r,g,b the same you get gray

cairo_set_source_rgba(0.5, 0.5, 0.5, 1)
cairo_set_source_rgba(0.2, 0.2, 0.2, 1)

or if you have a hex value for your gray there is a color converter function towards the end of the guide

Offline

#3630 2012-11-05 22:59:44

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

Re: Conky v1.9 Thread

mrpeachy wrote:

how about
"the author takes no responsibility of any ailment suffered from the reading of this guide
including, but not limited to
weeping
sobbing
wailing
shrieking
blindness
fatigue
vomiting
listlessness
club foot
trench mouth
sudden adult death syndrome
monkey pox
galactorrhea
formication
gynecomastia
and rhinotillexomania"

What about:
delusions
paranoia
hallucinations
nervous ticks
rapid mood swings / out bursts of anger
night terrors
tendency to mutter in lua
low self-esteem
OCD


You can find my work here

Make everything ok button

Offline

#3631 2012-11-05 23:41:23

Sector11
#!'er to BL'er
From: SR11 Cockpit
Registered: 2010-05-05
Posts: 15,667
Website

Re: Conky v1.9 Thread

@ mrpeachy

In Chronograph.lua there are these lines to control font "slant"  and "weight":

-- FONT
cairo_select_font_face (cr, "monofur", CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_BOLD);
cairo_set_font_size (cr, 11)
cairo_set_source_rgba (cr,1,1,1,1)

In the template there is no way to do that - that I can see:

--SET DEFAULTS ##########################################################
--set defaults do not localise these defaults if you use a seperate display script
--default_font="CorporateMonoExtraBold"  --font must be in quotes
--default_font_size=11
default_font="monofur"
default_font_size=12
default_color=0xffffff--white
default_alpha=1--fully opaque
default_image_width=50
default_image_height=50
--END OF DEFAULTS #######################################################
--START OF WEATHER CODE -- START OF WEATHER CODE -- START OF WEATHER CODE

I want to use a bold "monofur".  Can you shed some light?


·  ↓   ↓   ↓   ↓   ↓   ↓  ·
BunsenLabs Forums now Open for Registration
·  ↑   ↑   ↑   ↑   ↑   ↑  · BL ModSquad

Offline

#3632 2012-11-06 00:26:28

mrpeachy
20% cooler
From: The Everfree Forest
Registered: 2009-11-08
Posts: 3,460

Re: Conky v1.9 Thread

Sector11 wrote:

@ mrpeachy

In Chronograph.lua there are these lines to control font "slant"  and "weight":

-- FONT
cairo_select_font_face (cr, "monofur", CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_BOLD);
cairo_set_font_size (cr, 11)
cairo_set_source_rgba (cr,1,1,1,1)

In the template there is no way to do that - that I can see:

--SET DEFAULTS ##########################################################
--set defaults do not localise these defaults if you use a seperate display script
--default_font="CorporateMonoExtraBold"  --font must be in quotes
--default_font_size=11
default_font="monofur"
default_font_size=12
default_color=0xffffff--white
default_alpha=1--fully opaque
default_image_width=50
default_image_height=50
--END OF DEFAULTS #######################################################
--START OF WEATHER CODE -- START OF WEATHER CODE -- START OF WEATHER CODE

I want to use a bold "monofur".  Can you shed some light?

that is simply becasue i didnt write that functionality into the out function
the out function is in the main v9000.lua and looks like this

function out(tx)--####################################################################
c=nil
c=(tx.c or default_color)
a=nil
a=(tx.a or default_alpha)
f=nil
f=(tx.f or default_font)
fs=nil
fs=(tx.fs or default_font_size)
x=nil
x=(tx.x or 0)
y=nil
y=(tx.y or 0)
txt=nil
txt=(tx.txt or "set txt")
local function col(c,a)
return ( (c/0x10000) % 0x100)/255,( (c/0x100) % 0x100)/255,(c % 0x100)/255,a
end--local function
cairo_select_font_face (cr, f, CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
cairo_set_font_size (cr, fs)
cairo_set_source_rgba (cr,col(c,a))
cairo_move_to (cr,x,y)
cairo_show_text (cr,txt)
cairo_stroke (cr)
end--function out ###################################################################

you need an additional setting, for example, face=
add that into the function like this

function out(tx)--####################################################################
f=nil
f=(tx.f or default_font)
--#############################
--additional face settings
face=nil
face=(tx.face or "normal")
if face=="normal" then
cairo_select_font_face (cr, f, CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
elseif face=="bold" then
cairo_select_font_face (cr, f, CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_BOLD);
elseif face=="italic" then
cairo_select_font_face (cr, f, CAIRO_FONT_SLANT_ITALIC, CAIRO_FONT_WEIGHT_NORMAL);
elseif face=="bolditalic" then
cairo_select_font_face (cr, f, CAIRO_FONT_SLANT_ITALIC, CAIRO_FONT_WEIGHT_BOLD);
end
--##############################
c=nil
c=(tx.c or default_color)
a=nil
a=(tx.a or default_alpha)
fs=nil
fs=(tx.fs or default_font_size)
x=nil
x=(tx.x or 0)
y=nil
y=(tx.y or 0)
txt=nil
txt=(tx.txt or "set txt")
local function col(c,a)
return ( (c/0x10000) % 0x100)/255,( (c/0x100) % 0x100)/255,(c % 0x100)/255,a
end--local function
cairo_set_font_size (cr, fs)
cairo_set_source_rgba (cr,col(c,a))
cairo_move_to (cr,x,y)
cairo_show_text (cr,txt)
cairo_stroke (cr)
end--function out ###################################################################

then use the new setting in the call

out({x=10,y=10,f="font",face="bold",txt="hello world"})

EDIT -TYPO!!
EDIT2 - OOPSIE

Last edited by mrpeachy (2012-11-07 20:27:11)

Offline

#3633 2012-11-06 01:32:15

tokee
New Member
Registered: 2012-11-04
Posts: 2

Re: Conky v1.9 Thread

I have a conky I'm using from DA, but everytime i use the conky config, it overrides the entire screen with the background color.  I cancel it and then have to basically squiggle a window around so the desktop redraws itself.  Any ideas?

here's the config:

use_xft yes
xftfont 123:size=8
xftalpha 0.1
update_interval 1
total_run_times 0
background no
own_window no
own_window_type override
own_window_transparent yes
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
double_buffer yes
minimum_size 250 5
maximum_width 500
draw_shades no
draw_outline no
draw_borders no
draw_graph_borders no
default_color white
default_shade_color red
default_outline_color green
alignment top_left
gap_x 20
gap_y 50
no_buffers yes
uppercase no
cpu_avg_samples 2
net_avg_samples 1
override_utf8_locale yes
use_spacer yes


TEXT
${voffset 10}${color EAEAEA}${font GE Inspira:pixelsize=120}${time %H:%M}${font}${voffset -84}${offset 10}${color FFA300}${font GE Inspira:pixelsize=42}${time %d} ${voffset -15}${color EAEAEA}${font GE Inspira:pixelsize=22}${time  %B} ${time %Y}${font}${voffset 24}${font GE Inspira:pixelsize=58}${offset -148}${time %A}${font}
${voffset 1}${offset 12}${font Ubuntu:pixelsize=10}${color FFA300}HD ${offset 9}$color${fs_free /} / ${fs_size /}${offset 30}${color FFA300}RAM ${offset 9}$color$mem / $memmax${offset 30}${color FFA300}CPU ${offset 9}$color${cpu cpu0}

Offline

#3634 2012-11-06 02:20:26

Sector11
#!'er to BL'er
From: SR11 Cockpit
Registered: 2010-05-05
Posts: 15,667
Website

Re: Conky v1.9 Thread

mrpeachy wrote:
Sector11 wrote:

@ mrpeachy

In Chronograph.lua there are these lines to control font "slant"  and "weight":

then use the new setting in the call

out({x=10,y=10,f="font",face="bold",txt="hello world"})

Doing that means that the "--SET DEFAULTS #######" area of every template I have created is now dead unless I re-write every line that has a:

  • txt="text here: "

  • txt=some_variable_here[1]


With that fix - the /home/sector11/v9000/v9000.lua script no longer recognizes the: --SET DEFAULTS ####### area of the templates.

Is there no way to make them part of the "default" settings of the templates in such a way that if the lines do not exist (old existing templates) they default to normal in both cases?

--SET DEFAULTS ##########################################################
--set defaults do not localise these defaults if you use a seperate display script
default_font="monofur" --font must be in quotes
default_font_size=12
default_font_slant=normal -- if this line does NOT exist in a template: default=normal
default_font_weight=bold -- if this line does NOT exist in a template: default=normal
default_color=0xffffff--white
default_alpha=1--fully opaque
default_image_width=50
default_image_height=50
--END OF DEFAULTS #######################################################

·  ↓   ↓   ↓   ↓   ↓   ↓  ·
BunsenLabs Forums now Open for Registration
·  ↑   ↑   ↑   ↑   ↑   ↑  · BL ModSquad

Offline

#3635 2012-11-06 02:24:04

Sector11
#!'er to BL'er
From: SR11 Cockpit
Registered: 2010-05-05
Posts: 15,667
Website

Re: Conky v1.9 Thread

tokee wrote:

I have a conky I'm using from DA, but everytime i use the conky config, it overrides the entire screen with the background color.  I cancel it and then have to basically squiggle a window around so the desktop redraws itself.  Any ideas?

Hi tokee - welcome.

Change these:

background no
own_window no
own_window_type override
own_window_transparent yes
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager

to:

background yes
own_window yes
own_window_type normal
own_window_transparent yes
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager

·  ↓   ↓   ↓   ↓   ↓   ↓  ·
BunsenLabs Forums now Open for Registration
·  ↑   ↑   ↑   ↑   ↑   ↑  · BL ModSquad

Offline

#3636 2012-11-06 02:50:59

mrpeachy
20% cooler
From: The Everfree Forest
Registered: 2009-11-08
Posts: 3,460

Re: Conky v1.9 Thread

@ Sector11 - you can do as you suggest

put in the default settings section

default_face="bold" --options are "normal" for normal/normal, "bold" for normal/bold, "italic" for italic/normal, "bolditalic" for italic/bold

then in the out function change

face=(tx.face or "normal")

to

face=(tx.face or default_face)

Offline

#3637 2012-11-06 13:29:34

Sector11
#!'er to BL'er
From: SR11 Cockpit
Registered: 2010-05-05
Posts: 15,667
Website

Re: Conky v1.9 Thread

mrpeachy wrote:

@ Sector11 - you can do as you suggest

put in the default settings section

default_face="bold" --options are "normal" for normal/normal, "bold" for normal/bold, "italic" for italic/normal, "bolditalic" for italic/bold

then in the out function change

face=(tx.face or "normal")

to

face=(tx.face or default_face)

OK so I put that in the Default Settings section of the v9000 template I'm using:

--SET DEFAULTS ##########################################################
--set defaults do not localise these defaults if you use a seperate display script
--default_font="CorporateMonoExtraBold"--font must be in quotes
--default_font_size=11
default_font="monofur"--font must be in quotes
default_font_size=12
default_color=0xffffff --white
default_alpha=1 --fully opaque
default_image_width=50
default_image_height=50
-- ### New ###
default_face="bold"
-- ### options are ###
-- "normal" for normal/normal
-- "bold" for normal/bold
-- "italic" for italic/normal
-- "bolditalic" for italic/bold
--END OF DEFAULTS #######################################################

and in /home/sector11/v9000/v9000.lua I made the appropriate change

function out(tx)--##############################################################
--#############################
--additional face settings
face=nil
face=(tx.face or default_face)  -- the new change from: face=(tx.face or "normal")
if face=="normal" then
cairo_select_font_face (cr, f, CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
elseif face=="bold" then
cairo_select_font_face (cr, f, CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_BOLD);
elseif face=="italic" then
cairo_select_font_face (cr, f, CAIRO_FONT_SLANT_ITALIC, CAIRO_FONT_WEIGHT_NORMAL);
elseif face=="bolditalic then
cairo_select_font_face (cr, f, CAIRO_FONT_SLANT_ITALIC, CAIRO_FONT_WEIGHT_BOLD);
end
--##############################################################################
c=nil
c=(tx.c or default_color)
a=nil
a=(tx.a or default_alpha)
f=nil
f=(tx.f or default_font)
fs=nil
fs=(tx.fs or default_font_size)
x=nil
x=(tx.x or 0)
y=nil
y=(tx.y or 0)
txt=nil
txt=(tx.txt or "set txt")
local function col(c,a)
return ( (c/0x10000) % 0x100)/255,( (c/0x100) % 0x100)/255,(c % 0x100)/255,a
end--local function
cairo_set_font_size (cr, fs)
cairo_set_source_rgba (cr,col(c,a))
cairo_move_to (cr,x,y)
cairo_show_text (cr,txt)
cairo_stroke (cr)
end--function out ##############################################################

And on par for the course, I must have messed up some place because it doesn't work.  sad


·  ↓   ↓   ↓   ↓   ↓   ↓  ·
BunsenLabs Forums now Open for Registration
·  ↑   ↑   ↑   ↑   ↑   ↑  · BL ModSquad

Offline

#3638 2012-11-06 15:48:31

Mercyshipdude
Member
From: The Internet (404 Google St.)
Registered: 2012-11-06
Posts: 31
Website

Re: Conky v1.9 Thread

Posted this in the Screenshot thread, but thought someone here might find it interesting.

First custom Conky. Based off of Nethack4 curses interface. Suggestions welcome!

2012_11_06_1352214426_1366x768_scrot.jpg

Inventory Code:

# this file goes in ~


background yes
use_xft yes
xftfont monospace:pixelsize=12
xftalpha 0.8
update_interval 1.0
total_run_times 0
own_window yes
own_window_transparent yes
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
double_buffer yes
draw_shades no
draw_outline no
draw_borders yes
draw_graph_borders yes
stippled_borders 0
border_width 2
default_color white
default_shade_color white
default_outline_color grey
alignment top_right
gap_x 50
gap_y 68
no_buffers yes
cpu_avg_samples 2
net_avg_samples 2
override_utf8_locale yes
minimum_size 700 600

## xcompmgr
#own_window_type override
#own_window_argb_visual yes

## cairo-compmgr
own_window_type normal
own_window_argb_visual yes


#leet chars: ┤┤└└┴┴┐┐││┘┘┌┌├├┬┬┼┼┴┴── ││ ▽▼△▲▵▴▾▿
TEXT
${font DejaVu Sans Mono:pixelsize=16:underline}Inventory:

${font monospace:pixelsize=14:bold}--Coins/Uptime $$-- ${font}
 $$ - ${color yellow}$$ ${color white}$uptime 

${font monospace:pixelsize=14:bold}--Weapons/CPU )-- ${font}
 a - ${color red}${font monospace:pixelsize=12:bold}) ${color cyan}${font monospace:pixelsize=12:bold}a blessed +2 CPU, ${cpu 1}% rusted (weapon in hands) ${font}${color white}{ ${hwmon temp 1 }°C}

${font monospace:pixelsize=13:bold}--Comestibles/Processes %-- (Currently Rotting: $running_processes)${font}
 q - ${color orange}${font monospace:pixelsize=12:bold}%${font} ${color grey}a cursed ${font monospace:pixelsize=12}${top name 1}   {${top cpu 1}}  
 s - ${color red}${font monospace:pixelsize=12:bold}%${font} ${color white}an uncursed ${font monospace:pixelsize=12}${top name 2}{${top cpu 2}}
 U - ${color green}${font monospace:pixelsize=12:bold}%${font} ${color white}a ${font monospace:pixelsize=12}${top name 3}          {${top cpu 3}}
 A - ${color white}${font monospace:pixelsize=12:bold}%${font} ${color white}a rotten ${font monospace:pixelsize=12}${top name 4}   {${top cpu 4}}
 P - ${color white}${font monospace:pixelsize=12:bold}%${font} ${color white}an uncursed ${font monospace:pixelsize=12}${top name 5}{${top cpu 5}}  

${font monospace:pixelsize=13:bold}--Scrolls/RAM ?-- (Words Read: $mem/$memmax) $font
 t - ${color blue}${font monospace:pixelsize=12:bold}?${font} ${color grey}a cursed scroll of ${font monospace:pixelsize=12}${top_mem name 1}   {${top_mem mem 1}}
 y - ${color white}${font monospace:pixelsize=12:bold}?${font} ${color white}an uncursed scroll of ${font monospace:pixelsize=12}${top_mem name 2}{${top_mem mem 2}}  
 b - ${color green}${font monospace:pixelsize=12:bold}?${font} ${color cyan}a blessed scroll of ${font monospace:pixelsize=12}${top_mem name 3}  {${top_mem mem 3}} ${color white} 
 d - ${color white}${font monospace:pixelsize=12:bold}?${font} ${color white}a scroll labeled ${font monospace:pixelsize=12}${top_mem name 4}     {${top_mem mem 4}}  
 n - ${color white}${font monospace:pixelsize=12:bold}?${font} ${color white}an uncursed scroll of ${font monospace:pixelsize=12}${top_mem name 5}{${top_mem mem 5}}

${font monospace:pixelsize=13:bold}--Spellbooks/HDD +-- (Words Read: ${fs_used /home}/${fs_size /home}) $font
 i - ${color white}${font monospace:pixelsize=12:bold}+${font} ${color white}an uncursed spellbook of ${font monospace:pixelsize=12}Reading {$diskio_read}} 
 S - ${color green}${font monospace:pixelsize=12:bold}+${font} ${color grey}a cursed scroll of ${font monospace:pixelsize=12}Writing {$diskio_write}}
 L - ${color red}${font monospace:pixelsize=12:bold}(${font} ${color white}a magic marker labeled /home/mercy (charge : ${fs_bar 5,120 /home/mercy/})
  
${font monospace:pixelsize=13:bold}--Potions/Local +-- (Total Chemicals: ${tcp_portmon 1 32767 count}) $font
 j - ${color red}${font monospace:pixelsize=12:bold}!${font} ${color white}an uncursed potion of ${tcp_portmon 1 32767 rhost 0} {${tcp_portmon 1 32767 lservice 0}} 
 Q - ${color blue}${font monospace:pixelsize=12:bold}!${font} ${color white}an uncursed potion of ${tcp_portmon 1 32767 rhost 1} {${tcp_portmon 1 32767 lservice 1}} 
 M - ${color orange}${font monospace:pixelsize=12:bold}!${font} ${color white}an uncursed potion of ${tcp_portmon 1 32767 rhost 2} {${tcp_portmon 1 32767 lservice 2}} 

${font monospace:pixelsize=13:bold}--Wands/Internet +-- (Total Charges: ${tcp_portmon 32768 61000 count}) $font
 C - ${color white}${font monospace:pixelsize=12:bold}/${font} ${color white}an uncursed potion of ${tcp_portmon 32768 61000 rhost 0} {${tcp_portmon 32768 61000 rservice 0}}
 g - ${color cyan}${font monospace:pixelsize=12:bold}/${font} ${color white}an uncursed potion of ${tcp_portmon 32768 61000 rhost 1} {${tcp_portmon 32768 61000 rservice 1}}
 H - ${color purple}${font monospace:pixelsize=12:bold}/${font} ${color white}an uncursed potion of ${tcp_portmon 32768 61000 rhost 2} {${tcp_portmon 32768 61000 rservice 2}}

Map and Calender code:

# conky configuration
#
# The list of variables has been removed from this file in favour
# of keeping the documentation more maintainable.
# Check http://conky.sf.net for an up-to-date-list.
#
# For ideas about how to modify conky, please see:
# http://crunchbanglinux.org/forums/topic/59/my-conky-config/
#
# For help with conky, please see:
# http://crunchbanglinux.org/forums/topic/2047/conky-help/
#
# Enjoy! :)
##############################################
# Settings
##############################################
background yes
use_xft yes
xftfont monospace:pixelsize=12
xftalpha 0.8
update_interval 1.0
total_run_times 0
own_window yes
own_window_transparent yes
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
double_buffer yes
draw_shades no
draw_outline no
draw_borders yes
draw_graph_borders yes
stippled_borders 0
border_width 2
default_color white
default_shade_color white
default_outline_color grey
alignment top_left
gap_x 30
gap_y 68
no_buffers yes
cpu_avg_samples 2
net_avg_samples 2
override_utf8_locale yes
use_spacer left
minimum_size 100 100
#Maximum_width 573
own_window_type normal
own_window_argb_visual yes
imlib_cache_size 800
text_buffer_size 8000
##############################################
#  Output
##############################################
TEXT
${color blue}${execi 300 gcalcli --nc agenda 12am 11:59pm}
${color white}You die...
┌────────────────────────────────────────────────────────────────────────────────┐
│                                                                                │
│                ┌────────────┐                                                  │
│                │······)······░                                                 │
│ ┌───────┐      │············│░                                                 │
│ │···%···+      └───────────+┘░                                                 │
│ │·······│                ░░░░░░░░░░░░░░░░░░░░░                                 │
│ │······≾·░                ░  ░               ░                                 │
│ └───────┘░              ░░░                  ░░0                               │
│          ░              ░                   ░░░░░░░                            │
│          ░    ░░░░░░░░░░░               ┌───┐  ░░░┌───┐                        │
│          ░┌───█──────┐                  │···│ ░  ░····│                        │
│          ░············░                 │⌠··│     │···│                        │
│           │······`···│                  │···│ ░░░░+·>·│                        │
│           │····Ω·····█░░░              ░█····░░░░░│·⌠·+                        │
│           │··········│     ┌────┐    ░░░│···│   ░░····│                        │
│           │··········│     │···@│    ░  └───┘     └───┘                        │
│           │··········│     │·····░░░%░                                         │
│           └──────────┘     │····│                                              │
│                            │·%[·│                                              │
│                            └────┘                                              │
│                                                                                │
└────────────────────────────────────────────────────────────────────────────────┘

Mercy The Merciful Hacker                        IP: ${addr wlan0}
${color red}UP: ${color white}[${upspeedgraph wlan0 12,120 8b2132 fe8608}] Speed: ${upspeed wlan0} k/s       ESSID: ${wireless_essid wlan0}
${color white}DN: ${color white}[${downspeedgraph wlan0 12,120 8b2132 fe8608}] Dx: ${upspeed wlan0} k/s              Stressed

"Computers are useless, they can only give you answers" - Pablo Picasso

Offline

#3639 2012-11-06 16:02:09

dk75
#! Junkie
Registered: 2012-06-14
Posts: 250

Re: Conky v1.9 Thread

lionhead wrote:

i want to convert the numbers into words. but i have problems to convert some numbers (0,10,20,30, ...).

just some examples:
0 -> null -> zero
10 -> zehn -> ten
20 -> zwanzig -> twenty
30 -> dreißig -> thirty


my actual screenshot:
http://ompldr.org/vZzVtaA

the source code:

function n2w(number)
--by mrpeachy 11-4-2012
number=tonumber(number)
local n_len=string.len(number)

if number>99 then
h=tonumber(string.sub(number,1,1))
tu=tonumber(string.sub(number,2,3))
t=tonumber(string.sub(number,2,2))
u=tonumber(string.sub(number,3,3))
elseif number<100 then
tu=number
t=tonumber(string.sub(number,1,1))
u=tonumber(string.sub(number,2,2))
end
n1_tab={"eins","zwei","drei","vier","fünf","sechs","sieben","acht","neun","zehn","elf","zwölf","dreizehn","vierzehn","fünfzehn","sechzehn","siebzehn","achtzehn","neunzehn",}
n2_tab={"zehn","zwanzig","dreißig","vierzig","fünfzig","sechzig","siebzig","achtzig","neunzig"}
if number>0 then n0="" else n0="zero" end
if tu<20 and tu~=10 then 
	out=n1_tab[tu]
elseif tu==10 then
	out="zehn"
elseif tu>19 then
	if u>0 then 
	joinu="" 
	u=n1_tab[u]
	else 
	joinu=""
	u=""
	end
--lang,geschnitten,gesamt
g=string.sub(number,2,2)
--[[
tu -> lang 21
g  -> geschnitten 1
]]--
--	out=joinu..'lang:'..tu..' geschn.: '..g..' '..n2_tab[t]..'('..string.sub(tu,1,1)..','..string.sub(tu,2,2)..')'
	out=joinu..anfang(tu,g,n2_tab[t])
end

if number>99 and number~=100 then
	h=n1_tab[h]
	return out..h.." hundert"
elseif number==100 then
	return "one hundred"
elseif number<100 then
	return out
end
end--function


function anfang(lang,geschnitten,wort)

local anzahl=tonumber(lang) -- ganze zahl, z.b. 21
local kurzezahl=tonumber(geschnitten) -- letzte zahl, z.b. 1 von 21

if kurzezahl==1 or anzahl==1 then

 if string.len(anzahl)>1  then
 nummer='einund'..n2_tab[t]
 elseif string.len(anzahl)==1 then
 nummer='eins'
 end

elseif kurzezahl~=1 or anzahl ~=1 then
nummer=n2w(kurzezahl)..'und'..wort

elseif  tonumber(string.sub(anzahl,1,1)) and tonumber(string.sub(anzahl,2,2))==0 then
nummer=wort --> ganze zahlen , z.b. 20

end

return nummer

end -- der fun ktion

it would be nice if u could help me.



Try this:

 local numbers =	{
 	unity		={ "ein", "zwei", "drei", "vier", "fünf", "sechs", "sieben", "acht", "neun", "zehn", "elf", "zwölf", "dreizehn", "vierzehn", "fünfzehn", "sechzehn", "siebzehn", "achtzehn", "neunzehn"},
 	decimal		= {"zehn", "zwanzig", "dreißig","vierzig","fünfzig","sechzig","siebzig","achtzig","neunzig"},
 	n		= {nil, nil, nil},
 			}

 local function n2w(number)
 	local i, j, s = nil, 1, ''
 	for i in pairs(numbers.n) do numbers.n[i] = nil end
 	for i = string.len(number), 1, -1 do numbers.n[j]=tonumber(string.sub(number, i, i)); j=j+1 end
 	if not numbers.n[3] and not numbers.n[2] and numbers.n[1]==0 then return 'zero' end
 	if numbers.n[3] then s = numbers.unity[numbers.n[3]] .. 'hundert' end
 	if numbers.n[3] and numbers.n[2]>0 or numbers.n[3] and numbers.n[1]>0 then s = s .. ' ' end
 	if numbers.n[2] and numbers.n[2]*10+numbers.n[1]<20 then s = s .. numbers.unity[numbers.n[2]*10+numbers.n[1]]; return s end
 	if numbers.n[1]>0 then s=s .. numbers.unity[numbers.n[1]] end
 	if numbers.n[2] and numbers.n[2]>1 and numbers.n[1]>0 then s = s .. 'und' end
 	if numbers.n[2] and numbers.n[2]>0 then s = s .. numbers.decimal[numbers.n[2]] elseif numbers.n[1]==1 then s = s .. 's' end
 	return s
 end

and this is how it looks (wrapped in some display code):
conky_n2w-ger.png
Free file hosting from File Den!


Debian Sid (Minted) x86_64/3.12-10, Conky 2.0_pre, Xorg 7.7/1.15.0, KDE 4.11.5, Intel X3100
Lenovo T61, HITACHI HTS722010K9SA00 100GB, WDC_WD5000BEVT 500GB
Linux user No.: 483055 | Conky Pitstop

Offline

#3640 2012-11-06 16:13:07

Mercyshipdude
Member
From: The Internet (404 Google St.)
Registered: 2012-11-06
Posts: 31
Website

Re: Conky v1.9 Thread

Also, The only thing I can't figure out is  how to display #'s in the Nethack shell. I had to manually replace any that show up. Is there a way to tell conky to display them? Thanks ya'll!


"Computers are useless, they can only give you answers" - Pablo Picasso

Offline

#3641 2012-11-06 17:12:42

Sector11
#!'er to BL'er
From: SR11 Cockpit
Registered: 2010-05-05
Posts: 15,667
Website

Re: Conky v1.9 Thread

Mercyshipdude wrote:

Also, The only thing I can't figure out is  how to display #'s in the Nethack shell. I had to manually replace any that show up. Is there a way to tell conky to display them? Thanks ya'll!

That is one awesome conky!

And in answer to your question:
To use #! in a conky use:

${exec echo '#!'}

change to:

${exec echo '#'}

Last edited by Sector11 (2012-11-06 17:17:49)


·  ↓   ↓   ↓   ↓   ↓   ↓  ·
BunsenLabs Forums now Open for Registration
·  ↑   ↑   ↑   ↑   ↑   ↑  · BL ModSquad

Offline

#3642 2012-11-06 18:09:35

Mercyshipdude
Member
From: The Internet (404 Google St.)
Registered: 2012-11-06
Posts: 31
Website

Re: Conky v1.9 Thread

Sector11 wrote:

And in answer to your question:
To use #! in a conky use:

${exec echo '#!'}

change to:

${exec echo '#'}

Perfect! Thanks Sector11!


"Computers are useless, they can only give you answers" - Pablo Picasso

Offline

#3643 2012-11-06 18:25:56

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

Re: Conky v1.9 Thread

so it has come to my attention, that yet again I don't know what I am doing. I state this because out of the possible endings that my changes to this spiral code... this was not among them.
tZzYxbg

--local function caluculates points
local function pt(px,py,prad,pdeg)
local ppo=(math.pi/180)*pdeg
local px1=px+prad*(math.sin(ppo))
local py1=py-prad*(math.cos(ppo))
return px1,py1
end
--center point
cx,cy=100,100
--radius and degree increments
start_deg=-250
rad_i=1
deg_i=-8
min_i=12
max_i=80
--set line attributes
cairo_set_source_rgba(cr,.3,.3,.3,1)
cairo_set_line_width(cr,5)
cairo_set_line_cap(cr, CAIRO_LINE_CAP_ROUND)
--draw points
for i=min_i,max_i do
rad1=(i*1)*rad_i
deg1=start_deg+((i*1)*deg_i)
x1,y1=pt(cx,cy,rad1,deg1)
rad2=rad_i*(((i+1) or i)*1)
deg2=start_deg+(deg_i*(((i+1) or i)*1))
x2,y2=pt(cx,cy,rad2,deg2)
cairo_move_to(cr,x1,y1)
--beginning of cpu info
max_value=100
cpu_perc=tonumber(conky_parse("${cpu}"))
--spiral length percent
slp_x=x2/max_value
slp_y=y2/max_value
--sil spiral indicator length
sil_x=slp_x/cpu_perc
sil_y=slp_y/cpu_perc
cairo_line_to(cr,sil_x,sil_y)
cairo_stroke(cr)
end

so can I get a break down of the code or something?


You can find my work here

Make everything ok button

Offline

#3644 2012-11-06 18:30:00

mrpeachy
20% cooler
From: The Everfree Forest
Registered: 2009-11-08
Posts: 3,460

Re: Conky v1.9 Thread

Sector11 wrote:
mrpeachy wrote:

@ Sector11 - you can do as you suggest

put in the default settings section

default_face="bold" --options are "normal" for normal/normal, "bold" for normal/bold, "italic" for italic/normal, "bolditalic" for italic/bold

then in the out function change

face=(tx.face or "normal")

to

face=(tx.face or default_face)

OK so I put that in the Default Settings section of the v9000 template I'm using:

-- ### New ###
default_face="bold"
-- ### options are ###
-- "normal" for normal/normal
-- "bold" for normal/bold
-- "italic" for italic/normal
-- "bolditalic" for italic/bold
--END OF DEFAULTS #######################################################

and in /home/sector11/v9000/v9000.lua I made the appropriate change

function out(tx)--##############################################################
--#############################
--additional face settings
face=nil
face=(tx.face or default_face)  -- the new change from: face=(tx.face or "normal")
if face=="normal" then
cairo_select_font_face (cr, f, CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
elseif face=="bold" then
cairo_select_font_face (cr, f, CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_BOLD);
elseif face=="italic" then
cairo_select_font_face (cr, f, CAIRO_FONT_SLANT_ITALIC, CAIRO_FONT_WEIGHT_NORMAL);
elseif face=="bolditalic then
cairo_select_font_face (cr, f, CAIRO_FONT_SLANT_ITALIC, CAIRO_FONT_WEIGHT_BOLD);
end
--##############################################################################

And on par for the course, I must have messed up some place because it doesn't work.  sad

sorry sector11 but it wasn't you who messed up it was me big_smile

forgot a " in this line

elseif face=="bolditalic then

should be

elseif face=="bolditalic" then

Offline

#3645 2012-11-06 20:05:10

mrpeachy
20% cooler
From: The Everfree Forest
Registered: 2009-11-08
Posts: 3,460

Re: Conky v1.9 Thread

ansem_of_nexus wrote:

so it has come to my attention, that yet again I don't know what I am doing. I state this because out of the possible endings that my changes to this spiral code... this was not among them.
http://ompldr.org/tZzYxbg
so can I get a break down of the code or something?

this is how you could turn it into an indicator:

--local function caluculates points
local function pt(px,py,prad,pdeg)
local ppo=(math.pi/180)*pdeg
local px1=px+prad*(math.sin(ppo))
local py1=py-prad*(math.cos(ppo))
return px1,py1
end
--center point
cx,cy=100,100
--radius and degree increments
start_deg=-250
rad_i=1
deg_i=-8
min_i=12
max_i=80
--set line attributes
cairo_set_source_rgba(cr,.3,.3,.3,1)
cairo_set_line_width(cr,5)
cairo_set_line_cap(cr, CAIRO_LINE_CAP_ROUND)
--draw points
--background spiral
for i=min_i,max_i do
rad1=(i*1)*rad_i
deg1=start_deg+((i*1)*deg_i)
x1,y1=pt(cx,cy,rad1,deg1)
rad2=rad_i*(((i+1) or i)*1)
deg2=start_deg+(deg_i*(((i+1) or i)*1))
x2,y2=pt(cx,cy,rad2,deg2)
cairo_move_to(cr,x1,y1)
cairo_line_to(cr,x2,y2)
cairo_stroke(cr)
end
--beginning of cpu info
max_value=100
value=tonumber(conky_parse("${cpu}"))
val=(value/max_value)
range=max_i-min_i
val=(val*range)+min_i
--indicator spiral
cairo_set_source_rgba(cr,1,0,0,1)
for i=min_i,val do
rad1=(i*1)*rad_i
deg1=start_deg+((i*1)*deg_i)
x1,y1=pt(cx,cy,rad1,deg1)
rad2=rad_i*(((i+1) or i)*1)
deg2=start_deg+(deg_i*(((i+1) or i)*1))
x2,y2=pt(cx,cy,rad2,deg2)
cairo_move_to(cr,x1,y1)
cairo_line_to(cr,x2,y2)
cairo_stroke(cr)
end

due to how the spiral is drawn you wont get a linear progression of the indicator, ie at the middle the distance between points is much smaller than at the end

the most important thing is to understand what is going on inside the for loop
first of all why am i multiplying everything by 1  ie rad1=(i*1)*rad_i
this is only because i was thinking of having another variable that would affect the spiral, so i used the 1 as a place holder smile

in the for loop there is a variable i whose value changes incrementally, usually by +1 every cycle of the loop
so wherever you see i in the for loop, you can image it being replaced by a number
the range of i is given by, for example, "for i=min_i,max_i do"

so at the start of the for loop i=min_i=12 (to get rid of the first part of the spiral which is too tight)
so you could go through and write in 12 for every i and 13 for every i+1


when you are writing a for loop keep as much stuff OUTSIDE of the loop as possible
if you are only using one color for example, set it up before the loop
if you have for "i=1,100 do" and you are setting up the color inside, then every cycle the cairo_set_source_rgba code is being run 100 times

what i have done is to draw a background spiral in grey using one for loop
and then using the output of cpu to affect the i value in a second for loop which draws the indicator

Offline

#3646 2012-11-06 21:05:11

Sector11
#!'er to BL'er
From: SR11 Cockpit
Registered: 2010-05-05
Posts: 15,667
Website

Re: Conky v1.9 Thread

Mercyshipdude wrote:
Sector11 wrote:

And in answer to your question:
To use #! in a conky use:

${exec echo '#!'}

change to:

${exec echo '#'}

Perfect! Thanks Sector11!

You're welcome.

By the way:
"Computers are useless, they can only give you answers" - Pablo Picasso

ONLY if the code is correct!  A computers weakest link: ME!


·  ↓   ↓   ↓   ↓   ↓   ↓  ·
BunsenLabs Forums now Open for Registration
·  ↑   ↑   ↑   ↑   ↑   ↑  · BL ModSquad

Offline

#3647 2012-11-06 21:11:31

Sector11
#!'er to BL'er
From: SR11 Cockpit
Registered: 2010-05-05
Posts: 15,667
Website

Re: Conky v1.9 Thread

mrpeachy wrote:
Sector11 wrote:

And on par for the course, I must have messed up some place because it doesn't work.  sad

sorry sector11 but it wasn't you who messed up it was me big_smile

forgot a " in this line

elseif face=="bolditalic then

should be

elseif face=="bolditalic" then

OH MY!!!  You do that too, you're still my mentor. OK now I play....
Thank you mrpeachy, will have something for you to see shortly.


·  ↓   ↓   ↓   ↓   ↓   ↓  ·
BunsenLabs Forums now Open for Registration
·  ↑   ↑   ↑   ↑   ↑   ↑  · BL ModSquad

Offline

#3648 2012-11-06 22:53:31

Sector11
#!'er to BL'er
From: SR11 Cockpit
Registered: 2010-05-05
Posts: 15,667
Website

Re: Conky v1.9 Thread

OK I have a new one The Time Weather Machine!
adsTY26A.jpg

Thanks to mrpeachy for the edit to the v9000 script that allows a new value for default fonts in the v9000 templates.

The part of the v9000 script responsible
Starts at

function out(tx)

ends with:

end--function out

That section:

function out(tx)--##############################################################
--#############################
--additional face settings
face=nil
face=(tx.face or default_face)  -- old is: face=(tx.face or "normal")
if face=="normal" then
cairo_select_font_face (cr, f, CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
elseif face=="bold" then
cairo_select_font_face (cr, f, CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_BOLD);
elseif face=="italic" then
cairo_select_font_face (cr, f, CAIRO_FONT_SLANT_ITALIC, CAIRO_FONT_WEIGHT_NORMAL);
elseif face=="bolditalic" then
cairo_select_font_face (cr, f, CAIRO_FONT_SLANT_ITALIC, CAIRO_FONT_WEIGHT_BOLD);
end
--##############################################################################
c=nil
c=(tx.c or default_color)
a=nil
a=(tx.a or default_alpha)
f=nil
f=(tx.f or default_font)
fs=nil
fs=(tx.fs or default_font_size)
x=nil
x=(tx.x or 0)
y=nil
y=(tx.y or 0)
txt=nil
txt=(tx.txt or "set txt")
local function col(c,a)
return ( (c/0x10000) % 0x100)/255,( (c/0x100) % 0x100)/255,(c % 0x100)/255,a
end--local function
cairo_set_font_size (cr, fs)
cairo_set_source_rgba (cr,col(c,a))
cairo_move_to (cr,x,y)
cairo_show_text (cr,txt)
cairo_stroke (cr)
end--function out ##############################################################

and in the template:

-- ## New Options ###
default_face="bold"
-- "normal" for normal/normal
-- "bold" for normal/bold
-- "italic" for italic/normal
-- "bolditalic" for italic/bold

My conky:

# killall conky && conky -c /media/5/Conky/S11_Chronograph_Full_2.conky &
#
# Thank you:
# Chronograph LUA - mrpeachy (originally 4 clocks - tweaked by Sector11)
# v9000 LUA weather - mrpeachy
# background - londonali1010, mrpeachy, dk75
# filesystem code by dk75

###  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,below,skip_taskbar,skip_pager
#own_window_colour gray
own_window_class Conky
own_window_title Chronograph Full 2

# 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

### 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 normal
# own_window_argb_visual yes

### When ARGB visuals are enabled, this use this to modify the alpha value
### Use: own_window_type normal
### Use: own_window_transparent no
### Valid range is 0-255, where 0 is 0% opacity, and 255 is 100% opacity.
# own_window_argb_value 0

minimum_size 340 700  ##420 420   ## width, height
maximum_width 340     ##420       ## width, usually a good idea to equal minimum width

gap_x 10 #15        ### left &right
gap_y 10        ### up & down

alignment tl #ml
####################################################  End Window Settings  ###
###  Font Settings  ##########################################################
# Use Xft (anti-aliased font and stuff)
use_xft yes
#xftfont CorporateMonoExtraBold:size=9
xftfont monofur:bold:size=9
# X font when Xft is disabled, you can pick one with program xfontsel
#font 5x7
#font 6x10
#font 7x13
#font 8x13
#font 9x15
#font *mintsmild.se*
#font -*-*-*-*-*-*-34-*-*-*-*-*-*-*

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

uppercase no
######################################################  End Font Settings  ###
###  Color Settings  #########################################################
draw_shades no
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 C2CCFF # Not a clue - a blue #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 5
border_outer_margin 0
# border width
border_width 0
# graph borders
draw_graph_borders yes #no
#default_graph_size 15 40
#####################################################  End Borders Secton  ###
###  Miscellaneous Section  ##################################################
# Boolean value, if true, Conky will be forked to background when started.
background yes

# 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

# If enabled, values which are in bytes will be printed in human readable
# format (i.e., KiB, MiB, etc). If disabled, bytes is printed instead
format_human_readable yes

# Shortens units to a single character (kiB->k, GiB->G, etc.). Default is off.
short_units yes

#   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

##############################################  End Miscellaneous Section  ###
###  LUA Settings  ###########################################################
## draw-bg.lua - Above and After TEXT - requires a composite manager.
##
 lua_load /media/5/Conky/LUA/draw-bg.lua
#TEXT
# ${lua conky_draw_bg 125 0 0 0 0 0x000000 0.3}
#
# ----------------------------------------------------------------------------
## OR Both above TEXT - No composite manager required.
#
#lua_load /media/5/Conky/LUA/draw-bg.lua
#lua_draw_hook_pre draw_bg 20 0 0 0 0 0x000000 0.3
#
# TEXT
################### Chronograph ##############################################
lua_load /media/5/Conky/LUA/Chronograph_full.lua
lua_draw_hook_post main

################### Weather ##################################################
lua_load ~/v9000/v9000.lua
lua_draw_hook_pre weather
lua_load /media/5/Conky/LUA/crono_full_2.template.lua

#######################################################  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 12 0 0 0 0 0x000000 0.5}
${lua conky_draw_bg 175 0 0 350 350 0x000000 0.3}
${lua conky_draw_bg 60 115 35 120 120 0x000000 0.3}
${lua conky_draw_bg 55 40 120 110 110 0x000000 0.3}
${lua conky_draw_bg 55 205 122 110 110 0x000000 0.3}
${lua conky_draw_bg 60 115 200 120 120 0x000000 0.3}

crono_full_2.template.lua

--[[
 The latest script is a lua only weather script. aka: v9000
 http://crunchbang.org/forums/viewtopic.php?id=16100

 the file:
 http://dl.dropbox.com/u/19008369/weatheragain9000.lua.tar.gz

 mrppeachys LUA Tutorial
 http://crunchbang.org/forums/viewtopic.php?id=17246
]]
_G.weather_script = function()--#### DO NOT EDIT THIS LINE ##############
--these tables hold the coordinates for each repeat do not edit #########
top_left_x_coordinate={}--###############################################
top_left_y_coordinate={}--###############################################
--#######################################################################
--SET DEFAULTS ##########################################################
--set defaults do not localise these defaults if you use a seperate display script
default_font="monofur"--font must be in quotes
default_font_size=12
default_color=0xffffff --white
default_alpha=1 --fully opaque
default_image_width=50
default_image_height=50
-- ## New Options ###
default_face="bold"
-- "normal" for normal/normal
-- "bold" for normal/bold
-- "italic" for italic/normal
-- "bolditalic" for italic/bold
--END OF DEFAULTS #######################################################
--START OF WEATHER CODE -- START OF WEATHER CODE -- START OF WEATHER CODE

-- forecast
datay=375
datayy=15 --datay+(datayy*1)

datafx1=20

imgx=35
imgy=500
imgyy=60 -- imgy+(imgyy*1)
-- =============================================================================
-- Sun & Moon Rise -------------------------------------------------------------
   out({c=0xFAFAEC,a=1,x=10,y=15,txt="Sunrise"})
      out({c=0xFAFAEC,a=1,x=10,y=28,txt=sun_rise_24[1]})
   out({c=0xFAFAEC,a=1,x=290,y=15,txt="Moonrise"})
      out({c=0xFAFAEC,a=1,x=310,y=28,txt=moon_rise_24[1]})
-- Sun & Moon Set --------------------------------------------------------------
   out({c=0xC0C0C0,a=1,x=10,y=333,txt="Sunset"})
      out({c=0xC0C0C0,a=1,x=10,y=345,txt=sun_set_24[1]})
   out({c=0xC0C0C0,a=1,x=300,y=333,txt="Moonset"})
      out({c=0xC0C0C0,a=1,x=313,y=345,txt=moon_set_24[1]})
-- Moon Phase - Top Center Circle ----------------------------------------------
   out({c=0x48D1CC,a=1,x=150,y=40,txt=moon_phase[1]})
   image({x=148,y=67,w=55,h=55,file=moon_icon[1]})
-- image({x=148,y=67,w=55,h=55,file="/media/5/Conky/images/red_1.png"})

-- Forecast for Today - see Day# Circle - Left ---------------------------------
   out({c=0xFF8C00,fs=14,a=1,x=88,y=150,txt=high_temp[1]})
   image({x=70,y=150,w=50,h=50,file=weather_icon[1]})
-- image({x=70,y=150,w=50,h=50,file="/media/5/Conky/images/red_1.png"})
   out({c=0x00BFFF,fs=14,a=1,x=88,y=210,txt=low_temp[1]})

-- Above the Month Circle on the Right -----------------------------------------
-- Humidity
   out({c=0xFAFAEC,a=1,x=240,y=100,txt="Hum:"})
      out({c=0x48D1CC,a=1,x=268,y=100,txt=now["humidity"].."%"})
-- Chance of Rain
   out({c=0xFAFAEC,a=1,x=240,y=115,txt="Rain:"})
      out({c=0x48D1CC,a=1,x=277,y=115,txt=precipitation[1].."%"})
-- Wind Info - See Months Circle & below ---------------------------------------
   image({x=235,y=150,w=50,h=50,file=now["wind_icon"]})
-- image({x=235,y=150,w=50,h=50,file="/media/5/Conky/images/red_1.png"})
   out({c=0x48D1CC,a=1,x=240,y=245,txt=now["wind_km"]})
-- out({c=0x48D1CC,a=1,x=240,y=260,txt=now["wind_nesw"]})
   out({c=0xFAFAEC,a=1,x=250,y=260,txt="@"})
      out({c=0x48D1CC,a=1,x=260,y=260,txt=now["wind_deg"]})
-- Dew Point -------------------------------------------------------------------
   out({c=0xFAFAEC,a=1,x=238,y=275,txt="DP:"})
      out({c=0x48D1CC,a=1,x=260,y=275,txt=now["dew_point"].."°"})

-- Above Day# Circle on left ---------------------------------------------------
-- Cloud Cover
   out({c=0xFAFAEC,a=1,x=60,y=100,txt="CC:"})
      out({c=0x48D1CC,a=1,x=80,y=100,txt=cloud_cover[1].."%"})
-- Ceiling
   out({c=0xFAFAEC,a=1,x=45,y=115,txt="Ceil:"})
      out({c=0x48D1CC,a=1,x=80,y=115,txt=now["ceiling"]})
-- Current for Today - Day# Circle ---------------------------------------------
   out({c=0xFAFAEC,a=1,x=155,y=215,txt="T:"})
      out({c=0x9ACD32,fs=14,a=1,x=170,y=215,txt=now["temp"].."°"})
   image({x=132,y=218,w=80,h=80,file=now["weather_icon"]})
-- image({x=132,y=218,w=85,h=85,file="/media/5/Conky/images/red_1.png"})
   out({c=0xFAFAEC,a=1,x=155,y=310,txt="F:"})
      out({c=0x00BFFF,fs=14,a=1,x=170,y=310,txt=now["feels_like"].."°"})
-- Below day# Circle on left ---------------------------------------------------
-- Barometric Pressure
out({c=0xFAFAEC,a=1,x=42,y=245,txt=" BP:"})
	out({c=0x48D1CC,a=1,x=70,y=245,txt=now["pressure_mb"]})
-- UV
out({c=0xFAFAEC,a=1,x=55,y=260,txt="UV:"})
   out({c=0x48D1CC,a=1,x=80,y=260,txt=uv_index_num[1]})
      out({c=0x48D1CC,a=1,x=68,y=275,txt=uv_index_txt[1]})

-- Forecast for the next 3 hours -----------------------------------------------
-- image({x=5,y=353,w=340,h=2,file="/media/5/Conky/images/LightSlateGrey_1.png"})
   image({x=5,y=360,w=120,h=2,file="/media/5/Conky/images/LightSlateGrey_1.png"})
      out({c=0xFAFAEC,a=1,x=136,y=365,txt="Next 3 Hours"})
   image({x=230,y=360,w=115,h=2,file="/media/5/Conky/images/LightSlateGrey_1.png"})

-- 1st hour
out({c=0x48D1CC,x=52,y=380,txt=now["fc_hour1_time_24"]..":00"})
   image({w=80,h=80,x=30,y=380,file=now["fc_hour1_wicon"]})
-- image({w=80,h=80,x=30,y=380,file="/media/5/Conky/images/red_1.png"})
   out({c=0x00BFFF,fs=18,x=55,y=470,txt=now["fc_hour1_temp"] .."°"})
-- 2nd hour
out({c=0x48D1CC,x=159,y=380,txt=now["fc_hour2_time_24"]..":00"})
   image({w=80,h=80,x=135,y=380,file=now["fc_hour2_wicon"]})
-- image({w=80,h=80,x=135,y=380,file="/media/5/Conky/images/red_1.png"})
   out({c=0x00BFFF,fs=18,x=160,y=470,txt=now["fc_hour2_temp"] .."°"})
-- 3rd hour
out({c=0x48D1CC,x=268,y=380,txt=now["fc_hour3_time_24"]..":00"})
   image({w=80,h=80,x=245,y=380,file=now["fc_hour3_wicon"]})
-- image({w=80,h=80,x=245,y=380,file="/media/5/Conky/images/red_1.png"})
   out({c=0x00BFFF,fs=18,x=270,y=470,txt=now["fc_hour3_temp"] .."°"})
-- line
image({x=5,y=475,w=340,h=2,file="/media/5/Conky/images/LightSlateGrey_1.png"})
-- =============================================================================
-- FORECAST for the next 9 days
-- Forecast day 2 SUN
out({c=0x9ACD32,a=1,x=datafx1*1.8,y=datay+(datayy*8),txt=forecast_day_short[2]})
out({c=0x9ACD32,a=1,x=datafx1*3.2,y=datay+(datayy*8),txt=forecast_date[2]})
image({x=imgx,y=imgy,file=weather_icon[2]})
out({c=0xFF8C00,a=1,x=datafx1,y=datay+(datayy*9.5),txt=high_temp[2]})
out({c=0x00BFFF,a=1,x=datafx1,y=datay+(datayy*11),txt=low_temp[2]})
-- Forecast day 3 MON
out({c=0x9ACD32,a=1,x=datafx1*7.5,y=datay+(datayy*8),txt=forecast_day_short[3]})
out({c=0x9ACD32,a=1,x=datafx1*8.9,y=datay+(datayy*8),txt=forecast_date[3]})
image({x=imgx*4.35,y=imgy,file=weather_icon[3]})
out({c=0xFF8C00,a=1,x=datafx1*6.7,y=datay+(datayy*9.5),txt=high_temp[3]})
out({c=0x00BFFF,a=1,x=datafx1*6.7,y=datay+(datayy*11),txt=low_temp[3]})
-- Forecast day 4 TUE
out({c=0x9ACD32,a=1,x=datafx1*13.2,y=datay+(datayy*8),txt=forecast_day_short[4]})
out({c=0x9ACD32,a=1,x=datafx1*14.6,y=datay+(datayy*8),txt=forecast_date[4]})
image({x=imgx*7.55,y=imgy,file=weather_icon[4]})
out({c=0xFF8C00,a=1,x=datafx1*12.4,y=datay+(datayy*9.5),txt=high_temp[4]})
out({c=0x00BFFF,a=1,x=datafx1*12.4,y=datay+(datayy*11),txt=low_temp[4]})

-- Forecast day 5 WED
  out({c=0x9ACD32,a=1,x=datafx1*1.8,y=datay+(datayy*13),txt=forecast_day_short[5]})
  out({c=0x9ACD32,a=1,x=datafx1*3.2,y=datay+(datayy*13),txt=forecast_date[5]})
  image({x=imgx,y=imgy+(imgyy*1.2),file=weather_icon[5]})
  out({c=0xFF8C00,a=1,x=datafx1,y=datay+(datayy*14.5),txt=high_temp[5]})
  out({c=0x00BFFF,a=1,x=datafx1,y=datay+(datayy*16),txt=low_temp[5]})
-- Forecast day 6 THU
  out({c=0x9ACD32,a=1,x=datafx1*7.5,y=datay+(datayy*13),txt=forecast_day_short[6]})
  out({c=0x9ACD32,a=1,x=datafx1*8.9,y=datay+(datayy*13),txt=forecast_date[6]})
  image({x=imgx*4.35,y=imgy+(imgyy*1.2),file=weather_icon[6]})
  out({c=0xFF8C00,a=1,x=datafx1*6.7,y=datay+(datayy*14.5),txt=high_temp[6]})
  out({c=0x00BFFF,a=1,x=datafx1*6.7,y=datay+(datayy*16),txt=low_temp[6]})
-- Forecast day 7 FRI
  out({c=0x9ACD32,a=1,x=datafx1*13.2,y=datay+(datayy*13),txt=forecast_day_short[7]})
  out({c=0x9ACD32,a=1,x=datafx1*14.6,y=datay+(datayy*13),txt=forecast_date[7]})
  image({x=imgx*7.55,y=imgy+(imgyy*1.2),file=weather_icon[7]})
  out({c=0xFF8C00,a=1,x=datafx1*12.4,y=datay+(datayy*14.5),txt=high_temp[7]})
  out({c=0x00BFFF,a=1,x=datafx1*12.4,y=datay+(datayy*16),txt=low_temp[7]})

-- Forecast day 8 SAT
    out({c=0x9ACD32,a=1,x=datafx1*1.8,y=datay+(datayy*18),txt=forecast_day_short[8]})
    out({c=0x9ACD32,a=1,x=datafx1*3.2,y=datay+(datayy*18),txt=forecast_date[8]})
    image({x=imgx,y=imgy+(imgyy*2.5),file=weather_icon[8]})
    out({c=0xFF8C00,a=1,x=datafx1,y=datay+(datayy*19.5),txt=high_temp[8]})
    out({c=0x00BFFF,a=1,x=datafx1,y=datay+(datayy*21),txt=low_temp[8]})
-- Forecast day 9 SUN
    out({c=0x9ACD32,a=1,x=datafx1*7.5,y=datay+(datayy*18),txt=forecast_day_short[9]})
    out({c=0x9ACD32,a=1,x=datafx1*8.9,y=datay+(datayy*18),txt=forecast_date[9]})
    image({x=imgx*4.35,y=imgy+(imgyy*2.5),file=weather_icon[9]})
    out({c=0xFF8C00,a=1,x=datafx1*6.7,y=datay+(datayy*19.5),txt=high_temp[9]})
    out({c=0x00BFFF,a=1,x=datafx1*6.7,y=datay+(datayy*21),txt=low_temp[9]})
-- Forecast day 10 MON
    out({c=0x9ACD32,a=1,x=datafx1*13.2,y=datay+(datayy*18),txt=forecast_day_short[10]})
    out({c=0x9ACD32,a=1,x=datafx1*14.6,y=datay+(datayy*18),txt=forecast_date[10]})
    image({x=imgx*7.55,y=imgy+(imgyy*2.5),file=weather_icon[10]})
    out({c=0xFF8C00,a=1,x=datafx1*12.4,y=datay+(datayy*19.5),txt=high_temp[10]})
    out({c=0x00BFFF,a=1,x=datafx1*12.4,y=datay+(datayy*21),txt=low_temp[10]})

--########################################################################################
--END OF WEATHER CODE ----END OF WEATHER CODE ----END OF WEATHER CODE ---
--#######################################################################
end--of weather_display function do not edit this line ##################
--#######################################################################

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

use in conkyrc

lua_load /path/Chronograph.lua
lua_draw_hook_pre main
TEXT


-- INDEX (use find with):

-- ###### 12 OR 24 CLOCK FACE
-- SET BORDER OPTIONS ######  ALL CLOCKS

-- ### START CLOCK A ######################################
-- MARKS AROUND CLOCK A -- Large Main 24 HR Clock
-- CLOCK A HOUR HAND
-- CLOCK A MINUTE HAND SETUP
-- CLOCK A SECOND HAND SETUP
-- CLOCK A ###### 24 HR TIME

-- ### START DIAL B ### Top - Week Day Names Dial #########
-- ### START DIAL C ### Right - Month Names Dial ##########
-- ### START DIAL D ### Left - Day Numbers Dial ###########

-- ### START CLOCK E ######################################
-- MARKS AROUND CLOCK E -- Bottom - 12 HR Clock
-- CLOCK E HOUR HAND
-- CLOCK E MINUTE HAND SETUP
-- CLOCK E SECOND HAND SETUP
-- CLOCK E ###### 12 HR TIME

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

require 'cairo'

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)
-- ########################################################
-- SETTINGS AREA
-- local cpu=conky_parse("${cpu}")
-- local red-1=conky_parse("${image ~/Conky/images/red_1.png -p 0,0 -s 35x35}")

-- ###### 12 OR 24 CLOCK FACE #############################
local clock_type_A=24 -- Large Main 24 HR Clock
local clock_type_E=12 -- Bottom - 12 HR Clock

-- ###### CLOCK SETTINGS ##################################
-- 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=1

-- ########################################################
-- ### START DIAL B ### Top - Week Day Names Dial #########
-- DIAL POSITION FOR TEXT
local center_x=175
local center_y=95
local radius=50
-- FONT
cairo_select_font_face (cr, "monofur", CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_BOLD);
cairo_set_font_size (cr, 11)
cairo_set_source_rgba (cr,1,1,1,1) --(cr,194/255,204/255,255/255,1)	-- (cr,1,1,1,1)
-- TABLE OF TEXT -- in order
text_days={"Sun","Mon","Tue","Wed","Thr","Fri","Sat",}		-- English
--text_days={"Dom","Lun","Mar","Mie","Jue","Vie","Sab",}		-- Spanish
--text_days={"dim","lun","mar","mer","jeu","ven","sam",}		-- French
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
local extents=cairo_text_extents_t:create()
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=35
for i=1,7 do
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
-- DRAW HAND -- snaps to current day of week
local hand_length=30
local day_number=tonumber(os.date("%w"))
local point=(math.pi/180)*((360/7)*(day_number))
local x=0+hand_length*(math.sin(point))
local y=0-hand_length*(math.cos(point))
local hand_width=2
cairo_move_to (cr,center_x,center_y)
cairo_line_to (cr,center_x+x,center_y+y)
cairo_stroke (cr)
-- ### END DIAL B #########################################

-- ########################################################
-- ### START DIAL C ### Right - Month Names Dial ##########
-- DIAL POSITION FOR TEXT
local center_x=260
local center_y=175
local radius=45
-- FONT
cairo_select_font_face (cr, "monofur", CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_BOLD);
cairo_set_font_size (cr, 11)
cairo_set_source_rgba (cr,1,1,1,1) --(cr,194/255,204/255,255/255,1)	-- (cr,1,1,1,1)
-- TABLE OF TEXT -- in order
text_days={"Jan","Feb","Mar","Apr","May","Jun","Jul","Aag","Sep","Oct","Nov","Dec",}  -- English
--text_days={"Ene","Feb","Mar","Abr","May","Jun","Jul","Ago","Sep","Oct","Nov","Dic",} -- Spanish
--text_days={"jan","fév","mar","avr","mai","jui","jul","aôu","sep","oct","nov","déc",} -- French
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
local extents=cairo_text_extents_t:create()
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=32
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_stroke (cr)
end
-- DRAW HAND -- snaps to current month
local this_month=tonumber(os.date("%m"))
local hand_length=28 --radius for this calculation
local point=(math.pi/180)*((360/12)*(this_month-1))
local x=0+hand_length*(math.sin(point))
local y=0-hand_length*(math.cos(point))
cairo_move_to (cr,center_x,center_y)
cairo_line_to (cr,center_x+x,center_y+y)
cairo_stroke (cr)

-- ### END CLOCK C ########################################

-- ########################################################
-- ### START DIAL D ### Left - 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});
febdaynum=tonumber((os.difftime(t1,t2))/(24*60*60))
-- 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=95
local center_y=175
local radius=50
cairo_select_font_face (cr, "monofur", CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_BOLD);
cairo_set_font_size (cr, 9)
cairo_set_source_rgba (cr,1,1,1,1) --(cr,194/255,204/255,255/255,1)	-- (cr,1,1,1,1)
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
local text=i
local extents=cairo_text_extents_t:create()
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=40
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))
cairo_arc (cr,center_x+x,center_y+y,1,0,2*math.pi)
cairo_stroke (cr)
end
-- DRAW HAND -- snaps to current DAY
local this_day=tonumber(os.date("%d"))
local hand_length=35--radius for this calculation
local point=(math.pi/180)*((360/number_days)*(this_day-1))
local x=0+hand_length*(math.sin(point))
local y=0-hand_length*(math.cos(point))
cairo_move_to (cr,center_x,center_y)
cairo_line_to (cr,center_x+x,center_y+y)
cairo_stroke (cr)
-- ### END CLOCK D ########################################

-- ########################################################
-- ### START CLOCK E ######################################
-- MARKS AROUND CLOCK E -- Bottom - 12 HR Clock
local number_marks_E=12
-- set mark length
local m_length_E=0
-- set mark width
local m_width_E=0
-- 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,0,1-- opaque white
-- SETUP HOUR HANDS #######################################
-- CLOCK E HOUR HAND
-- set length of hour hand
hh_length_E=25
-- set hour hand width
hh_width_E=2
-- set hour hand line cap
hh_cap=CAIRO_LINE_CAP_ROUND
-- set hour hand color
hhr,hhg,hhb,hha=1,1,0,1-- fully opaque white
-- SETUP MINUTE HANDS #####################################
-- CLOCK E MINUTE HAND SETUP
-- set length of minute hand
mh_length_E=35
-- set minute hand width
mh_width_E=2
-- set minute hand line cap
mh_cap=CAIRO_LINE_CAP_ROUND
-- set minute hand color
mhr,mhg,mhb,mha=1,1,0,1-- fully opaque white
-- SETUP SECOND HANDS #####################################
-- CLOCK E SECOND HAND SETUP
-- set length of seconds hand
sh_length_E=32
-- set hour hand width
sh_width_E=1
-- 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
-- CLOCK E ###### 12 HR TIME ##############################
-- CLOCK SETTINGS
clock_radius=45
clock_centerx=175
clock_centery=260
-- DRAWING CODE
-- DRAW BORDER
cairo_set_source_rgba (cr,169/255,169/255,169/255,1)
cairo_set_line_width (cr,clock_border_width)
cairo_arc (cr,clock_centerx,clock_centery,clock_radius,0,2*math.pi)
cairo_stroke (cr)
-- 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_E
-- set line cap type
cairo_set_line_cap  (cr, m_cap)
-- set line width
cairo_set_line_width (cr,m_width_E)
-- set color and alpha for marks
cairo_set_source_rgba (cr,mr,mg,mb,ma)
-- START LOOP FOR SECOND MARKS
for i=1,number_marks_E 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_E))
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_E))
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
--[[ TIME CALCULATIONS CLOCK E
if clock_type_E==12 then
hours=tonumber(os.date("%I"))
-- convert hours to seconds
h_to_s=hours*60*60
elseif clock_type_E==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 and draw it
hsecs=h_to_s+m_to_s+seconds
-- calculate degrees for each second
hsec_degs=hsecs*(360/(60*60*clock_type_E))-- use equation ~ eliminate decimals
-- set radius to calculate hand points
radius=hh_length_E
-- 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)*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_E)
cairo_set_source_rgba (cr,hhr,hhg,hhb,hha)
cairo_set_line_cap  (cr, hh_cap)
cairo_stroke (cr)
-- DRAW MINUTE HAND
-- get minutes and seconds 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_E
-- 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_E)
cairo_set_source_rgba (cr,mhr,mhg,mhb,mha)
cairo_set_line_cap  (cr, mh_cap)
cairo_stroke (cr)
-- DRAW SECOND HAND
-- calculate degrees for each second
sec_degs=seconds*6
-- set radius to calculate hand points
radius=sh_length_E
-- set start line coordinates, the center of the circle
cairo_move_to (cr,clock_centerx,clock_centery)
-- calculate coordinates for end of seconds hand
point=(math.pi/180)*sec_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
cairo_set_line_width (cr,sh_width_E)
cairo_set_source_rgba (cr,shr,shg,shb,sha)
cairo_set_line_cap  (cr, sh_cap)
cairo_stroke (cr)


-- POSITION FOR TEXT HOUR NUMBERS
local center_x=175
local center_y=260
local radius=45
-- FONT
cairo_select_font_face (cr, "monofur", CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_BOLD);
cairo_set_font_size (cr, 11)
cairo_set_source_rgba (cr,194/255,204/255,255/255,1)	-- (cr,1,1,1,1)
-- TABLE OF TEXT -- in order
--text_days={"12","01","02","03","04","05","06","07","08","09","10","11",}
-- FOR A 12 HOUR CLOCK WITH THE NUMBERS 13-00
text_days={"00","13","14","15","16","17","18","19","20","21","22","23",}
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
local extents=cairo_text_extents_t:create()
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=32
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_stroke (cr)
end ]]

-- ### END CLOCK E ########################################




-- ########################################################
-- ### START CLOCK A ######################################
-- SET MARKS ##############################################
-- MARKS AROUND CLOCK A -- Large Main 24 HR Clock
local number_marks_A=24
-- set mark length
local m_length_A=0
-- set mark width
local m_width_A=0
-- 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,1-- opaque white
-- SETUP HOUR HANDS #######################################
-- CLOCK A HOUR HAND
-- set length of hour hand
hh_length_A=130
-- set hour hand width
hh_width_A=3
-- set hour hand line cap
hh_cap=CAIRO_LINE_CAP_ROUND
-- set hour hand color
hhr,hhg,hhb,hha=1,1,1,.5-- fully opaque white
-- SETUP MINUTE HANDS #####################################
-- CLOCK A MINUTE HAND SETUP
-- set length of minute hand
mh_length_A=145
-- set minute hand width
mh_width_A=2
-- set minute hand line cap
mh_cap=CAIRO_LINE_CAP_ROUND
-- set minute hand color
mhr,mhg,mhb,mha=1,1,1,.5-- fully opaque white
-- SETUP SECOND HANDS #####################################
-- CLOCK A SECOND HAND SETUP
-- set length of seconds hand
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
-- CLOCK A ###### 12 HR TIME ##############################
-- CLOCK SETTINGS
clock_radius=200
clock_centerx=175
clock_centery=175
-- DRAWING CODE
-- DRAW BORDER
cairo_set_source_rgba (cr,cbr,cbg,cbb,cba)
cairo_set_line_width (cr,clock_border_width)
cairo_arc (cr,clock_centerx,clock_centery,clock_radius,0,2*math.pi)
cairo_stroke (cr)
-- 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
-- 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,hhr,hhg,hhb,hha)
cairo_set_source_rgba (cr,169/255,169/255,169/255,1)
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,mhr,mhg,mhb,mha)
cairo_set_source_rgba (cr,169/255,169/255,169/255,1)
cairo_set_line_cap  (cr, mh_cap)
cairo_stroke (cr)
-- DRAW SECOND HAND
--[[
-- calculate degrees for each second
sec_degs=seconds*6
-- set radius to calculate hand points
radius=sh_length_A
-- set start line coordinates, the center of the circle
cairo_move_to (cr,clock_centerx,clock_centery)
-- calculate coordinates for end of seconds hand
point=(math.pi/180)*sec_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
cairo_set_line_width (cr,sh_width_A)
cairo_set_source_rgba (cr,shr,shg,shb,sha)
cairo_set_line_cap  (cr, sh_cap)
cairo_stroke (cr)
]]
-- ####################################################################
-- part of a second hand
--position
local center_x=175
local center_y=175
--get seconds value
local seconds=tonumber(os.date("%S"))
--calculate rotation of second hand in degrees
local arc=(math.pi/180)*((360/60)*seconds)
--calculate point 1
local radius1=140
local x1=0+radius1*math.sin(arc)
local y1=0-radius1*math.cos(arc)
--calculate point 2
local radius2=158
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,0/255,0/255,1)
cairo_stroke (cr)
-- ####################################################################

-- POSITION FOR TEXT HOUR NUMBERS
local center_x=175
local center_y=175
local radius=165
-- FONT
cairo_select_font_face (cr, "monofur", CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_BOLD);
cairo_set_font_size (cr, 15)
cairo_set_source_rgba (cr,1,1,1,1) --(cr,194/255,204/255,255/255,1)	-- (cr,1,1,1,1)
-- TABLE OF TEXT -- in order
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
local extents=cairo_text_extents_t:create()
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=150
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_stroke (cr)
end
--[[ HOUR POINTS CIRCLES,  ##########Uncoment section to draw rings around numbers
local radius=162
for i=1,60 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,12,0,2*math.pi)
cairo_stroke (cr)
end]]
-- ### END CLOCK A ########################################

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

·  ↓   ↓   ↓   ↓   ↓   ↓  ·
BunsenLabs Forums now Open for Registration
·  ↑   ↑   ↑   ↑   ↑   ↑  · BL ModSquad

Offline

#3649 2012-11-06 23:03:40

mrpeachy
20% cooler
From: The Everfree Forest
Registered: 2009-11-08
Posts: 3,460

Re: Conky v1.9 Thread

very nice work sector11 big_smile

Offline

Be excellent to each other!

#3650 2012-11-06 23:06:22

VastOne
#! Ranger
From: V-Ger
Registered: 2011-04-26
Posts: 10,165
Website

Re: Conky v1.9 Thread

Wow Sector11, that is incredible!   big_smile


VSIDO | Words That Build Or Destroy

I dev VSIDO

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.
Server: acrobat

Debian Logo