You are not logged in.
^ often it isn't as easy as this since one persons computer is different to anothers so their conky reflects their computer setup and might have to be adjusted for your computer
having said that there are some projects that set you up with a nice looking conky from scratch
like conky colors (google it and you'll find the scripts)other than that just look around this thread or conky pitstop (see sector11's signature) and see what you like
thanks
Offline
can someone direct me to a site with ready to go copy and paste conky scripts for crunch
Agree totally with what mrpeachy said. Even if you are running #! - your screen res comes into play, your CPU, AMD - Intel etc, single core, dual, triple quad - Intel i7 with 8 cores ... motherboard. Number of partitions , Harddrives etc etc ....
Just to many variables. Start with a simple conky and build on it.
This is my ~/.conkyrc - if I see this I know I started another conky wrong because ~/.conkyrc is the conky that is started by default if it exists.
If you are running #! this will work with some "minor adjustments"
1. Change the path to the LUA script: lua_load /media/5/Conky/LUA/draw-bg.lua
2. if you have a triple core CPU - otherwise add or subtract as necessary.
3. it is set to run on the desktop it is started on ... add "sticky" to:
- - - own_window_hints undecorated,below,skip_taskbar,skip_pager
- - - to run it on all desktops.
4. you need to be running a composite manager for this (I run compton).
see what we mean - different machines, different setup - same distro!
# killall conky && conky &
# To use #! in a conky use: ${exec echo '#!'}
### 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 Simple_Info
# 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 160 10 ## width, height
maximum_width 160 ## width, usually a good idea to equal minimum width
gap_x 10 # left-right
gap_y 40 # up-down
alignment tr
################################################### End Window Settings ###
### Font Settings #########################################################
# Use Xft (anti-aliased font and stuff)
use_xft yes
#xftfont Anonymous Pro:bold:size=9
xftfont DrjaVu Sans Mono:bold:size=8
# Alpha of Xft font. Must be a value at or between 1 and 0 ###
xftalpha 1
# 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 gray
default_outline_color black
default_color DCDCDC #220 220 2# killall conky && conky &
# To use #! in a conky use: ${exec echo '#!'}
### 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 Simple_Info
# 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 160 10 ## width, height
maximum_width 160 ## width, usually a good idea to equal minimum width
gap_x 10 # left-right
gap_y 40 # up-down
alignment tr
################################################### End Window Settings ###
### Font Settings #########################################################
# Use Xft (anti-aliased font and stuff)
use_xft yes
#xftfont Anonymous Pro:bold:size=9
xftfont DrjaVu Sans Mono:bold:size=8
# Alpha of Xft font. Must be a value at or between 1 and 0 ###
xftalpha 1
# 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 gray
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 5
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 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
0
# Default and Minimum size is 256 - needs more for single commands that
# "call" a lot of text IE: bash scripts
text_buffer_size 1028
# 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
# 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 ###########################################################
## 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 /media/5/Conky/LUA/draw-bg.lua
#lua_draw_hook_pre draw_bg 15 0 0 0 0 0x000000 0.5
# lua_draw_hook_post draw-bg 125 0 0 0 0 0x000000 0.01
#
# TEXT
#
####################################################### 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 15 0 0 0 0 0x000000 0.5}
${alignc}Information
${time %T}${alignr 5}${uptime_short}
${hr}
${alignc}${kernel}
${hr}
Host:${alignr 5}${nodename}
RAM:${alignr 5}${mem} / ${memmax}
Swap:${alignr 5}${swap} / ${swapmax}
Disk:${alignr 5}${fs_used /} / ${fs_size /}
CPU 1:${alignr 5}${cpu cpu1}%
CPU 2:${alignr 5}${cpu cpu2}%
CPU 3:${alignr 5}${cpu cpu3}%
CPU Avg:${alignr 5}${cpu cpu0}%
/Root: ${fs_size /}${alignr 5}${fs_used_perc /}%${color}
/Home: ${fs_size /home}${alignr 5}${fs_used_perc /home}%
SDA:
Read:${alignr 5}${diskio_read /dev/sda}
Write:${alignr 5}${diskio_write /dev/sda}
Down: ${downspeedf eth0}${alignr 5}Up: ${upspeedf eth0}
20 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 5
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 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
0
# Default and Minimum size is 256 - needs more for single commands that
# "call" a lot of text IE: bash scripts
text_buffer_size 1028
# 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
# 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 ###########################################################
## 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 /media/5/Conky/LUA/draw-bg.lua
#lua_draw_hook_pre draw_bg 15 0 0 0 0 0x000000 0.5
# lua_draw_hook_post draw-bg 125 0 0 0 0 0x000000 0.01
#
# TEXT
#
####################################################### 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 15 0 0 0 0 0x000000 0.5}
${alignc}Information
${time %T}${alignr 5}${uptime_short}
${hr}
${alignc}${kernel}
${hr}
Host:${alignr 5}${nodename}
RAM:${alignr 5}${mem} / ${memmax}
Swap:${alignr 5}${swap} / ${swapmax}
Disk:${alignr 5}${fs_used /} / ${fs_size /}
CPU 1:${alignr 5}${cpu cpu1}%
CPU 2:${alignr 5}${cpu cpu2}%
CPU 3:${alignr 5}${cpu cpu3}%
CPU Avg:${alignr 5}${cpu cpu0}%
/Root: ${fs_size /}${alignr 5}${fs_used_perc /}%${color}
/Home: ${fs_size /home}${alignr 5}${fs_used_perc /home}%
SDA:
Read:${alignr 5}${diskio_read /dev/sda}
Write:${alignr 5}${diskio_write /dev/sda}
Down: ${downspeedf eth0}${alignr 5}Up: ${upspeedf eth0}draw-bg.lua
--[[Background originally by londonali1010 (2009)
ability to set any size for background mrpeachy 2011
ability to set variables for bg in conkyrc dk75
the change is that if you set width and/or height to 0
then it assumes the width and/or height of the conky window
so:
Above and After TEXT (requires a composite manager or it blinks!)
lua_load ~/wea_conky/draw_bg.lua
TEXT
${lua conky_draw_bg 10 0 0 0 0 0x000000 0.4}
OR Both above TEXT (no composite manager required - no blinking!)
lua_load ~/wea_conky/draw_bg.lua
lua_draw_hook_pre draw_bg 10 0 0 0 0 0x000000 0.5
TEXT
Note
${lua conky_draw_bg 20 0 0 0 0 0x000000 0.4}
See below: 1 2 3 4 5 6 7
${lua conky_draw_bg corner_radius x_position y_position width height color alpha}
covers the whole window and will change if you change the minimum_size setting
1 = 20 corner_radius
2 = 0 x_position
3 = 0 y_position
3 = 0 width
5 = 0 height
6 = 0x000000 color
7 = 0.4 alpha
######### calendar function ##################################################
then to use it, you activate the calendar function BELOW TEXT like this
${lua luacal {settings}}
#${lua luacal {x=,y=,tf="",tfs=,tc=,ta=,bf="",bfs=,bc=,ba=,hf="",hfs=,hc=,ha=,sp="",gh=,gt=,gv=,sd=}}
# x=x position top left
# y=y position top left
# tf=title font, eg "mono" must be in quotes
# tfs=title font size
# tc=title color
# ta=title alpha
# bf=body font, eg "mono" must be in quotes
# bfs=body font size
# bc=body color
# ba=body alpha
# hf=highlight font, eg "mono" must be in quotes
# hfs=highlight font size
# hc=highlight color
# ha=highlight alpha
# sp=spacer, eg " " or sp="0"... 0,1 or 2 spaces can help with positioning of non-monospaced fonts
# gt=gap from title to body
# gh=gap horizontal between columns
# gv=gap vertical between rows
# sd=start day, 0=Sun, 1=Mon
# hstyle = heading style, 0=just days, 1=date insert
# tdf=title date font, eg "mono" must be in quotes
# tdfs=title date font size
# tdc=title date color
# tda=title date alpha
# test line
-- ${lua luacal {x=10,y=100,tf="Purisa",tfs=24,tc=0xf67e16,ta=1,bf="First Order",bfs=26,bc=0xecd32a,ba=1,hf="Purisa",hfs=18,hc=0xf67e16,ha=1,sp=" ",gh=40,gt=25,gv=20,sd=0,hstyle=1,tdf="First Order",tdfs=28,tdc=0xff0000,tda=1}}
]]
require 'cairo'
local cs, cr = nil
function rgb_to_r_g_b(colour,alpha)
return ((colour / 0x10000) % 0x100) / 255., ((colour / 0x100) % 0x100) / 255., (colour % 0x100) / 255., alpha
end
function conky_draw_bg(r,x,y,w,h,color,alpha)
if conky_window == nil then return end
if cs == nil then cairo_surface_destroy(cs) end
if cr == nil then cairo_destroy(cr) end
local cs = cairo_xlib_surface_create(conky_window.display, conky_window.drawable, conky_window.visual, conky_window.width, conky_window.height)
local cr = cairo_create(cs)
w=w
h=h
if w=="0" then w=tonumber(conky_window.width) end
if h=="0" then h=tonumber(conky_window.height) end
cairo_set_source_rgba (cr,rgb_to_r_g_b(color,alpha))
--top left mid circle
local xtl=x+r
local ytl=y+r
--top right mid circle
local xtr=(x+r)+((w)-(2*r))
local ytr=y+r
--bottom right mid circle
local xbr=(x+r)+((w)-(2*r))
local ybr=(y+r)+((h)-(2*r))
--bottom right mid circle
local xbl=(x+r)
local ybl=(y+r)+((h)-(2*r))
-----------------------------
cairo_move_to (cr,xtl,ytl-r)
cairo_line_to (cr,xtr,ytr-r)
cairo_arc(cr,xtr,ytr,r,((2*math.pi/4)*3),((2*math.pi/4)*4))
cairo_line_to (cr,xbr+r,ybr)
cairo_arc(cr,xbr,ybr,r,((2*math.pi/4)*4),((2*math.pi/4)*1))
cairo_line_to (cr,xbl,ybl+r)
cairo_arc(cr,xbl,ybl,r,((2*math.pi/4)*1),((2*math.pi/4)*2))
cairo_line_to (cr,xtl-r,ytl)
cairo_arc(cr,xtl,ytl,r,((2*math.pi/4)*2),((2*math.pi/4)*3))
cairo_close_path(cr)
cairo_fill (cr)
------------------------------------------------------------
cairo_surface_destroy(cs)
cairo_destroy(cr)
return ""
end
-- ###### calendar function ##################################################
function conky_luacal(caltab) -- {x=,y=,tf="",tfs=,tc=,ta=,bf="",bfs=,bc=,ba=,hf="",hfs=,hc=,ha=,sp="",gt=,gh=,gv=,sd=,hstyle=,tdf=,tdfs=,tdc=,tda=}
if conky_window == nil then return end
local cs = cairo_xlib_surface_create(conky_window.display, conky_window.drawable, conky_window.visual, conky_window.width, conky_window.height)
local cr = cairo_create(cs)
--############################################################################
if caltab.x==nil then
caltab=loadstring("return" .. caltab)()
end
local cal_x=caltab.x
local cal_y=caltab.y
local tfont=caltab.tf or "mono"
local tfontsize=caltab.tfs or 12
local tc=caltab.tc or 0xffffff
local ta=caltab.ta or 1
local bfont=caltab.bf or "mono"
local bfontsize=caltab.bfs or 12
local bc=caltab.bc or 0xffffff
local ba=caltab.ba or 1
local hfont=caltab.hf or "mono"
local hfontsize=caltab.hfs or 12
local hc=caltab.hc or 0xff0000
local ha=caltab.ha or 1
local spacer=caltab.sp or " "
local gaph=caltab.gh or 20
local gapt=caltab.gt or 15
local gapl=caltab.gv or 15
local sday=caltab.sd or 0
local hstyle=caltab.hstyle or 0
--convert colors
--local font=string.gsub(font,"_"," ")
local tred,tgreen,tblue,talpha=rgb_to_r_g_b(tc,ta)
--main body text color
local bred,bgreen,bblue,balpha=rgb_to_r_g_b(bc,ba)
--highlight text color
local hred,hgreen,hblue,halpha=rgb_to_r_g_b(hc,ha)
--############################################################################
--calendar calcs
local year=os.date("%G")
local today=tonumber(os.date("%d"))
local t1 = os.time( { year=year,month=03,day=01,hour=00,min=0,sec=0} );
local t2 = os.time( { year=year,month=02,day=01,hour=00,min=0,sec=0} );
local feb=(os.difftime(t1,t2))/(24*60*60)
local monthdays={ 31, feb, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }
local day=tonumber(os.date("%w"))+1-sday
local day_num = today
local remainder=day_num % 7
local start_day=day-(day_num % 7)
if start_day<0 then start_day=7+start_day end
local month=os.date("%m")
local mdays=monthdays[tonumber(month)]
local x=mdays+start_day
local dnum={}
local dnumh={}
if mdays+start_day<36 then
dlen=35
plen=29
else
dlen=42
plen=36
end
for i=1,dlen do
if i<=start_day then
dnum[i]=" "
else
dn=i-start_day
if dn=="nil" then dn=0 end
if dn<=9 then dn=(spacer .. dn) end
if i>x then dn="" end
dnum[i]=dn
dnumh[i]=dn
if dn==(spacer .. today) or dn==today then
dnum[i]=""
end
if dn==(spacer .. today) or dn==today then
dnumh[i]=dn
place=i
else dnumh[i]=" "
end
end
end--for
cairo_select_font_face (cr, tfont, CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
cairo_set_font_size (cr, tfontsize);
cairo_set_source_rgba (cr,tred,tgreen,tblue,talpha)
local extents=cairo_text_extents_t:create()
tolua.takeownership(extents)
if hstyle==0 then
if tonumber(sday)==0 then
dys={"SU","MO","TU","WE","TH","FR","SA"}
else
dys={"MO","TU","WE","TH","FR","SA","SU"}
end
--draw calendar titles
elseif hstyle==1 then
if tonumber(sday)==0 then
dys={"SU","MO"," "," "," ","FR","SA"}
cairo_text_extents(cr,"MO",extents)
local s=extents.x_advance+gaph
local f=gaph*5
local tdfont=caltab.tdf or "mono"
local tdfontsize=caltab.tdfs or 12
local tdc=caltab.tdc or 0xffffff
local tda=caltab.tda or 1
cairo_select_font_face (cr, tdfont, CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
cairo_set_font_size (cr, tdfontsize);
local tdred,tdgreen,tdblue,tdalpha=rgb_to_r_g_b(tdc,tda)
cairo_set_source_rgba (cr,tdred,tdgreen,tdblue,tdalpha)
local insert=os.date("%b %y")
cairo_text_extents(cr,insert,extents)
local w=extents.x_advance
cairo_move_to (cr, cal_x+((s+f)/2)-(w/2), cal_y)
cairo_show_text (cr,insert)
cairo_stroke (cr)
else
dys={"MO","TU"," "," "," ","SA","SU"}
cairo_text_extents(cr,"TU",extents)
local s=extents.x_advance+gaph
local f=gaph*5
local tdfont=caltab.tdf or "mono"
local tdfontsize=caltab.tdfs or 12
local tdc=caltab.tdc or 0xffffff
local tda=caltab.tda or 1
cairo_select_font_face (cr, tdfont, CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
cairo_set_font_size (cr, tdfontsize);
local tdred,tdgreen,tdblue,tdalpha=rgb_to_r_g_b(tdc,tda)
cairo_set_source_rgba (cr,tdred,tdgreen,tdblue,tdalpha)
local insert=os.date("%b %y")
cairo_text_extents(cr,insert,extents)
local w=extents.x_advance
cairo_move_to (cr, cal_x+((s+f)/2)-(w/2), cal_y)
cairo_show_text (cr,insert)
cairo_stroke (cr)
end
end
--draw calendar titles
for i=1,7 do
cairo_select_font_face (cr, tfont, CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
cairo_set_font_size (cr, tfontsize);
cairo_set_source_rgba (cr,tred,tgreen,tblue,talpha)
cairo_move_to (cr, cal_x+(gaph*(i-1)), cal_y)
cairo_show_text (cr, dys[i])
cairo_stroke (cr)
end
--draw calendar body
cairo_select_font_face (cr, bfont, CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
cairo_set_font_size (cr, bfontsize);
cairo_set_source_rgba (cr,bred,bgreen,bblue,balpha)
for i=1,plen,7 do
local fn=i
for i=fn,fn+6 do
cairo_move_to (cr, cal_x+(gaph*(i-fn)),cal_y+gapt+(gapl*((fn-1)/7)))
cairo_show_text (cr, dnum[i])
cairo_stroke (cr)
end
end
--highlight
cairo_select_font_face (cr, hfont, CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
cairo_set_font_size (cr, hfontsize);
cairo_set_source_rgba (cr,hred,hgreen,hblue,halpha)
for i=1,plen,7 do
local fn=i
for i=fn,fn+6 do
cairo_move_to (cr, cal_x+(gaph*(i-fn)),cal_y+gapt+(gapl*((fn-1)/7)))
cairo_show_text (cr, dnumh[i])
cairo_stroke (cr)
end
end
--############################################################################
caltab=nil
dlen=nil
plen=nil
cairo_destroy(cr)
cairo_surface_destroy(cs)
cr=nil
return ""
end-- end main function#######################################################Last edited by Sector11 (2012-11-15 03:24:54)
#! Etiquette | Conky PitStop | VSIDO | Interactive LUA
Weather v9000 | Teo x4 Sites | Arclance | Finnish
Offline
ok, working on a new one, kind of borrowed things from everyone on this one, I'm thinking about removing the forecast for today, as it's in the clock, and moving the 10day forecast to the top next to the clock, what do you all think?
McLovin's back! Hi guy!
Did you see the "fix" for the memory leak in the chronograph.lua script?
BTW, they love your version of the Chronograph clock on the Ubuntu French forums.
I agree with dropping "today" from the 10 weather conky
Moving it to the top is an option - I would agree with
- or move the chronograph to the bottom corner ...
OR - merge them into one conky ... top or bottom ... always an if, and, or but ...
#! Etiquette | Conky PitStop | VSIDO | Interactive LUA
Weather v9000 | Teo x4 Sites | Arclance | Finnish
Offline
^I agree with Sector11 Mclovin! Also, that conky on the right kinda looks like one I stole from you and did some 'changin' to!
@Sector11, I really like the idea of 'one conky to rule them all', so in that vein, stole your chrono! Made some changes of my own, and voila! Only question I have, is whatever I did, now the next 3 hours isn't showing the correct times. Also haven't found where to change wind from kmh to mph! I also have not attempted to enlarge the whole thing so as not to go blind trying to read some of the text. The downside to running a screen res of 1920x1080 on a laptop! Other than that, what an awesome job! It is the coolest one yet. (IMO of course) Check it out...
Doh! Figured out my problem with the next 3 hour stuff. Probably be able to get the kmh figured out in a minute as well. We'll see... Yep got that fixed as well.
Last edited by jed (2012-11-15 04:58:31)
Running 'VSIDO' GNU/Linux! Worlds Greatest all-in-one Debian based DISTRO! | Tried the rest, now try the best!!! | My blog | Monster Conky Thread
Offline
looks like i had an attack of derp when i wrote the wind units section
now["wind_gusts_km"] --> number followed by wind_km_unit eg 5 mph
now["wind_gusts_km_caps"] --> number followed by wind_kn_unit eg 5 MPH
now["wind_gusts_kts"] --> number followed by wind_kts_unit eg 5 kts
now["wind_gusts_kts_caps"] --> number followed by wind_kts_unit eg 5 KTS
now["wind_km"] --> number followed by wind_km_unit eg 5 mph
now["wind_km_caps"] --> number followed by wind_km_unit eg 5 MPH
now["wind_kts"] --> number followed by wind_kts_unit eg 5 kts
now["wind_kts_caps"] --> number followed by wind_kts_unit eg 5 KTSbut looking at the weather.testing.lua template i have these options for wind
out({c=0x00ffff,x=160,y=ypos,txt=now["wind_gusts_km"] })
ypos=gap+ypos
out({c=0x00ffff,x=160,y=ypos,txt=now["wind_gusts_km_caps"]})
ypos=gap+ypos
out({c=0x00ffff,x=160,y=ypos,txt=now["wind_gusts_kts"] })
ypos=gap+ypos
out({c=0x00ffff,x=160,y=ypos,txt=now["wind_km"]})
ypos=gap+ypos
out({c=0x00ffff,x=160,y=ypos,txt=now["wind_km_caps"]})
ypos=gap+ypos
out({c=0x00ffff,x=160,y=ypos,txt=now["wind_kts"]})
ypos=gap+ypos
out({c=0x00ffff,x=160,y=ypos,txt=now["wind_kts_caps"] })
out({x=465,y=ypos,txt= wind_mph[1] })
ypos=gap+ypos
out({x=465,y=ypos,txt= wind_km[1] })
ypos=gap+ypos
out({x=465,y=ypos,txt= wind_kts[1]})edited post in v9000 how to options list here http://crunchbang.org/forums/viewtopic. … 82#p177782
Last edited by mrpeachy (2012-11-15 05:10:04)
Online
for the 3 hours make sure you are accessing the right numbers
now["fc_hour1_time"] --> 8 (hour only, number only)
hour1, hour2 and hour3
Online
for the 3 hours make sure you are accessing the right numbers
now["fc_hour1_time"] --> 8 (hour only, number only)
hour1, hour2 and hour3
I had a "Doh" or derp moment as you so aptly stated above. I figured it out. Baby steps... (but I'm getting there!)
Jed
Running 'VSIDO' GNU/Linux! Worlds Greatest all-in-one Debian based DISTRO! | Tried the rest, now try the best!!! | My blog | Monster Conky Thread
Offline
Just noticed in terminal I'm getting a keyring error.
jedsdesk@jedsdesk:~$ WARNING: gnome-keyring:: couldn't connect to: /home/jedsdesk/.cache/keyring-6X6TMr/pkcs11: No such file or directoryAny ideas? Never mind, fixed that as well...
Now maybe I can be done? My SID Laptop
Last edited by jed (2012-11-15 06:52:45)
Running 'VSIDO' GNU/Linux! Worlds Greatest all-in-one Debian based DISTRO! | Tried the rest, now try the best!!! | My blog | Monster Conky Thread
Offline
unfortunately it will not work.
@ all lua-experts:
i need your help. the temperature is very often 'minus ein grad' that's why the exception is important.
here i call the function:
n2w(low_temp[1])and here the code of the function:
function n2w_fd(number)
number=tonumber(number)
local n_len=string.len(number)
if number<0 then
number=tonumber(string.sub(number,2,n_len))
minus="minus "
else
number=number
minus=""
end
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="null" end
if tu<20 and tu~=10 and tu~=0 then
out=n1_tab[tu]
elseif tu==10 then
out="zehn"
elseif tu==0 then
out="null"
elseif tu>19 then
if u>0 then
joinu=" "
u=n1_tab[u]
else
joinu=""
u=""
end
g=string.sub(number,2,2)
-- out=joinu..'lang:'..tu..' geschn.: '..g..' '..n2_tab[t]..'('..string.sub(tu,1,1)..','..string.sub(tu,2,2)..')'
out=international(tu,g,n2_tab[t])
-- out=n2_tab[t]..joinu..u -- original
end
if number>99 and number~=100 and number~=1 then
h=n1_tab[h]
return minus..h.." hundred and "..out
elseif number==100 then
return "einhundert"
elseif number<100 then
return minus..out
elseif number==1 then
if minus=="minus " then
return "minus ein grad"
else
return "whatever it should be for one"
end
end
end--function
function international(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] -- gives me for example 21, 31 etc
elseif string.len(anzahl)==1 then
nummer='eins' -- gives me the number 1
end
elseif kurzezahl~=1 or anzahl ~=1 then
if anzahl==0 then
nummer=wort -- should give me the word 'null' (zero)
elseif tonumber(string.sub(anzahl,1,1)) and tonumber(string.sub(anzahl,2,2))==0 then --
nummer=wort -- gives me numbers like 10,20,30 etc.
else
nummer=n2w(kurzezahl)..'und'..wort -- gives me such numbers like 22,23,24 etc.
end
end
return nummer
end -- der fun ktiondo u want a proof pic 
“If you wish to make an apple pie from scratch, you must first invent the universe.” Carl Sagan
Offline
Check it out...
Doh! Figured out my problem with the next 3 hour stuff. Probably be able to get the kmh figured out in a minute as well. We'll see... Yep got that fixed as well.
I just checked it out ... ummmmm what's that "00" on the top of a 12 hour clock? 
Last edited by Sector11 (2012-11-15 13:02:42)
#! Etiquette | Conky PitStop | VSIDO | Interactive LUA
Weather v9000 | Teo x4 Sites | Arclance | Finnish
Offline
looks like i had an attack of derp when i wrote the wind units section
edited post in v9000 how to options list here http://crunchbang.org/forums/viewtopic. … 82#p177782
Takes a good man to do that. You could have quietly sneaked in, in the middle of the night, made the changes and we'd probably never have known.
Thank you!
#! Etiquette | Conky PitStop | VSIDO | Interactive LUA
Weather v9000 | Teo x4 Sites | Arclance | Finnish
Offline
Yeah, yeah. Rub it in! Haven't looked hard enough into it. Do you know how to fix? Save me the time and brain cells!
Jed
Running 'VSIDO' GNU/Linux! Worlds Greatest all-in-one Debian based DISTRO! | Tried the rest, now try the best!!! | My blog | Monster Conky Thread
Offline
Yeah, yeah. Rub it in! Haven't looked hard enough into it. Do you know how to fix? Save me the time and brain cells!
Jed
You kill me Jed - you really do!
probably around line 623 you have something that looks like this:
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 doThat was changed to
text_days={"00","01","02","03","04","05","06","07","08","09","10","11",}
for i=1,12 doSo do a search for
"00" and replace that with "12" 
Last edited by Sector11 (2012-11-15 13:03:53)
#! Etiquette | Conky PitStop | VSIDO | Interactive LUA
Weather v9000 | Teo x4 Sites | Arclance | Finnish
Offline
Awesome. So it should look like this huh? Hopefully I'm not really killing you!
I added a few more things into the system part of it; Sys Temp, changed eth0 to wlan0, added a wireless signal strength with bar, and a battery/acadapter thingamabob! And one more processor.
Jed
Last edited by jed (2012-11-15 13:29:07)
Running 'VSIDO' GNU/Linux! Worlds Greatest all-in-one Debian based DISTRO! | Tried the rest, now try the best!!! | My blog | Monster Conky Thread
Offline
can someone direct me to a site with ready to go copy and paste conky scripts for crunch
Find one you like that matches your hardware specs; then ask questions here if necessary:
common "mistake" is to not have all the required fonts installed.
Back on topic; simple one line conky, i3 window manager - if only to break up the lua bling fest
Last edited by PackRat (2012-11-15 13:47:29)
"It does not require many words to speak the truth." - Chief Joseph, Nez Perce tribe
Offline
ok, working on a new one, kind of borrowed things from everyone on this one, I'm thinking about removing the forecast for today, as it's in the clock, and moving the 10day forecast to the top next to the clock, what do you all think?
May I have your conky config please????
Offline
McLovin's back! Hi guy!
Did you see the "fix" for the memory leak in the chronograph.lua script?
Yea, I got the updated one, though I didn't notice any leaks on the old one on my system, (granted I have 8g or ram), but I updated anyway.
BTW, they love your version of the Chronograph clock on the Ubuntu French forums.
That's a riot, I just started doing lua scripting, so it's nice to see that I made them well enough for ppl to like them 
Got /? | My Blog, nothing special 
The first GUI, and "on-line" system was created in 1968 by Douglas Engelbart, the system included modern day innovations such as video conferencing, and on-line file sharing.
Offline
McLovin wrote:ok, working on a new one, kind of borrowed things from everyone on this one, I'm thinking about removing the forecast for today, as it's in the clock, and moving the 10day forecast to the top next to the clock, what do you all think?
May I have your conky config please????
I haven't finished it yet, it's still very very unfinished, once I finish it, I will be posting a download to it
Got /? | My Blog, nothing special 
The first GUI, and "on-line" system was created in 1968 by Douglas Engelbart, the system included modern day innovations such as video conferencing, and on-line file sharing.
Offline
http://t.imgbox.com/ackg07Vu.jpg
I haven't finished it yet, it's still very very unfinished, once I finish it, I will be posting a download to it
I want the right Conky 
Offline
McLovin wrote:http://t.imgbox.com/ackg07Vu.jpg
I haven't finished it yet, it's still very very unfinished, once I finish it, I will be posting a download to itI want the right Conky
Oh, well that one I already have posted, you can get the entire conky set-up for my McBars conky from here
But if you just want to config for the right side, its actually 2 files, a config, and a lua script, I'll post them for you
here is the conkyrc file:
######################
# - Conky settings - #
######################
background no
update_interval .3
cpu_avg_samples 1
total_run_times 0
override_utf8_locale yes
double_buffer yes
#no_buffers yes
text_buffer_size 10240
imlib_cache_size 10240
minimum_size 270 1000
maximum_width 270
gap_x 25
gap_y 40
#####################
# - Text settings - #
#####################
use_xft yes
xftfont Antipasto:size=8
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 09FF00 #bright green
color3 007EFF #bright blue
color4 E3E3E3 #very light gray
color5 FF8600 #an orange shade
color6 CA8718 #a dust like color
color7 FFE500 #a darker yellow color
color8 C3FF00 #lime green
color9 00FCFF #sky blue
default_color c3c3c3
default_shade_color gray
default_outline_color black
#############################
# - Window specifications - #
#############################
own_window yes
own_window_transparent yes
own_window_type override
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
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 ~/McBars/scripts/bargraph.lua
lua_draw_hook_pre main_bars
TEXT
${voffset -1} Core System ${hr 2}
${goto 6}${voffset 4}${font StyleBats:size=16}i${font}${voffset -4}${goto 32}Distro:${alignr}${execi 2600 cat /etc/issue.net}
${goto 6}${voffset 4}${font xspiralmental:size=14}E${font}${voffset -4}${goto 32}Kernel:$alignr$kernel (${execi 3600 uname -m})
${goto 6}${voffset 4}${font StyleBats:size=14}o${font}${voffset -4}${goto 32}Uptime:${alignr}${uptime}
${goto 6}${voffset 4}${font StyleBats:size=16}q${font}${voffset -4}${goto 32}Processes:${alignr}$processes ($running_processes running)
${goto 6}${voffset 4}${font PizzaDude Bullets:size=14}J${font}${voffset -4}${goto 32}Updates:${alignr}${color FF452A}${execi 600 aptitude search "~U" | wc -l | tail}${color} available updates
${voffset 4}${goto 6}${font Poky:size=14}P${font}${voffset -4}${goto 28}${execi 1000 cat /proc/cpuinfo | egrep -m 1 '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 -c34-36}${alignr}Load: ${loadavg}
${goto 6}${font Poky:size=14}P${font}${voffset -4}${goto 28}CPU-1: ${freq_g 0}Gh ${cpu cpu0}%
${goto 6}${font Poky:size=14}P${font}${voffset -4}${goto 28}CPU-2: ${freq_g 1}Gh ${cpu cpu1}%
${goto 6}${font Poky:size=14}P${font}${voffset -4}${goto 28}CPU-3: ${freq_g 2}Gh ${cpu cpu2}%
${goto 6}${font Poky:size=14}P${font}${voffset -4}${goto 28}CPU-4: ${freq_g 3}Gh ${cpu cpu3}%
${voffset 8}${goto 28} Core System Temperatures:
${image ~/McBars/therm.png -p 6,205 -s 20x20}${voffset 8}${goto 28}CPU: ${color FF452A}${execi 30 sensors | grep "Core 0" | cut -d "+" -f2 | cut -c1-4}°c${color}
${image ~/McBars/therm.png -p 6,223 -s 20x20}${voffset 8}${goto 28}Mobo: ${color FF452A}${execi 30 sensors | grep 'temp2' | cut -c16-19}°c${color}
${image ~/McBars/therm.png -p 6,240 -s 20x20}${voffset 8}${goto 28}GFX: ${color FF452A}${nvidia temp}°c${color}
${goto 6}${font Martin Vogel's Symbols:size=16}j${font}${voffset -4}${goto 28}CPU Fan: ${color 2A95B4}${exec sensors | grep "fan1:" | cut -c14-21}$color ${voffset -10}${font Martin Vogel's Symbols:size=16}j${font}${voffset -4} Case Fan: ${color 2A95B4}${exec sensors | grep "fan2:" | cut -c14-21}$color
${voffset 8}${goto 6}${font Poky:size=14}l${font}${voffset -4}${goto 32}Volume: ${mixer}
${goto 6}${voffset 4}${font Poky:size=14}M${font}${voffset -8}${goto 32}RAM: ${mem}${voffset -4}${alignr}
${voffset 4}${goto 32}Total: ${memmax}
${goto 7.5}${voffset 4}${font Poky:size=15}a${font}${goto 32}${voffset -10}Highest:${goto 153}CPU${alignr}RAM
${goto 32}${voffset -5.5}${hr 1}
${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} File Systems ${hr 2}
${goto 3}${voffset 2}${font Poky:size=14}y${font}${goto 29}${voffset -11} Root: ${fs_used_perc /}% Used${alignr}Total Size ${fs_size /}
${goto 29} Free: ${fs_free /}
${goto 3}${voffset 2}${font Poky:size=14}y${font}${goto 29}${voffset -11} Home: ${fs_used_perc /home/mclovin/}% Used${alignr}Total Size ${fs_size /home/mclovin/}
${goto 29} Free: ${fs_free /home/mclovin/LShared}
${goto 3}${voffset 2}${font Poky:size=14}y${font}${goto 29}${voffset -11} L-Shared: ${fs_used_perc /home/mclovin/LShared}% Used${alignr}Total Size ${fs_size /home/mclovin/LShared}
${goto 29} Free: ${fs_free /home/mclovin/Shared}${alignr}
${goto 3}${voffset 2}${font Poky:size=14}y${font}${goto 29}${voffset -11} Linux-Files: ${fs_used_perc /home/mclovin/Linux-Files}% Used ${alignr}Total Size ${fs_size /home/mclovin/Linux-Files}
${goto 29} Free: ${fs_free /home/mclovin/Linux-Files}
${goto 3}${voffset 2}${font Poky:size=14}y${font}${goto 29}${voffset -11} Media: ${fs_used_perc /home/mclovin/Media}% Used${alignr}Total Size ${fs_size /home/mclovin/Media}
${goto 29} Free: ${fs_free /home/mclovin/Media}
${goto 3}${voffset 2}${font Poky:size=14}y${font}${goto 29}${voffset -11} Videos: ${fs_used_perc /home/mclovin/Videos}% Used${alignr}Total Size ${fs_size /home/mclovin/Videos}
${goto 29} Free: ${fs_free /home/mclovin/Videos}
${goto 3}${font Martin Vogel's Symbols:size=20}h${font}${voffset -4}${goto 32}Disk Activity: ${diskio}${alignr}${voffset -10}${diskiograph 18,150 00D7FF FF452A -l -t}
${image ~/McBars/therm.png -p 6,565 -s 20x20}${voffset}${goto 40}Drive Temps: SDa: ${color FF452A}${exec hddtemp /dev/sda -n --unit=C}°c${color} SDb: ${color FF452A}${exec hddtemp /dev/sdb -n --unit=C}°c${color} SDc: ${color FF452A}${exec hddtemp /dev/sdc -n --unit=C}°c${color}
${voffset 4} Network active interface: ${gw_iface} ${hr 2}
${color FF452A}${font PizzaDude Bullets:size=16}M${color}${font}${goto 32}${voffset -8}Up: ${upspeedf}${font}${voffset -2}${alignr}${upspeedgraph 18,160 00D7FF FF452A -l -t}
${voffset -16}${goto 32}Total: ${totalup}
${color 2A95B4}${font PizzaDude Bullets:size=16}S${color}${font}${goto 32}${voffset -8}Down: ${downspeedf}${font}${voffset -2}${alignr}${downspeedgraph 18,160 00D7FF FF452A -l -t}
${voffset -16}${goto 32}Total: ${totaldown}
${voffset}${font Poky:size=13}w${font}${goto 32}${voffset -10}Router IP: ${gw_ip}${alignr}Local IP: ${addr}
${goto 32}Public IP: ${alignr}${execi 300 wget -q -O - checkip.dyndns.org | sed -e 's/.*Current IP Address: //' -e 's/<.*$//'}
${if_running rhythmbox}${voffset -1} Rythmbox ${hr 2}
${goto 80}Status:${alignr 5}$alignr${exec conkyRhythmbox --datatype=ST}
${goto 80}Artist:${alignr 5}$alignr${scroll 70 ${exec conkyRhythmbox --datatype=AR}}
${goto 80}Title:${alignr 5}$alignr${scroll 70 ${exec conkyRhythmbox --datatype=TI}}
${goto 80}Album:${alignr 5}$alignr${scroll 70 ${exec conkyRhythmbox --datatype=AL}}
${goto 80}Position:${alignr 5}${alignr}${exec conkyRhythmbox --datatype=PT}/${exec conkyRhythmbox --datatype=LE} - ${exec conkyRhythmbox --datatype=PP}%$font
${goto 80}${color 2A95B4}${execibar 1 conkyRhythmbox --datatype=PP}
${execi 4 cp "`conkyRhythmbox --datatype=CA | sed -e 's/\\\//g'`" ~/.album}${image ~/.album -p 5,570 -s 65x60 -n}
${else}${if_running clementine}${voffset -1} Clementine ${hr 2}
${goto 80}Status:${alignr 5}$alignr${exec conkyClementine --datatype=ST}
${goto 80}Artist:${alignr 5}$alignr${scroll 70 ${exec conkyClementine --datatype=AR}}
${goto 80}Title:${alignr 5}$alignr${scroll 70 ${exec conkyClementine --datatype=TI}}
${goto 80}Album:${alignr 5}$alignr${scroll 70 ${exec conkyClementine --datatype=AL}}
${goto 80}Position:${alignr 5}${alignr}${exec conkyClementine --datatype=PT}/${exec conkyClementine --datatype=LE} - ${exec conkyClementine --datatype=PP}%$font
${goto 80}${color 2A95B4}${execibar 1 conkyClementine --datatype=PP}$color
${execi 4 cp "`conkyClementine --datatype=CA | sed -e 's/\\\//g'`" ~/.album}${image ~/.album -p 5,570 -s 65x60 -n}
${else}${if_running banshee}${voffset -1} BANSHEE ${hr 2}
${goto 80}Status:${alignr 5}${exec conkyBanshee --datatype=ST}
${goto 80}Artist:${alignr 5}${scroll 70 ${exec conkyBanshee --datatype=AR}}
${goto 80}Title:${alignr 5}${scroll 70 ${exec conkyBanshee --datatype=TI}}
${goto 80}Album:${alignr 5}${scroll 70 ${exec conkyBanshee --datatype=AL}}
${goto 80}Position:${alignr 5}${exec conkyBanshee --datatype=PT}/${exec conkyBanshee --datatype=LE} - ${exec conkyBanshee --datatype=PP}%$font
${goto 80}${color 2A95B4}${execibar 1 conkyBanshee --datatype=PP}${color}
${execi 4 cp "`conkyBanshee --datatype=CA | sed -e 's/\\\//g'`" ~/.album}${image ~/.album -p 5,570 -s 65x60 -n}
${else}${if_running guayadeque}${voffset -1} Guayadeque ${hr 2}
${goto 80}Status:${alignr 5}${exec conkyGuayadeque --datatype=ST}
${goto 80}Artist:${alignr 5}${scroll 70 ${exec conkyGuayadeque --datatype=AR}}
${goto 80}Title:${alignr 5}${scroll 70 ${exec conkyGuayadeque --datatype=TI}}
${goto 80}Album:${alignr 5}${scroll 70 ${exec conkyGuayadeque --datatype=AL}}
${goto 80}Position:${alignr 5}${exec conkyGuayadeque --datatype=PT}/${exec conkyGuayadeque --datatype=LE} - ${exec conkyGuayadeque --datatype=PP}%$font
${goto 80}${color 2A95B4}${execibar 1 conkyGuayadeque --datatype=PP}${color}
${execi 4 cp "`conkyGuayadeque --datatype=CA | sed -e 's/\\\//g'`" ~/.album}${image ~/.album -p 5,670 -s 65x60 -n}
${else}${if_running exaile}${voffset -1} Exaile ${hr 2}
${goto 80}Status:${alignr 5}${exec conkyExaile --datatype=ST}
${goto 80}Artist:${alignr 5}${scroll 70 ${exec conkyExaile --datatype=AR}}
${goto 80}Title:${alignr 5}${scroll 70 ${exec conkyExaile --datatype=TI}}
${goto 80}Album:${alignr 5}${scroll 70 ${exec conkyExaile --datatype=AL}}
${goto 80}Position:${alignr 5}${exec conkyExaile --datatype=PT}/${exec conkyExaile --datatype=LE} - ${exec conkyExaile --datatype=PP}%$font
${goto 80}${color 2A95B4}${execibar 1 conkyExaile --datatype=PP}${color}
${execi 4 cp "`conkyExaile --datatype=CA | sed -e 's/\\\//g'`" ~/.album}${image ~/.album -p 5,570 -s 65x60 -n}
${else}${font Antipasto-Black:pixelsize=30}${scroll 35 Media Player Not Currently Running}${font}${endif}${endif}${endif}${endif}${endif}and here is the bargraph.lua script that goes with it
--[[ 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 CPU1 ]--
name="cpu",
arg="cpu1",
max=100,
alarm=60,
bg_colour={0x000000,0.75},
bg_led={0x3c3c3c,0.5},
fg_colour={0x000000,1},
fg_led={0x2a95b4,1},
alarm_colour={0xff0000,0},
alarm_led={0xff0000,1},
blocks=27,
x=193, y=132,
height=2,width=11,
angle=270,
led_effect="e",
space=1,
cap="r",
},
{ --[ Graph for CPU1 ]--
name="cpu",
arg="cpu1",
max=100,
alarm=60,
bg_colour={0x000000,0.75},
bg_led={0x3c3c3c,0.5},
fg_colour={0x000000,1},
fg_led={0x2a95b4,1},
alarm_colour={0xff0000,0},
alarm_led={0xff0000,1},
blocks=27,
x=196, y=121,
height=2,width=11,
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={0x2a95b4,1},
alarm_colour={0xff0000,0},
alarm_led={0xff0000,1},
blocks=27,
x=193, y=149,
height=2,width=11,
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={0x2a95b4,1},
alarm_colour={0xff0000,0},
alarm_led={0xff0000,1},
blocks=27,
x=196, y=138,
height=2,width=11,
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={0x2a95b4,1},
alarm_colour={0xff0000,0},
alarm_led={0xff0000,1},
blocks=27,
x=193, y=166,
height=2,width=11,
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={0x2a95b4,1},
alarm_colour={0xff0000,0},
alarm_led={0xff0000,1},
blocks=27,
x=196, y=155,
height=2,width=11,
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={0x2a95b4,1},
alarm_colour={0xff0000,0},
alarm_led={0xff0000,1},
blocks=27,
x=193, y=184,
height=2,width=11,
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={0x2a95b4,1},
alarm_colour={0xff0000,0},
alarm_led={0xff0000,1},
blocks=27,
x=196, y=173,
height=2,width=11,
angle=90,
led_effect="e",
space=1,
cap="r",
},
{ --[ Graph for CPU Temp ]--
name="exec",
arg="sensors | grep 'Core 0' | cut -c15-19",
max=99,
alarm=60,
bg_colour={0x000000,0.75},
bg_led={0x3c3c3c,0.5},
fg_colour={0x000000,1},
fg_led={0x2a95b4,1},
alarm_colour={0xff0000,0},
alarm_led={0xff0000,1},
blocks=62,
x=86, y=213,
height=2,width=10,
angle=90,
led_effect="e",
space=1,
cap="r",
},
{ --[ Graph for Mobo Temp ]--
name="exec",
arg="sensors | grep 'temp2' | cut -c16-19",
max=127,
alarm=60,
bg_colour={0x000000,0.75},
bg_led={0x3c3c3c,0.5},
fg_colour={0x000000,1},
fg_led={0x2a95b4,1},
alarm_colour={0xff0000,0},
alarm_led={0xff0000,1},
blocks=62,
x=86, y=232,
height=2,width=10,
angle=90,
led_effect="e",
space=1,
cap="r",
},
{ --[ Graph for GPU Temp ]--
name="nvidia",
arg="temp",
max=100,
alarm=60,
bg_colour={0x000000,0.75},
bg_led={0x3c3c3c,0.5},
fg_colour={0x000000,1},
fg_led={0x2a95b4,1},
alarm_colour={0xff0000,0},
alarm_led={0xff0000,1},
blocks=62,
x=86, y=250,
height=2,width=10,
angle=90,
led_effect="e",
space=1,
cap="r",
},
{ --[ Graph for Volume ]--
name="mixer",
arg="",
max=100,
alarm=70,
bg_colour={0x000000,0.75},
bg_led={0x3c3c3c,0.5},
fg_colour={0x000000,1},
fg_led={0x2a95b4,1},
alarm_colour={0xff0000,0},
alarm_led={0xff0000,1},
blocks=64,
x=80, y=290,
height=2,width=10,
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={0x2a95b4,1},
alarm_colour={0xff0000,0},
alarm_led={0xff0000,1},
x=86,y=305,
blocks=93,
space=0,
height=2,width=23,
angle=90,
led_effect="e",
cap="r",
},
{ --[ Graph for Root ]--
name="fs_used_perc",
arg="/",
max=100,
alarm=60,
bg_colour={0x000000,0.75},
bg_led={0x3c3c3c,0.5},
fg_colour={0x000000,1},
fg_led={0x2a95b4,1},
alarm_colour={0xff0000,0},
alarm_led={0xff0000,1},
blocks=92,
x=90, y=414,
height=2,width=10,
angle=90,
led_effect="e",
space=0,
cap="r",
},
{ --[ Graph for LShared ]--
name="fs_used_perc",
arg="/home/mclovin",
max=100,
alarm=60,
bg_colour={0x000000,0.75},
bg_led={0x3c3c3c,0.5},
fg_colour={0x000000,1},
fg_led={0x2a95b4,1},
alarm_colour={0xff0000,0},
alarm_led={0xff0000,1},
blocks=92,
x=90, y=437,
height=2,width=10,
angle=90,
led_effect="e",
space=0,
cap="r",
},
{ --[ Graph for Shared ]--
name="fs_used_perc",
arg="/home/mclovin/LShared",
max=100,
alarm=60,
bg_colour={0x000000,0.75},
bg_led={0x3c3c3c,0.5},
fg_colour={0x000000,1},
fg_led={0x2a95b4,1},
alarm_colour={0xff0000,0},
alarm_led={0xff0000,1},
blocks=92,
x=90, y=460,
height=2,width=10,
angle=90,
led_effect="e",
space=0,
cap="r",
},
{ --[ Graph for Linux-Files ]--
name="fs_used_perc",
arg="/home/mclovin/Linux-Files",
max=100,
alarm=60,
bg_colour={0x000000,0.75},
bg_led={0x3c3c3c,0.5},
fg_colour={0x000000,1},
fg_led={0x2a95b4,1},
alarm_colour={0xff0000,0},
alarm_led={0xff0000,1},
blocks=92,
x=90, y=482,
height=2,width=10,
angle=90,
led_effect="e",
space=0,
cap="r",
},
{ --[ Graph for Media ]--
name="fs_used_perc",
arg="/home/mclovin/Media/",
max=100,
alarm=60,
bg_colour={0x000000,0.75},
bg_led={0x3c3c3c,0.5},
fg_colour={0x000000,1},
fg_led={0x2a95b4,1},
alarm_colour={0xff0000,0},
alarm_led={0xff0000,1},
blocks=92,
x=90, y=505,
height=2,width=10,
angle=90,
led_effect="e",
space=0,
cap="r",
},
{ --[ Graph for Media ]--
name="fs_used_perc",
arg="/home/mclovin/Videos/",
max=100,
alarm=60,
bg_colour={0x000000,0.75},
bg_led={0x3c3c3c,0.5},
fg_colour={0x000000,1},
fg_led={0x2a95b4,1},
alarm_colour={0xff0000,0},
alarm_led={0xff0000,1},
blocks=92,
x=90, y=528,
height=2,width=10,
angle=90,
led_effect="e",
space=0,
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)
endyou're gonna have to edit the files to suit your system, as these are set-up for mine, but it's not that hard to do.
Got /? | My Blog, nothing special 
The first GUI, and "on-line" system was created in 1968 by Douglas Engelbart, the system included modern day innovations such as video conferencing, and on-line file sharing.
Offline
Ok, I have a question, I'm trying to redo the colors in the Chronograph.lua, but I can't seem to get the hands and numbers in the smaller sections, (day, month, etc.), to be different, I change "cairo_set_source_rgba (cr,1,1,1,1)" to what I want, like say "(cr,42/255,149/255,180/255,1)" and it changes everything, not just the items I want.
Edit: never mind, I'm just stupid. I figured it out, I just added another "cairo_set_source_rgba " before the next section, and that solved it.
Last edited by McLovin (2012-11-15 18:57:58)
Got /? | My Blog, nothing special 
The first GUI, and "on-line" system was created in 1968 by Douglas Engelbart, the system included modern day innovations such as video conferencing, and on-line file sharing.
Offline
Awesome. So it should look like this huh? Hopefully I'm not really killing you!
![]()
I added a few more things into the system part of it; Sys Temp, changed eth0 to wlan0, added a wireless signal strength with bar, and a battery/acadapter thingamabob! And one more processor.Jed
Just by laughter and chuckles Jed, nothing serious. 
You have the extra space to do that where I have 1024 you have 1080. Where I hace 1280 you have {sigh} 19++ {I can't even type it} 
#! Etiquette | Conky PitStop | VSIDO | Interactive LUA
Weather v9000 | Teo x4 Sites | Arclance | Finnish
Offline
common "mistake" is to not have all the required fonts installed.
I'd say that one qualifies for neon lights!
#! Etiquette | Conky PitStop | VSIDO | Interactive LUA
Weather v9000 | Teo x4 Sites | Arclance | Finnish
Offline
Sector11 wrote:McLovin's back! Hi guy!
Did you see the "fix" for the memory leak in the chronograph.lua script?
Yea, I got the updated one, though I didn't notice any leaks on the old one on my system, (granted I have 8g or ram), but I updated anyway.
I have 6GB and didn't notice - probably for the same reason. But I have fixed every version of the chronograph.lua I have
Sector11 wrote:BTW, they love your version of the Chronograph clock on the Ubuntu French forums.
That's a riot, I just started doing lua scripting, so it's nice to see that I made them well enough for ppl to like them
It's not "how long", it's not "how many", it's the "quality" and "layout" that attracts people. And when you changed the 24 hour Chronograph to 12 hours and added weather! OH YEA! , it certainly grabbed my interest! Mind you I put my 24 hour clock back in place. 
#! Etiquette | Conky PitStop | VSIDO | Interactive LUA
Weather v9000 | Teo x4 Sites | Arclance | Finnish
Offline
It's not "how long", it's not "how many", it's the "quality" and "layout" that attracts people. And when you changed the 24 hour Chronograph to 12 hours and added weather! OH YEA! , it certainly grabbed my interest! Mind you I put my 24 hour clock back in place.
Well, thank you. I'm actually working on a reconfigured chrono-weather using v9000 in the clock instead of conkyForecast, as it doesn't work on some systems, for example, my Arch install, for some reason or another, conkyForecast doesn't work at all, also on the system that I'm on now, a custom built Debian Sid based system that I built, it's really flakey, coming and going randomly, so I think the v9000 will make it more stable, and a better layout all around.
I also have figured out how to make different areas different colors, as I posted earlier, you can see my progress in the screenshot below.
Got /? | My Blog, nothing special 
The first GUI, and "on-line" system was created in 1968 by Douglas Engelbart, the system included modern day innovations such as video conferencing, and on-line file sharing.
Offline
Copyright © 2012 CrunchBang Linux.
Proudly powered by Debian. Hosted by Linode.
Debian is a registered trademark of Software in the Public Interest, Inc.