It's been awhile since I posted here. It took me three days to read what has been posted since my last visit (yes, I have read every post in this thread) I have been distro hopping but finally came back to Ubuntu.
I don't like Unity, so I am now running Precise with gnome classic. I'm not real happy with the lack of customizing options, especially colors, but it'll work until I find something I like better. Anyway, back on topic, here
is my current conky setup.
It's all done in lua, currently running 4 scripts. The rc files are identical with the exception of lua_load lines.
Here is the my_info_lua_rc:
Code:
#Mostly copied and pasted by stylintile
##############################################
# Settings
##############################################
max_specials 10000
max_user_text 1500000
background no
use_xft yes
#xftfont Sans:size=12
#xftalpha 1
font Ubuntu Mono:size=10
total_run_times 0
own_window yes
own_window_argb_visual yes
own_window_transparent yes
own_window_type desktop
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
double_buffer yes
minimum_size 1920 1080
maximum_width 1920
draw_shades no
draw_outline no
draw_borders no
default_bar_size 185 9
draw_graph_borders yes
default_color white
default_shade_color black
default_outline_color white
alignment top_left
gap_x 0
gap_y 30
no_buffers yes
uppercase no
cpu_avg_samples 2
override_utf8_locale yes
text_buffer_size 512
top_name_width 10
if_up_strictness address
update_interval 5
lua_load /home/dale/scripts/my_info.lua
lua_draw_hook_pre main
#lua_draw_hook_post clock_rings
#lua_load ~/scripts/bargraph.lua
#lua_draw_hook_pre main_bars
TEXT
the nosmoke.lua:
Code:
--[[ This script was written by stylintile with a lot of help from mrpeachy on
http://crunchbang.org/forums/viewtopic.php?id=17246 ]]
require 'cairo'
--==============================================================================================================================
-- Functions
--==============================================================================================================================
-----------------------------------------------------------------
-- Color conversion
-----------------------------------------------------------------
local function col(c,a)
return ( (c/0x10000) % 0x100)/255,( (c/0x100) % 0x100)/255,(c % 0x100)/255,a
end--local function
-----------------------------------------------------------------
-- Rectangles
-----------------------------------------------------------------
function rectout(rct)--Lines--###
c=nil
c=(rct.c or 0xffffff)
a=nil
a=(rct.a or 1)
lw=nil
lw=(rct.lw or 3)
tlx=nil
tlx=(rct.tlx or 100)
tly=nil
tly=(rct.tly or 100)
rec_width=nil
rec_width=(rct.rec_width or 50)
rec_height=nil
rec_height=(rct.rec_height or 50)
---------------------------------------
cairo_set_line_width (cr,lw)
cairo_rectangle (cr,tlx,tly,rec_width,rec_height)
cairo_set_source_rgba (cr,col(c,a))
cairo_stroke (cr)
end--function rectout ###
-----------------------------------------------------------------
-- Rings
-----------------------------------------------------------------
function ringout2(rn2)--Meter Rings--###
c=nil
c=(rn2.c or 0xffffff)
a=nil
a=(rn2.a or 1)
lc=nil
lc=(rn2.lc or CAIRO_LINE_CAP_BUTT)
wid=nil
wid=(rn2.wid or 3)
cx=nil
cx=(rn2.cx or 100)
cy=nil
cy=(rn2.cy or 100)
rad=nil
rad=(rn2.rad or 10)
start=nil
start=(rn2.start or 0)
endang=nil
endang=(rn2.endang or 360)
---------------------------------------
cairo_set_line_width (cr,wid)
cairo_set_line_cap (cr, lc)
cairo_set_source_rgba (cr,col(c,a))
cairo_arc (cr,cx,cy,rad,(start-90)*(math.pi/180),(endang-90)*(math.pi/180))
cairo_stroke (cr)
end--function ringout2 ###
-----------------------------------------------------------------
-- Lines (Borders) Display
-----------------------------------------------------------------
function lineout(ln)--Lines--###
c=nil
c=(ln.c or 0xffffff)
a=nil
a=(ln.a or 1)
lw=nil
lw=(ln.lw or 3)
lc=nil
lc=(ln.lc or CAIRO_LINE_CAP_BUTT)
strtx=nil
strtx=(ln.strtx or 0)
strty=nil
strty=(ln.strty or 0)
enx=nil
enx=(ln.enx or 50)
eny=nil
eny=(ln.eny or 50)
---------------------------------------
cairo_set_line_width (cr,lw)
cairo_set_line_cap (cr, lc)
cairo_set_source_rgba (cr,col(c,a))
cairo_move_to (cr,strtx,strty)
cairo_line_to (cr,enx,eny)
cairo_stroke (cr)
end--function lineout ###
-----------------------------------------------------------------
-- Text Display
-----------------------------------------------------------------
function out(tx)--Text--###
c=nil
c=(tx.c or 0xffffff)
a=nil
a=(tx.a or 1)
f=nil
f=(tx.f or "mono")
fs=nil
fs=(tx.fs or 12)
x=nil
x=(tx.x or 0)
y=nil
y=(tx.y or 0)
txt=nil
txt=(tx.txt or "set txt")
fw=nil
fw=(tx.fw or CAIRO_FONT_WEIGHT_NORMAL)
fsl=nil
fsl=(tx.fsl or CAIRO_FONT_SLANT_NORMAL)
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, fsl, fw);
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--Text-- ###
-----------------------------------------------------------------
-- Terminal Command
-----------------------------------------------------------------
function os.capture(cmd, raw)
local f = assert(io.popen(cmd, 'r'))
local s = assert(f:read('*a'))
f:close()
if raw then return s end
s = string.gsub(s, '^%s+', '')
s = string.gsub(s, '%s+$', '')
s = string.gsub(s, '[\n\r]+', ' ')
return s
end
-----------------------------------------------------------------
-- Split String
-----------------------------------------------------------------
function string:split(delimiter)
local result = { }
local from = 1
local delim_from, delim_to = string.find( self, delimiter, from )
while delim_from do
table.insert( result, string.sub( self, from , delim_from-1 ) )
from = delim_to + 1
delim_from, delim_to = string.find( self, delimiter, from )
end
table.insert( result, string.sub( self, from ) )
return result
end--of function
-----------------------------------------------------------------
-- Main
-----------------------------------------------------------------
function conky_main()
if conky_window == nil then return end
local cs = cairo_xlib_surface_create(conky_window.display, conky_window.drawable, conky_window.visual, conky_window.width, conky_window.height)
cr = cairo_create(cs)
local updates=tonumber(conky_parse('${updates}'))
if updates>5 then
--======================================================================================================================================================
--##################################################--------------DISPLAY AREA-------------#############################################################
--======================================================================================================================================================
--==============================================================================================================================
-- Pithos
--==============================================================================================================================
--pithos.php from http://3dgo.net/2011/11/22/pull-info-from-pithos-for-conky/
xpos=680
ypos=348
playing="no"
pithos_playing=tonumber(os.capture("pgrep pithos"))
if pithos_playing==nil then pithos_playing=0 else pithos_playing=1 end
if pithos_playing==1 then
pithos_title=os.capture("php ~/Documents/pithos/pithos.php 'title' | cut -c 1-50")
pithos_artist=os.capture("php ~/Documents/pithos/pithos.php 'artist' | cut -c 1-50")
pithos_album=os.capture("php ~/Documents/pithos/pithos.php 'album' | cut -c 1-50")
out({x=xpos+10,y=ypos,c=0xf0f0f0,a=1,f="Augustus Beveled",fs=26,txt="Pithos Pandora"})
out({x=xpos+82,y=ypos,c=0xf0f0f0,a=1,f="Crystal",fs=26,txt="/"})
out({x=xpos,y=ypos+25,c=0xf0f0f0,a=1,f="Basicdots",fs=14,txt=pithos_title})
out({x=xpos,y=ypos+50,c=0xf0f0f0,a=1,f="Basicdots",fs=14,txt=pithos_artist})
out({x=xpos,y=ypos+75,c=0xf0f0f0,a=1,f="Basicdots",fs=14,txt=pithos_album})
else
out({x=xpos+10,y=ypos,c=0xf0f0f0,a=1,f="Augustus Beveled",fs=26,txt="Pithos Pandora"})
out({x=xpos+82,y=ypos,c=0xf0f0f0,a=1,f="Crystal",fs=26,txt="/"})
out({x=xpos+10,y=ypos+25,c=0xf0f0f0,a=1,f="Augustus Beveled",fs=26,txt="Not Playing"})
end
--==============================================================================================================================
-- Meters
--==============================================================================================================================
xpos=1147
ypos=124
-----------------------------------------------------------------
-- Border and Title
-----------------------------------------------------------------
lineout({strtx=xpos-27,enx=xpos+278,strty=ypos-61,eny=ypos-61,c=0x848484,a=1,lw=3})
lineout({strtx=xpos-26,enx=xpos-26,strty=ypos-61,eny=ypos+909,c=0x848484,a=1,lw=3})
lineout({strtx=xpos-27,enx=xpos+278,strty=ypos+909,eny=ypos+909,c=0x848484,a=1,lw=3})
out({x=xpos-17,y=ypos-65,c=0xf0f0f0,a=1,f="Augustus Beveled",fs=26,txt="Meters"})
-----------------------------------------------------------------
-- Meter Variables
-----------------------------------------------------------------
home=tonumber(conky_parse('${fs_used_perc /}'))
swap=tonumber(conky_parse('${swapperc}'))
mem=tonumber(conky_parse('${memperc}'))
cpuavg=tonumber(conky_parse('${cpu cpu0}'))
cpu1=tonumber(conky_parse('${cpu cpu1}'))
cpu2=tonumber(conky_parse('${cpu cpu2}'))
cpu3=tonumber(conky_parse('${cpu cpu3}'))
cpu4=tonumber(conky_parse('${cpu cpu4}'))
load1=tonumber(conky_parse('${loadavg 1}'))
load2=tonumber(conky_parse('${loadavg 2}'))
load3=tonumber(conky_parse('${loadavg 3}'))
upeth=tonumber(conky_parse('${upspeedf eth0}'))
downeth=tonumber(conky_parse('${downspeedf eth0}'))
uplan=tonumber(conky_parse('${upspeedf wlan0}'))
downlan=tonumber(conky_parse('${downspeedf wlan0}'))
if home==nil then home=0 end
if swap==nil then swap=0 end
if mem==nil then mem=0 end
if cpuavg==nil then cpuavg=0 end
if cpu1==nil then cpu1=0 end
if cpu2==nil then cpu2=0 end
if cpu3==nil then cpu3=0 end
if cpu4==nil then cpu4=0 end
if load1==nil then load1=0 end
if load2==nil then load2=0 end
if load3==nil then load3=0 end
if upeth==nil then upeth=0 end
if downeth==nil then downeth=0 end
if uplan==nil then uplan=0 end
if downlan==nil then downlan=0 end
metertablea={home,swap,mem,cpuavg,cpu1,cpu2,cpu3,cpu4,load1,load2,load3,upeth,downeth,uplan,downlan}
metertableb={100,100,100,100,100,100,100,100,4,4,4,100,500,100,500}
-----------------------------------------------------------------
-- Background Bars
-----------------------------------------------------------------
x=xpos+22
xlen=210
lcap=CAIRO_LINE_CAP_ROUND
lw=9
c=0x75b3d1
a=0.2
cairo_set_line_width (cr,lw)
cairo_set_line_cap (cr, lcap)
cairo_set_source_rgba (cr,col(c,a))
for i=1,15 do
y=(ypos-15)+((i-1)*64)
cairo_move_to (cr,x,y)
cairo_line_to (cr,x+xlen,y)
cairo_stroke (cr)
end
-----------------------------------------------------------------
-- Meter Background
-----------------------------------------------------------------
x=xpos+22
xlen=210
lcap=CAIRO_LINE_CAP_ROUND
lw=9
c=0x75b3d1
a=0.4
cairo_set_line_width (cr,lw)
cairo_set_line_cap (cr, lcap)
cairo_set_source_rgba (cr,col(c,a))
for i=1,15 do
y=(ypos-15)+((i-1)*64)
cairo_move_to (cr,x,y)
cairo_line_to (cr,x+((xlen/metertableb[i])*metertablea[i]),y)
cairo_stroke (cr)
end
-----------------------------------------------------------------
-- Meter Foreground
-----------------------------------------------------------------
x=xpos+22
xlen=210
lcap=CAIRO_LINE_CAP_ROUND
lw=4
c=0x75b3d1
a=0.7
cairo_set_line_width (cr,lw)
cairo_set_line_cap (cr, lcap)
cairo_set_source_rgba (cr,col(c,a))
for i=1,15 do
y=(ypos-15)+((i-1)*64)
cairo_move_to (cr,x,y)
cairo_line_to (cr,x+((xlen/metertableb[i])*metertablea[i]),y)
cairo_stroke (cr)
end
-----------------------------------------------------------------
-- Text Variables
-----------------------------------------------------------------
homesize=conky_parse("${fs_size /}")
homefree=conky_parse("${fs_free /}")
homeperc=conky_parse("${fs_used_perc /}")
maxram=conky_parse("${memmax}")
freeram=conky_parse("${memfree}")
usedram=conky_parse("${memperc}")
swapsize=conky_parse("${swapmax}")
swapfree=conky_parse("${swapfree}")
swapperc=conky_parse("${swapperc}")
load1=conky_parse("${loadavg 1}")
load2=conky_parse("${loadavg 2}")
load3=conky_parse("${loadavg 3}")
cpuavg=conky_parse("${cpu cpu0}")
cpu1=tonumber(conky_parse("${cpu cpu1}"))
cpu2=tonumber(conky_parse("${cpu cpu2}"))
cpu3=tonumber(conky_parse("${cpu cpu3}"))
cpu4=tonumber(conky_parse("${cpu cpu4}"))
upeth=conky_parse("${upspeedf eth0}")
downeth=conky_parse("${downspeedf eth0}")
upwlan=conky_parse("${upspeedf wlan0}")
downwlan=conky_parse("${downspeedf wlan0}")
-----------------------------------------------------------------
-- Labels
-----------------------------------------------------------------
datayadd=64 -- y=datay+(dataadd*1) use 1 or more
-- internet=(conky_parse("${if_up eth0}1${else}0${endif}"))
-- net1=tonumber(internet)
wireless=(conky_parse("${if_up wlan0}1${else}0${endif}"))
net2=tonumber(wireless)
meterlabel={"Home","Swap","RAM","CPU Avg.","CPU","CPU","CPU","CPU","Load","Load","Load","Ethernet Up","Ethernet Down","Wireless Up","Wireless Down"}
meterxpos={xpos+93,xpos+94,xpos+93,xpos+72,xpos+95,xpos+95,xpos+95,xpos+95,xpos+94,xpos+94,xpos+94,xpos+56,xpos+36,xpos+52,xpos+37}
meterentries=#meterlabel
out({x=xpos+150,y=ypos+232,c=0xf0f0f0,a=0.7,f="Crystal",fs=26,txt="1"})
out({x=xpos+150,y=(ypos+232)+(datayadd),c=0xf0f0f0,a=0.7,f="Crystal",fs=26,txt="2"})
out({x=xpos+150,y=(ypos+232)+(datayadd*2),c=0xf0f0f0,a=0.7,f="Crystal",fs=26,txt="3"})
out({x=xpos+150,y=(ypos+232)+(datayadd*3),c=0xf0f0f0,a=0.7,f="Crystal",fs=26,txt="4"})
out({x=xpos+155,y=(ypos+232)+(datayadd*4),c=0xf0f0f0,a=0.7,f="Crystal",fs=26,txt="1"})
out({x=xpos+155,y=(ypos+232)+(datayadd*5),c=0xf0f0f0,a=0.7,f="Crystal",fs=26,txt="2"})
out({x=xpos+155,y=(ypos+232)+(datayadd*6),c=0xf0f0f0,a=0.7,f="Crystal",fs=26,txt="3"})
f="Augustus Beveled"
fs=CAIRO_FONT_SLANT_NORMAL
fw=CAIRO_FONT_WEIGHT_NORMAL
fs=20
c=0xf0f0f0
a=1
cairo_select_font_face (cr, f, CAIRO_FONT_SLANT_NORMAL, fw);
cairo_set_font_size (cr, fs)
cairo_set_source_rgba (cr,col(c,a))
for i=1,tonumber(meterentries) do
y=(ypos-24)+((i-1)*64)
cairo_move_to (cr,meterxpos[i]+5,y)
cairo_show_text (cr,meterlabel[i])
cairo_stroke (cr)
end--for
if net2==1 then
out({x=xpos+155,y=ypos-79+(datayadd*14)+18,c=0x16ec16,a=1,f="Ubuntu",fs=11,txt="Connected"})
else
out({x=xpos+148,y=ypos-79+(datayadd*14)+18,c=0xf10d0d,a=1,f="Ubuntu",fs=11,txt="Not Connected"})
end--if
-----------------------------------------------------------------
-- Information Display
-----------------------------------------------------------------
freq1=conky_parse("${freq_g cpu1}")
freq2=conky_parse("${freq_g cpu2}")
freq3=conky_parse("${freq_g cpu3}")
freq4=conky_parse("${freq_g cpu4}")
if cpu1==nil then cpu1=0 end
if cpu2==nil then cpu2=0 end
if cpu3==nil then cpu3=0 end
if cpu4==nil then cpu4=0 end
out({x=xpos+36,y=(ypos+2),c=0xb7b7b8,a=1,f="Ubuntu",fs=9,fw=CAIRO_FONT_WEIGHT_BOLD,txt="Size: "..homesize.." Free: "..homefree.." "..homeperc.."% Used"})
out({x=xpos+36,y=(ypos+2)+(datayadd*1),c=0xb7b7b8,a=1,f="Ubuntu",fs=9,fw=CAIRO_FONT_WEIGHT_BOLD,txt="Size: "..swapsize.." Free: "..swapfree.." "..swapperc.."% Used"})
out({x=xpos+36,y=(ypos+2)+(datayadd*2),c=0xb7b7b8,a=1,f="Ubuntu",fs=9,fw=CAIRO_FONT_WEIGHT_BOLD,txt="Total: "..maxram.." Free: "..freeram.." "..usedram.."% Used"})
out({x=xpos+101,y=(ypos+2)+(datayadd*3),c=0xb7b7b8,a=1,f="Ubuntu",fs=9,fw=CAIRO_FONT_WEIGHT_BOLD,txt="CPU Avg. : "..cpuavg.."%"})
out({x=xpos+77,y=(ypos+2)+(datayadd*4),c=0xb7b7b8,a=1,f="Ubuntu",fs=9,fw=CAIRO_FONT_WEIGHT_BOLD,txt="CPU 1: "..cpu1.."% @ "..freq1.." GHz"})
out({x=xpos+77,y=(ypos+2)+(datayadd*5),c=0xb7b7b8,a=1,f="Ubuntu",fs=9,fw=CAIRO_FONT_WEIGHT_BOLD,txt="CPU 2: "..cpu2.."% @ "..freq2.." GHz"})
out({x=xpos+77,y=(ypos+2)+(datayadd*6),c=0xb7b7b8,a=1,f="Ubuntu",fs=9,fw=CAIRO_FONT_WEIGHT_BOLD,txt="CPU 3: "..cpu3.."% @ "..freq3.." GHz"})
out({x=xpos+77,y=(ypos+2)+(datayadd*7),c=0xb7b7b8,a=1,f="Ubuntu",fs=9,fw=CAIRO_FONT_WEIGHT_BOLD,txt="CPU 4: "..cpu4.."% @ "..freq4.." GHz"})
out({x=xpos+79,y=(ypos+2)+(datayadd*8),c=0xb7b7b8,a=1,f="Ubuntu",fs=9,fw=CAIRO_FONT_WEIGHT_BOLD,txt="Load Avg. (1 Min.): "..load1})
out({x=xpos+79,y=(ypos+2)+(datayadd*9),c=0xb7b7b8,a=1,f="Ubuntu",fs=9,fw=CAIRO_FONT_WEIGHT_BOLD,txt="Load Avg. (5 Min.): "..load2})
out({x=xpos+79,y=(ypos+2)+(datayadd*10),c=0xb7b7b8,a=1,f="Ubuntu",fs=9,fw=CAIRO_FONT_WEIGHT_BOLD,txt="Load Avg. (15 Min.): "..load3})
out({x=xpos+38,y=(ypos+2)+(datayadd*11),c=0xb7b7b8,a=1,f="Ubuntu",fs=9,fw=CAIRO_FONT_WEIGHT_BOLD,txt="Upspeed eth0: "..upeth.."KiB/s"})
out({x=xpos+78,y=(ypos+2)+(datayadd*12),c=0xb7b7b8,a=1,f="Ubuntu",fs=9,fw=CAIRO_FONT_WEIGHT_BOLD,txt="Downspeed eth0: "..downeth.."KiB/s"})
out({x=xpos+38,y=(ypos+2)+(datayadd*13),c=0xb7b7b8,a=1,f="Ubuntu",fs=9,fw=CAIRO_FONT_WEIGHT_BOLD,txt="Upspeed wlan0: "..upwlan.."KiB/s"})
out({x=xpos+78,y=(ypos+2)+(datayadd*14),c=0xb7b7b8,a=1,f="Ubuntu",fs=9,fw=CAIRO_FONT_WEIGHT_BOLD,txt="Downspeed wlan0: "..downwlan.."KiB/s"})
-----------------------------------------------------------------
-- Text Background Lines
-----------------------------------------------------------------
x=xpos+17
xlen=220
lcap=CAIRO_LINE_CAP_BUTT
lw=15
c=0x848484
a=0.4
cairo_set_line_width (cr,lw)
cairo_set_line_cap (cr, lcap)
cairo_set_source_rgba (cr,col(c,a))
for i=1,15 do
y=(ypos-2)+((i-1)*64)
cairo_move_to (cr,x,y)
cairo_line_to (cr,x+xlen,y)
cairo_stroke (cr)
end
-----------------------------------------------------------------
-- Border @ Top of Boxes
-----------------------------------------------------------------
x=xpos+17
xlen=220
lcap=CAIRO_LINE_CAP_BUTT
lw=10
c=0x848484
a=0.4
cairo_set_line_width (cr,lw)
cairo_set_line_cap (cr, lcap)
cairo_set_source_rgba (cr,col(c,a))
for i=1,15 do
y=(ypos-50)+((i-1)*64)
cairo_move_to (cr,x,y)
cairo_line_to (cr,x+xlen,y)
cairo_stroke (cr)
end
-----------------------------------------------------------------
-- Left Semicircles
-----------------------------------------------------------------
c=0x848484
a=0.4
x=xpos+17
wid=30
rad=15
start=180
endang=360
lc=CAIRO_LINE_CAP_BUTT
cairo_set_line_width (cr,wid)
cairo_set_line_cap (cr, lc)
cairo_set_source_rgba (cr,col(c,a))
for i=1,15 do
y=(ypos-25)+((i-1)*64)
cairo_arc (cr,x,y,rad,(start-90)*(math.pi/180),(endang-90)*(math.pi/180))
cairo_stroke (cr)
end
-----------------------------------------------------------------
-- Right Semicircles
-----------------------------------------------------------------
c=0x848484
a=0.4
x=xpos+237
wid=30
rad=15
start=0
endang=180
lc=CAIRO_LINE_CAP_BUTT
cairo_set_line_width (cr,wid)
cairo_set_line_cap (cr, lc)
cairo_set_source_rgba (cr,col(c,a))
for i=1,15 do
y=(ypos-25)+((i-1)*64)
cairo_arc (cr,x,y,rad,(start-90)*(math.pi/180),(endang-90)*(math.pi/180))
cairo_stroke (cr)
end
--==============================================================================================================================
-- Date & Time
--==============================================================================================================================
xpos=867
ypos=829
-----------------------------------------------------------------
-- Border and Title
-----------------------------------------------------------------
-----------------------------------------------------------------
-- Clock Background
-----------------------------------------------------------------
ringout2({cx=xpos,cy=ypos,wid=2,rad=125,c=0xffffff,a=1,start=0,endang=360})--frame
ringout2({cx=xpos,cy=ypos,wid=2,rad=124,c=0xf0f0f0,a=1,start=0,endang=360})--frame
ringout2({cx=xpos,cy=ypos,wid=2,rad=123,c=0xdbdbdb,a=1,start=0,endang=360})--frame
ringout2({cx=xpos,cy=ypos,wid=5,rad=135,c=0x848484,a=1,start=0,endang=360})--frame
ringout2({cx=xpos,cy=ypos,wid=5,rad=129,c=0xb8b8b8,a=1,start=0,endang=360})--frame
ringout2({cx=xpos,cy=ypos,wid=2,rad=122,c=0xb8b8b8,a=1,start=0,endang=360})--frame
ringout2({cx=xpos,cy=ypos,wid=92,rad=46,c=0x173c4f,a=1,start=0,endang=360})
ringout2({cx=xpos,cy=ypos,wid=28,rad=106,c=0x122e3d,a=1,start=0,endang=360})
ringout2({cx=xpos,cy=ypos,wid=3,rad=5,c=0x126464,a=1,start=0,endang=360})
ringout2({cx=xpos,cy=ypos,wid=3,rad=2,c=0x126464,a=1,start=0,endang=360})
ringout2({cx=xpos,cy=ypos,wid=1,rad=6,c=0xc3c3c3,a=0.3,start=0,endang=360})
ringout2({cx=xpos,cy=ypos,wid=1,rad=3,c=0xc3c3c3,a=0.5,start=0,endang=360})
-----------------------------------------------------------------
-- Clock Numbers
-----------------------------------------------------------------
xpl=xpos-111
ypl=ypos-98
time_now=os.date("%H:%M:%S")
utc_hr=tonumber(os.date("%H"))
utc_now=utc_hr+4
utc_min_sec=os.date("%M:%S")
out({x=xpos-110,y=ypos+170,c=0xf0f0f0,a=1,f="Augustus Beveled",fs=28,txt="UTC Time"})
out({x=xpos+15,y=ypos+170,c=0xf0f0f0,a=1,f="Pocket Calculator",fs=28,txt=":"})
out({x=xpos+30,y=ypos+170,c=0x75b3d1,a=1,f="Pocket Calculator",fs=28,txt=utc_now..":"..utc_min_sec})
lineout({strtx=xpos-47,enx=xpos+47,strty=ypos-40,eny=ypos-40,c=0x000000,a=1,lw=24})
rectout({tlx=xpos-50,tly=ypos-55,rec_width=100,rec_height=30,c=0x122e3d,a=1,lw=1})
rectout({tlx=xpos-49,tly=ypos-54,rec_width=98,rec_height=28,c=0x0c1f29,a=1,lw=1})
rectout({tlx=xpos-48,tly=ypos-53,rec_width=96,rec_height=26,c=0x060f14,a=1,lw=1})
rectout({tlx=xpos-47,tly=ypos-52,rec_width=94,rec_height=24,c=0x03080a,a=1,lw=1})
rectout({tlx=xpos-51,tly=ypos-56,rec_width=101,rec_height=31,c=0x848484,a=1,lw=0.5})
out({x=xpos-45,y=ypos-31,c=0x478080,a=1,f="Pocket Calculator",fs=28,txt=time_now})
out({x=xpl+99,y=ypl,c=0xdcdcdc,a=1,f="Times New Roman",fs=24,txt="12"})
out({x=xpl+159,y=ypl+13,c=0xdcdcdc,a=1,f="Times New Roman",fs=24,txt="1"})
out({x=xpl+47,y=ypl+13,c=0xdcdcdc,a=1,f="Times New Roman",fs=24,txt="11"})
out({x=xpl+197,y=ypl+54,c=0xdcdcdc,a=1,f="Times New Roman",fs=24,txt="2"})
out({x=xpl+6,y=ypl+54,c=0xdcdcdc,a=1,f="Times New Roman",fs=24,txt="10"})
out({x=xpl+212,y=ypl+106,c=0xdcdcdc,a=1,f="Times New Roman",fs=24,txt="3"})
out({x=xpl,y=ypl+106,c=0xdcdcdc,a=1,f="Times New Roman",fs=24,txt="9"})
out({x=xpl+197,y=ypl+156,c=0xdcdcdc,a=1,f="Times New Roman",fs=24,txt="4"})
out({x=xpl+14,y=ypl+156,c=0xdcdcdc,a=1,f="Times New Roman",fs=24,txt="8"})
out({x=xpl+52,y=ypl+197,c=0xdcdcdc,a=1,f="Times New Roman",fs=24,txt="7"})
out({x=xpl+161,y=ypl+197,c=0xdcdcdc,a=1,f="Times New Roman",fs=24,txt="5"})
out({x=xpl+105,y=ypl+213,c=0xdcdcdc,a=1,f="Times New Roman",fs=24,txt="6"})
out({x=xpl+90,y=ypl+156,c=0xdcdcdc,a=1,f="Ubuntu Mono",fsl=CAIRO_FONT_SLANT_ITALIC,fs=16,txt="TIMUX"})
-----------------------------------------------------------------
-- Clock
-----------------------------------------------------------------
--###################################################
--CLOCK SETTINGS
clock_radius=90
clock_centerx=xpos
clock_centery=ypos
--12 or 24
clock_type=12
--how many marks around edge
number_marks=12
--set border options
clock_border_width=1
--set color and alpha for clock border
cbr,cbg,cbb,cba=220/255,220/255,220/255,1--full opaque white
--gap from clock border to hour marks
b_to_m=5
--set mark length
m_length=10
--set mark line width
m_width=2
--set mark line cap type
m_cap=CAIRO_LINE_CAP_ROUND
--set mark color and alpha,red blue green alpha
mr,mg,mb,ma=220/255,220/255,220/255,1--opaque white
-----seconds hand setup
--set length of seconds hand
sh_length=115
--set hand width
sh_width=1
--set hand line cap
sh_cap=CAIRO_LINE_CAP_ROUND
--set seconds hand color
shr,shg,shb,sha=175/255,0,0,1--fully opaque red
-----minues hand setup
--set length of minutes hand
mh_length=95
--set hand width
mh_width=4
--set hand line cap
mh_cap=CAIRO_LINE_CAP_ROUND
--set minute hand color
mhr,mhg,mhb,mha=18/255,100/255,100/255,1--fully opaque white
-----hour hand setup
--set length of hour hand
hh_length=75
--set hand width
hh_width=6
--set hand line cap
hh_cap=CAIRO_LINE_CAP_ROUND
--set hour hand color
hhr,hhg,hhb,hha=18/255,100/255,100/255,1--tan
--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
--set line cap type
cairo_set_line_cap (cr, m_cap)
--set line width
cairo_set_line_width (cr,m_width)
--set color and alpha for marks
cairo_set_source_rgba (cr,mr,mg,mb,ma)
--start for loop
for i=1,number_marks do
--drawing code uisng the value of i to calculate degrees
--calculate start point for 12 oclock mark
radius=m_start_rad
point=(math.pi/180)*((i-1)*(360/number_marks))
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 oclock mark
radius=m_end_rad
point=(math.pi/180)*((i-1)*(360/number_marks))
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##################################
if clock_type==12 then
hours=tonumber(os.date("%I"))--12 hour clock
--convert hours to seconds
h_to_s=hours*60*60
elseif clock_type==24 then
hours=tonumber(os.date("%H"))--24 hour clock
--convert hours to seconds
h_to_s=hours*60*60
end--if
minutes=tonumber(os.date("%M"))
--convert minutes to seconds
m_to_s=minutes*60
--get current seconds
seconds=tonumber(os.date("%S"))
--draw hours hand ###################################
--get hours minutes seconds as just seconds
hsecs=h_to_s+m_to_s+seconds
--calculate degrees for the hand each second
hsec_degs=hsecs*(360/(60*60*clock_type))--im using an equation instead of typing the calculation straight in because the result of 360/43200 gave us decimal places
--set radius we will use to calculate hand points
radius=hh_length
--set our starting line coordinates, the center of the circle
cairo_move_to (cr,clock_centerx,clock_centery)
--calculate coordinates for end of minutes 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)
cairo_set_source_rgba (cr,hhr,hhg,hhb,hha)
cairo_set_line_cap (cr, hh_cap)
cairo_stroke (cr)
--draw hours hand ###################################
--get hours minutes seconds as just seconds
hsecs=h_to_s+m_to_s+seconds
--calculate degrees for the hand each second
hsec_degs=hsecs*(360/(60*60*clock_type))--im using an equation instead of typing the calculation straight in because the result of 360/43200 gave us decimal places
--set radius we will use to calculate hand points
radius=hh_length
--set our starting line coordinates, the center of the circle
cairo_move_to (cr,clock_centerx,clock_centery)
--calculate coordinates for end of minutes 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,3)
cairo_set_source_rgba (cr,195/255,195/255,195/255,0.3)
cairo_set_line_cap (cr, hh_cap)
cairo_stroke (cr)
--draw minutes hand
--get minutes and seconds just as seconds
msecs=m_to_s+seconds
--calculate degrees for the hand each second
msec_degs=msecs*0.1
--set radius we will use to calculate hand points
radius=mh_length
--set our starting line coordinates, the center of the circle
cairo_move_to (cr,clock_centerx,clock_centery)
--calculate coordinates for end of minutes 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)
cairo_set_source_rgba (cr,mhr,mhg,mhb,mha)
cairo_set_line_cap (cr, mh_cap)
cairo_stroke (cr)
--draw minutes hand
--get minutes and seconds just as seconds
msecs=m_to_s+seconds
--calculate degrees for the hand each second
msec_degs=msecs*0.1
--set radius we will use to calculate hand points
radius=mh_length
--set our starting line coordinates, the center of the circle
cairo_move_to (cr,clock_centerx,clock_centery)
--calculate coordinates for end of minutes 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,2)
cairo_set_source_rgba (cr,195/255,195/255,195/255,0.3)
cairo_set_line_cap (cr, mh_cap)
cairo_stroke (cr)
--draw seconds hand #################################
--calculate degrees for the hand each second
sec_degs=seconds*6
--set radius we will use to calculate hand points
radius=sh_length
--set our starting 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)
cairo_set_source_rgba (cr,shr,shg,shb,sha)
cairo_set_line_cap (cr, sh_cap)
cairo_stroke (cr)
--======================================================================================================================================================
--##################################################------------END DISPLAY AREA-----------#############################################################
--======================================================================================================================================================
end-- if updates>5
cairo_destroy(cr)
cairo_surface_destroy(cs)
cr=nil
end-- end main function
my_info.lua:
Code:
--[[ This script was written by stylintile with a lot of help from mrpeachy on
http://crunchbang.org/forums/viewtopic.php?id=17246 ]]
require 'cairo'
require 'imlib2'
-----------------------------------------------------------------
-- Terminal Command
-----------------------------------------------------------------
function os.capture(cmd, raw)
local f = assert(io.popen(cmd, 'r'))
local s = assert(f:read('*a'))
f:close()
if raw then return s end
s = string.gsub(s, '^%s+', '')
s = string.gsub(s, '%s+$', '')
s = string.gsub(s, '[\n\r]+', ' ')
return s
end
-----------------------------------------------------------------
-- Color conversion
-----------------------------------------------------------------
local function col(c,a)
return ( (c/0x10000) % 0x100)/255,( (c/0x100) % 0x100)/255,(c % 0x100)/255,a
end--local function
function image(im)--#################################################################
x=nil
x=(im.x or 0)
y=nil
y=(im.y or 0)
w=nil
w=(im.w or 0)
h=nil
h=(im.h or 0)
file=nil
file=tostring(im.file)
if file==nil then print("set image file") end
---------------------------------------------
local show = imlib_load_image(file)
if show == nil then return end
imlib_context_set_image(show)
if tonumber(w)==0 then
width=imlib_image_get_width()
else
width=tonumber(w)
end
if tonumber(h)==0 then
height=imlib_image_get_height()
else
height=tonumber(h)
end
imlib_context_set_image(show)
local scaled=imlib_create_cropped_scaled_image(0, 0, imlib_image_get_width(), imlib_image_get_height(), width, height)
imlib_free_image()
imlib_context_set_image(scaled)
imlib_render_image_on_drawable(x, y)
imlib_free_image()
show=nil
end--function image ##################################################################
-----------------------------------------------------------------
-- Rectangles
-----------------------------------------------------------------
function rectout(rct)
c=nil
c=(rct.c or 0xffffff)
a=nil
a=(rct.a or 1)
lw=nil
lw=(rct.lw or 3)
tlx=nil
tlx=(rct.tlx or 100)
tly=nil
tly=(rct.tly or 100)
rec_width=nil
rec_width=(rct.rec_width or 50)
rec_height=nil
rec_height=(rct.rec_height or 50)
---------------------------------------
cairo_set_line_width (cr,lw)
cairo_rectangle (cr,tlx,tly,rec_width,rec_height)
cairo_set_source_rgba (cr,col(c,a))
cairo_stroke (cr)
end--function rectout ###
-----------------------------------------------------------------
-- Lines (Borders) Display
-----------------------------------------------------------------
function lineout(ln)--Lines--###
c=nil
c=(ln.c or 0xffffff)
a=nil
a=(ln.a or 1)
lw=nil
lw=(ln.lw or 3)
lc=nil
lc=(ln.lc or CAIRO_LINE_CAP_BUTT)
strtx=nil
strtx=(ln.strtx or 0)
strty=nil
strty=(ln.strty or 0)
enx=nil
enx=(ln.enx or 50)
eny=nil
eny=(ln.eny or 50)
---------------------------------------
cairo_set_line_width (cr,lw)
cairo_set_line_cap (cr, lc)
cairo_set_source_rgba (cr,col(c,a))
cairo_move_to (cr,strtx,strty)
cairo_line_to (cr,enx,eny)
cairo_stroke (cr)
end--function lineout ###
function out(tx)--Text--####################################################################
c=nil
c=(tx.c or 0xffffff)
a=nil
a=(tx.a or 1)
f=nil
f=(tx.f or "mono")
fs=nil
fs=(tx.fs or 12)
x=nil
x=(tx.x or 0)
y=nil
y=(tx.y or 0)
txt=nil
txt=(tx.txt or "set txt")
fw=nil
fw=(tx.fw or CAIRO_FONT_WEIGHT_NORMAL)
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, fw);
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--Text-- ###################################################################
-----------------------------------------------------------------
-- Rings
-----------------------------------------------------------------
function ringout2(rn2)--Meter Rings--###
c=nil
c=(rn2.c or 0xffffff)
a=nil
a=(rn2.a or 1)
lc=nil
lc=(rn2.lc or CAIRO_LINE_CAP_BUTT)
wid=nil
wid=(rn2.wid or 3)
cx=nil
cx=(rn2.cx or 100)
cy=nil
cy=(rn2.cy or 100)
rad=nil
rad=(rn2.rad or 10)
start=nil
start=(rn2.start or 0)
endang=nil
endang=(rn2.endang or 360)
---------------------------------------
cairo_set_line_width (cr,wid)
cairo_set_line_cap (cr, lc)
cairo_set_source_rgba (cr,col(c,a))
cairo_arc (cr,cx,cy,rad,(start-90)*(math.pi/180),(endang-90)*(math.pi/180))
cairo_stroke (cr)
end--function ringout2 ###
-----------------------------------------------------------------
-- Split String
-----------------------------------------------------------------
function string:split(delimiter)
local result = { }
local from = 1
local delim_from, delim_to = string.find( self, delimiter, from )
while delim_from do
table.insert( result, string.sub( self, from , delim_from-1 ) )
from = delim_to + 1
delim_from, delim_to = string.find( self, delimiter, from )
end
table.insert( result, string.sub( self, from ) )
return result
end--of function
function conky_main()
if conky_window == nil then return end
local cs = cairo_xlib_surface_create(conky_window.display, conky_window.drawable, conky_window.visual, conky_window.width, conky_window.height)
cr = cairo_create(cs)
local updates=tonumber(conky_parse('${updates}'))
--if updates>5 then
--======================================================================================================================================================
-- ---DISPLAY AREA---
--======================================================================================================================================================
--image({x=0,y=1027,w=1920,h=30,file="/home/dale/Pictures/blue_panel.png"})
--==============================================================================================================================
-- System Information
--==============================================================================================================================
datayadd=12 -- y=datay+(dataadd*1) use 1 or more
datax=622
dataxadd1=228
dataxadd2=497
dataxadd3=191
datay=80 -- y=datay or
datayadd2=148
dataxadd4=395
dataxadd5=535
-----------------------------------------------------------------
-- Borders
-----------------------------------------------------------------
rectout({tlx=datax-10,tly=datay-39,rec_width=684,rec_height=132,c=0x848484,a=1,lw=3})
rectout({tlx=datax-10,tly=datay+120,rec_width=684,rec_height=85,c=0x848484,a=1,lw=3})
lineout({strtx=datax+220,enx=datax+220,strty=datay-39,eny=datay+94,c=0x848484,a=1,lw=3})
lineout({strtx=datax+487,enx=datax+487,strty=datay-39,eny=datay+94,c=0x848484,a=1,lw=3})
lineout({strtx=datax+182,enx=datax+182,strty=datay+120,eny=datay+206,c=0x848484,a=1,lw=3})
lineout({strtx=datax+385,enx=datax+385,strty=datay+120,eny=datay+206,c=0x848484,a=1,lw=3})
lineout({strtx=datax+525,enx=datax+525,strty=datay+120,eny=datay+206,c=0x848484,a=1,lw=3})
-----------------------------------------------------------------
-- Variables
-----------------------------------------------------------------
freq=conky_parse("${freq_g}")
volume="Unk"--conky_parse("${mixer}")
OpSys1=os.capture("cat /etc/issue.net")
OpSys2=os.capture("cat /boot/config-3.5.0-27-generic | grep CONFIG_VERSION_SIGNATURE | cut -c 46-52")
if OpSys2=="precise" then OpSys2="Precise Pangolin" end
kernel_name=os.capture("cat /usr/src/linux-headers-3.5.0-27-generic/Makefile | grep NAME | cut -c 8-")
kernel=conky_parse("${kernel}")
conkyversion=conky_parse("${conky_version}")
denv1=os.capture("env | grep 'GDMSESSION' | cut -c12-")
denv2=os.capture("gnome-session --version | cut -c14-")
wmgr1=os.capture("wmctrl -m | grep 'Name' | cut -c7-")
wmgr2=os.capture("compiz --version | cut -c7-")
GWIP=conky_parse("${gw_ip}")--os.capture("curl -s ifconfig.me")
net_type=conky_parse("${wireless_mode wlan0}")
net_name=conky_parse("${wireless_essid wlan0}")
gateway=conky_parse("${gw_iface}")
sigqual=conky_parse("${wireless_link_qual wlan0}")
sigmax=conky_parse("${wireless_link_qual_max wlan0}")
sigperc=tonumber(conky_parse("${wireless_link_qual_perc wlan0}"))
if sigperc==nil then sigperc=0 end
cputemp1=os.capture("sensors | awk '/Core 0/{print $3}' | cut -c2-8")
cputemp2=os.capture("sensors | awk '/Core 1/{print $3}' | cut -c2-8")
cputemp3=os.capture("sensors | awk '/Core 2/{print $3}' | cut -c2-8")
cputemp4=os.capture("sensors | awk '/Core 3/{print $3}' | cut -c2-8")
cputempall=os.capture("sensors | awk '/Physical id 0/{print $4}' | cut -c2-7").."C"
fanspeed=os.capture("sensors | awk '/fan1/{print $2}'").." "..os.capture("sensors | awk '/fan1/{print $3}'")
arch=conky_parse("${machine}")
uptime=conky_parse("${uptime_short}")
GPU=conky_parse("${hwmon 0 temp 1}").."°C"--hwmon 0 temp 1("sensors | grep 'temp1' | cut -c 15-21")
MoBotemp=conky_parse("${hwmon 0 temp 2}").."°C"--os.capture("sensors | grep 'temp2' | cut -c 15-21")--${hwmon 0 temp 2}°F
systemp=conky_parse("${hwmon 0 temp 3}").."°C"--os.capture("sensors | grep 'temp3' | cut -c 15-21")
hdd1=os.capture("sudo hddtemp /dev/sda | cut -c 34-38")
hdd2=os.capture("sudo hddtemp /dev/sdb | cut -c 34-38")
--Physical id 0 is CPU overall temp
--temp1 is GPU
--temp2 is MoBo
--temp3 is system temp
totproc=conky_parse("${processes}")
runproc=conky_parse("${running_processes}")
topname1=conky_parse("${top name 1}")
topname2=conky_parse("${top name 2}")
topname3=conky_parse("${top name 3}")
topname4=conky_parse("${top name 4}")
topname5=conky_parse("${top name 5}")
topcpu1=conky_parse("${top cpu 1}")
topcpu2=conky_parse("${top cpu 2}")
topcpu3=conky_parse("${top cpu 3}")
topcpu4=conky_parse("${top cpu 4}")
topcpu5=conky_parse("${top cpu 5}")
topmemname1=conky_parse("${top_mem name 1}")
topmemname2=conky_parse("${top_mem name 2}")
topmemname3=conky_parse("${top_mem name 3}")
topmemname4=conky_parse("${top_mem name 4}")
topmemname5=conky_parse("${top_mem name 5}")
topmem1=conky_parse("${top_mem mem 1}")
topmem2=conky_parse("${top_mem mem 2}")
topmem3=conky_parse("${top_mem mem 3}")
topmem4=conky_parse("${top_mem mem 4}")
topmem5=conky_parse("${top_mem mem 5}")
-----------------------------------------------------------------
-- Title, Headers and Labels
-----------------------------------------------------------------
out({x=datax,y=datay-43,c=0xf0f0f0,a=1,f="Augustus Beveled",fs=26,txt="System Information"})
out({x=datax+238,y=datay-45,c=0xb7b7b8,a=1,f="Illustrate IT",fs=30,fw=CAIRO_FONT_WEIGHT_NORMAL,txt="F"})
out({x=datax+278,y=datay-45,c=0xb7b7b8,a=1,f="Sans",fs=10,fw=CAIRO_FONT_WEIGHT_BOLD,txt="Home build with Intel(R) Core(TM) i5-2400 CPU running @"})
out({x=datax+615,y=datay-45,c=0xb7b7b8,a=1,f="Sans",fs=10,fw=CAIRO_FONT_WEIGHT_BOLD,txt=freq.." GHz"})
out({x=datax,y=datay+116,c=0xf0f0f0,a=1,f="Augustus Beveled",fs=24,txt="Temps and Performance"})
out({x=datax+53,y=datay-10,c=0xffd700,a=1,f="Sans",fs=20,fw=CAIRO_FONT_WEIGHT_BOLD,txt="Hardware"})
out({x=datax+316,y=datay-10,c=0xffd700,a=1,f="Sans",fs=20,fw=CAIRO_FONT_WEIGHT_BOLD,txt="System"})
out({x=datax+536,y=datay-10,c=0xffd700,a=1,f="Sans",fs=20,fw=CAIRO_FONT_WEIGHT_BOLD,txt="Network"})
out({x=datax+76,y=datay+(datayadd2)-12,c=0xffd700,a=1,f="Sans",fs=10,fw=CAIRO_FONT_WEIGHT_BOLD,txt="CPU"})
out({x=datax+271,y=datay+(datayadd2)-12,c=0xffd700,a=1,f="Sans",fs=10,fw=CAIRO_FONT_WEIGHT_BOLD,txt="MoBo"})
out({x=datax+430,y=datay+(datayadd2)-12,c=0xffd700,a=1,f="Sans",fs=10,fw=CAIRO_FONT_WEIGHT_BOLD,txt="Top CPU"})
out({x=datax+574,y=datay+(datayadd2)-12,c=0xffd700,a=1,f="Sans",fs=10,fw=CAIRO_FONT_WEIGHT_BOLD,txt="Top RAM"})
-----------------------------------------------------------------
-- Text Display
-----------------------------------------------------------------
info_label={"MoBo:","Installed Memory:","HDD Size:","Architecture:","GPU:","Audio Controller:","Architecture:",
"Uptime:","OS:","Kernel Name:","Kernel Version:","Conky Version:","Desktop Environment:","Window Manager:",
"Gateway IP:","Network Type:","Network Name:","Gateway Interface:","Wireless Quality:","Wireless Max:","Signal Strength:",
"Core1 Temperature:","Core2 Temperature:","Core3 Temperature:","Core4 Temperature:","CPU Temperature:",
"GPU Temp:","Motherboard Temp:","System Temp:","Hard Disk 1/2 Temp:","Fan speed:",
topname1,topname2,topname3,topname4,topname5,
topmemname1,topmemname2,topmemname3,topmemname4,topmemname5}
infox={datax,datax,datax,datax,datax,datax,datax,
datax+(dataxadd1),datax+(dataxadd1),datax+(dataxadd1),datax+(dataxadd1),datax+(dataxadd1),datax+(dataxadd1),datax+(dataxadd1),
datax+(dataxadd2),datax+(dataxadd2),datax+(dataxadd2),datax+(dataxadd2),datax+(dataxadd2),datax+(dataxadd2),datax+(dataxadd2),
datax,datax,datax,datax,datax,
datax+(dataxadd3),datax+(dataxadd3),datax+(dataxadd3),datax+(dataxadd3),datax+(dataxadd3),
datax+(dataxadd4),datax+(dataxadd4),datax+(dataxadd4),datax+(dataxadd4),datax+(dataxadd4),
datax+(dataxadd5),datax+(dataxadd5),datax+(dataxadd5),datax+(dataxadd5),datax+(dataxadd5)}
infoy={datay+datayadd,datay+(datayadd*2),datay+(datayadd*3),datay+(datayadd*4),datay+(datayadd*5),datay+(datayadd*6),datay+(datayadd*7),
datay+datayadd,datay+(datayadd*2),datay+(datayadd*3),datay+(datayadd*4),datay+(datayadd*5),datay+(datayadd*6),datay+(datayadd*7),
datay+datayadd,datay+(datayadd*2),datay+(datayadd*3),datay+(datayadd*4),datay+(datayadd*5),datay+(datayadd*6),datay+(datayadd*7),
datay+(datayadd2),datay+datayadd2+datayadd,datay+datayadd2+(datayadd*2),datay+datayadd2+(datayadd*3),datay+datayadd2+(datayadd*4),
datay+(datayadd2),datay+datayadd2+datayadd,datay+datayadd2+(datayadd*2),datay+datayadd2+(datayadd*3),datay+datayadd2+(datayadd*4),
datay+(datayadd2),datay+datayadd2+datayadd,datay+datayadd2+(datayadd*2),datay+datayadd2+(datayadd*3),datay+datayadd2+(datayadd*4),
datay+(datayadd2),datay+datayadd2+datayadd,datay+datayadd2+(datayadd*2),datay+datayadd2+(datayadd*3),datay+datayadd2+(datayadd*4)}
infoentries=#info_label
f="Sans"
fs=CAIRO_FONT_SLANT_NORMAL
fw=CAIRO_FONT_WEIGHT_BOLD
fs=10
c=0x75b3d1
a=1
cairo_select_font_face (cr, f, CAIRO_FONT_SLANT_NORMAL, fw);
cairo_set_font_size (cr, fs)
cairo_set_source_rgba (cr,col(c,a))
for i=1,tonumber(infoentries) do
y=(datay+12)+((i-1)*12)
cairo_move_to (cr,infox[i],infoy[i])
cairo_show_text (cr,info_label[i])
cairo_stroke (cr)
end--for
ramtotal1=os.capture("sed -n '49p' /home/dale/myconfig.txt | cut -c17")
ramtotal2=os.capture("sed -n '49p' /home/dale/myconfig.txt | cut -c18-20")
mobo1=os.capture("sed -n '13p' /home/dale/myconfig.txt | cut -c16-18")
mobo2=os.capture("sed -n '12p' /home/dale/myconfig.txt | cut -c17-36")
hdsize1=os.capture("sed -n '317p' /home/dale/myconfig.txt | cut -c28-30")
hdsize2=os.capture("sed -n '317p' /home/dale/myconfig.txt | cut -c31-32")
arch=os.capture("sed -n '98p' /home/dale/myconfig.txt | cut -c25-30")
info_table={mobo1.." "..mobo2,ramtotal1.." "..ramtotal2,hdsize1.." "..hdsize2,arch,"Integrated Sandy Bridge","Cougar Point",arch,--1st column top
uptime,OpSys1.." "..OpSys2,kernel_name,kernel,conkyversion,denv1.." "..denv2,wmgr1.." "..wmgr2,--2nd column top
GWIP,net_type,net_name,"eth0",sigqual,sigmax,sigperc.."%",--3rd column top
cputemp1,cputemp2,cputemp3,cputemp4,cputempall,--1st column bottom
GPU,MoBotemp,systemp,hdd1.." / "..hdd2,fanspeed,--2nd column bottom
topcpu1,topcpu2,topcpu3,topcpu4,topcpu5,--3rd column bottom
topmem1,topmem2,topmem3,topmem4,topmem5}--4th column bottom
if sigperc==100 then sig_x=140 else sig_x=145 end
info_tablex={datax+72,datax+185,datax+176,datax+175,datax+91,datax+145,datax+175,--1st column top
datax+(dataxadd1)+209,datax+(dataxadd1)+71,datax+(dataxadd1)+140,datax+(dataxadd1)+170,datax+(dataxadd1)+227,datax+(dataxadd1)+155,datax+(dataxadd1)+173,--2nd column top
datax+(dataxadd2)+99,datax+(dataxadd2)+121,datax+(dataxadd2)+117,datax+(dataxadd2)+144,datax+(dataxadd2)+154,datax+(dataxadd2)+154,datax+(dataxadd2)+sig_x,--3rd column top
datax+138,datax+138,datax+138,datax+138,datax+138,--1st column bottom
datax+(dataxadd3)+158,datax+(dataxadd3)+158,datax+(dataxadd3)+158,datax+(dataxadd3)+125,datax+(dataxadd3)+132,--2nd column bottom
datax+(dataxadd4)+90,datax+(dataxadd4)+90,datax+(dataxadd4)+90,datax+(dataxadd4)+90,datax+(dataxadd4)+90,--3rd column bottom
datax+(dataxadd5)+100,datax+(dataxadd5)+100,datax+(dataxadd5)+100,datax+(dataxadd5)+100,datax+(dataxadd5)+100}--4th column bottom
info_tabley={datay+(datayadd*1),datay+(datayadd*2),datay+(datayadd*3),datay+(datayadd*4),datay+(datayadd*5),datay+(datayadd*6),datay+(datayadd*7),--1st column top
datay+(datayadd*1),datay+(datayadd*2),datay+(datayadd*3),datay+(datayadd*4),datay+(datayadd*5),datay+(datayadd*6),datay+(datayadd*7),--2nd column top
datay+(datayadd),datay+(datayadd*2),datay+(datayadd*3),datay+(datayadd*4),datay+(datayadd*5),datay+(datayadd*6),datay+(datayadd*7),--3rd column top
datay+(datayadd2),datay+(datayadd2)+(datayadd),datay+(datayadd2)+(datayadd*2),datay+(datayadd2)+(datayadd*3),datay+(datayadd2)+(datayadd*4),--1st column bottom
datay+(datayadd2),datay+(datayadd)+(datayadd2),datay+(datayadd*2)+(datayadd2),datay+(datayadd*3)+(datayadd2),datay+(datayadd*4)+(datayadd2),--2nd column bottom
datay+(datayadd2),datay+(datayadd)+(datayadd2),datay+(datayadd*2)+(datayadd2),datay+(datayadd*3)+(datayadd2),datay+(datayadd*4)+(datayadd2),--3rd column bottom
datay+(datayadd2),datay+(datayadd)+(datayadd2),datay+(datayadd*2)+(datayadd2),datay+(datayadd*3)+(datayadd2),datay+(datayadd*4)+(datayadd2)}--4th column bottom
infoentriesb=#info_table
f="Sans"
fs=CAIRO_FONT_SLANT_NORMAL
fw=CAIRO_FONT_WEIGHT_BOLD
fs=9
c=0xb7b7b8
a=1
cairo_select_font_face (cr, f, CAIRO_FONT_SLANT_NORMAL, fw);
cairo_set_font_size (cr, fs)
cairo_set_source_rgba (cr,col(c,a))
for i=1,tonumber(infoentriesb) do
cairo_move_to (cr,info_tablex[i],info_tabley[i])
cairo_show_text (cr,info_table[i])
cairo_stroke (cr)
end--for
--==============================================================================================================================
-- Ubuntu Plaque
--==============================================================================================================================
xpos=823
ypos=466
-----------------------------------------------------------------
-- Background
-----------------------------------------------------------------
lineout({strtx=xpos-41,enx=xpos+310,strty=ypos+59,eny=ypos+59,c=0x0f2633,a=1,lw=295})
-----------------------------------------------------------------
-- Frame
-----------------------------------------------------------------
rectout({tlx=xpos-44,tly=ypos-93,rec_width=554-200,rec_height=152+150,c=0xffffff,a=1,lw=2})
rectout({tlx=xpos-43,tly=ypos-92,rec_width=552-200,rec_height=150+150,c=0xf0f0f0,a=1,lw=2})
rectout({tlx=xpos-42,tly=ypos-91,rec_width=550-200,rec_height=148+150,c=0xdbdbdb,a=1,lw=2})
rectout({tlx=xpos-55,tly=ypos-104,rec_width=575-200,rec_height=173+150,c=0x848484,a=1,lw=5})
rectout({tlx=xpos-49,tly=ypos-98,rec_width=564-200,rec_height=161+150,c=0xb8b8b8,a=1,lw=5})
rectout({tlx=xpos-41,tly=ypos-90,rec_width=548-200,rec_height=146+150,c=0xb8b8b8,a=1,lw=2})
-----------------------------------------------------------------
-- Text and Accent Lines
-----------------------------------------------------------------
out({x=xpos+25,y=ypos-33,c=0xb8b8b8,a=1,f="Crystal",fs=48,txt="Ubuntu"})
out({x=xpos-20,y=ypos+27,c=0xb8b8b8,a=1,f="Crystal",fs=48,txt="12.04.1 LTS"})
out({x=xpos+37,y=ypos+107,c=0xb8b8b8,a=1,f="Crystal",fs=48,txt="Precise"})
out({x=xpos+9,y=ypos+167,c=0xb8b8b8,a=1,f="Crystal",fs=48,txt="Pangolin"})
--==============================================================================================================================
-- Date & Time
--==============================================================================================================================
xpos=0
ypos=504
-----------------------------------------------------------------fsl=CAIRO_FONT_SLANT_OBLIQUE,
-- Current Month Name
-----------------------------------------------------------------
month=conky_parse("${time %B}")
c=0xb7b7b8
a=1
-------------------------------
font="Augustus Beveled";font_size=44;text=month;x=xpos+880;y=ypos+260;red,green,blue,alpha=184/255,184/255,185/255,1
font_slant=CAIRO_FONT_SLANT_NORMAL
font_face=CAIRO_FONT_WEIGHT_NORMAL
----------------------------------
cairo_select_font_face (cr, font, font_slant, font_face);
cairo_set_font_size (cr, font_size)
cairo_set_source_rgba (cr,col(c,a))
cairo_move_to (cr,x,y)
cairo_show_text (cr,text)
cairo_stroke (cr)
-----------------------------------------------------------------
-- Current Month Calendar
-----------------------------------------------------------------
--title text color
tred,tgreen,tblue,talpha=184/255,184/255,185/255,1
--title text font
tfont="LCDMono"
--title text size
tfontsize=24
--###################################################
--main body text color
bred,bgreen,bblue,balpha=117/255,179/255,209/255,1
--main body text font
mfont="LCDMono"
--main body text size
mfontsize=24
--###################################################
--highlight text color
hred,hgreen,hblue,halpha=255/255,215/255,0/255,1
--highlight font
hfont="LCDMono"
--highlight size
hfontsize=24
--###################################################
--surrounding numbers 1=om, 0=off
surround=0
--surrounding dates text color
sred,sgreen,sblue,salpha=0.3,0.5,0.3,1
--surrounding font
sfont="LCDMono"
--surounding size
sfontsize=24
--###################################################
--indicator box enter 1 for box or 0 for no box
box=0
--use the following 2 numbers to adjust box position
xadjust=2.5
yadjust=4
--set the box dimensions
width=35
height=21
--box color
xred,xgreen,xblue,xalpha=1,0.2,0.8,1
--###################################################
--calendar this month ###############################
--###################################################
--position
across=xpos+823
down=ypos+300
--rotate - this will require repositioning above
rotate=0
--###################################################
--horizontal gap between dates
gaph=40
--###################################################
--gap between day titles and first line
gapt=35
--###################################################
--gap between calendar line
gapl=35
--###################################################
--spacer -- this can help with alignment enter 0, 1 space or 2 spaces between the ""
spacer=" "
--###################################################
--calendar calcs
year=os.date("%G")
today=tonumber(os.date("%d"))
t1 = os.time( { year=year,month=03,day=01,hour=00,min=0,sec=0} );
t2 = os.time( { year=year,month=02,day=01,hour=00,min=0,sec=0} );
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
local day_num = today
local remainder=day_num % 7
start_day=day-(day_num % 7)
if start_day<0 then start_day=7+start_day end
month=os.date("%m")
mdays=monthdays[tonumber(month)]
mdaystm=mdays
x=mdays+start_day
dnum={}
dnumh={}
if mdays+start_day<36 then
dlen=35
plen=29
else
dlen=42
plen=36
end--if
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
if dn==(spacer .. today) or dn==today then
dnumh[i]=dn
place=i
else dnumh[i]=" "
end--if
end--if
end--for
--###################################################
cairo_rotate (cr,(math.pi/180)*(rotate))
--print calendar titles
--###################################################
cairo_select_font_face (cr, tfont, CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_BOLD);
cairo_set_font_size (cr, tfontsize);
cairo_set_source_rgba (cr,tred,tgreen,tblue,talpha)
dys={"SU","MO","TU","WE","TH","FR","SA"}
--------------------------------
--use these settings to mess around with positioning
turn=-2
ta=0
move=0
rot=0
--------------------------------
for i=1,7 do
cairo_move_to (cr, across+8+(gaph*(i-1)), down+(i*move))
cairo_rotate (cr,(math.pi/180)*(rot))
cairo_show_text (cr, dys[i])
cairo_stroke (cr)
cairo_rotate (cr,(math.pi/180)*(rot*-1))
end--for
cairo_select_font_face (cr, mfont, CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_BOLD);
cairo_set_font_size (cr, mfontsize);
cairo_set_source_rgba (cr,bred,bgreen,bblue,balpha)
for i=1,plen,7 do
fn=i
for i=fn,fn+6 do
cairo_move_to (cr, across+(gaph*(i-fn))-((((fn-1)/7)+ta)*turn), (i*move)+down+gapt+(gapl*((fn-1)/7)))
cairo_rotate (cr,(math.pi/180)*(rot))
cairo_show_text (cr, dnum[i])
cairo_stroke (cr)
cairo_rotate (cr,(math.pi/180)*(rot*-1))
end--for
end--for
cairo_select_font_face (cr, hfont, CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_BOLD);
cairo_set_font_size (cr, hfontsize);
cairo_set_source_rgba (cr,hred,hgreen,hblue,halpha)
for i=1,plen,7 do
fn=i
for i=fn,fn+6 do
cairo_move_to (cr, across+(gaph*(i-fn))-((((fn-1)/7)+ta)*turn), (i*move)+down+gapt+(gapl*((fn-1)/7)))
cairo_rotate (cr,(math.pi/180)*(rot))
cairo_show_text (cr, dnumh[i])
cairo_stroke (cr)
cairo_rotate (cr,(math.pi/180)*(rot*-1))
end--for
end--for
--###################################################
if surround==1 then
thisstart=tonumber(start_day)+1
thisend=tonumber(start_day)+mdays
previous=tonumber(start_day)
nextmon=dlen-thisend
pmon=tonumber(month)-1
if pmon==0 then pmon=12 end
pmon=monthdays[pmon]
snum={}
for i=1,dlen do
snum[i]=""
end
for i=tonumber(thisend)+1,tonumber(thisend)+nextmon do
snum[i]=i-tonumber(thisend)
end
for i=1,previous do
snum[i]=pmon-(previous-(i))
end
cairo_select_font_face (cr, sfont, CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_BOLD);
cairo_set_font_size (cr, sfontsize);
cairo_set_source_rgba (cr,sred,sgreen,sblue,salpha)
for i=1,plen,7 do
fn=i
for i=fn,fn+6 do
cairo_move_to (cr, across+(gaph*(i-fn))-((((fn-1)/7)+ta)*turn), (i*move)+down+gapt+(gapl*((fn-1)/7)))
cairo_rotate (cr,(math.pi/180)*(rot))
cairo_show_text (cr, snum[i])
cairo_stroke (cr)
cairo_rotate (cr,(math.pi/180)*(rot*-1))
end--for
end--for
end--if
--box aound
if box==1 then
cairo_set_source_rgba (cr,xred,xgreen,xblue,xalpha)
cairo_set_line_width (cr,1)
if place>0 and place<8 then
cy=down+gapt
elseif
place>7 and place<15 then
cy=down+gapt+gapl
elseif
place>13 and place<23 then
cy=down+gapt+gapl+gapl
elseif
place>21 and place<29 then
cy=down+gapt+gapl+gapl+gapl
elseif
place>28 and place<36 then
cy=down+gapt+gapl+gapl+gapl+gapl
end--if place
placey=place %7
if placey==1 then
cx=across
elseif
placey==2 then
cx=across+(gaph*1)
elseif
placey==3 then
cx=across+(gaph*2)
elseif
placey==4 then
cx=across+(gaph*3)
elseif
placey==5 then
cx=across+(gaph*4)
elseif
placey==6 then
cx=across+(gaph*5)
elseif
placey==0 then
cx=across+(gaph*6)
end--if placey
cairo_rectangle (cr,cx-xadjust,cy+yadjust,width,-height)
cairo_stroke (cr)
end--if box
cairo_rotate (cr,(math.pi/180)*(rotate*-1))
--###################################################
--end of this month calendar
--###################################################
--[[---------------------------------------------------------------
-- Next Month Calendar
-----------------------------------------------------------------
--title text color
tred,tgreen,tblue,talpha=184/255,184/255,185/255,1
--title text font
tfont="LCDMono"
--title text size
tfontsize=24
--###################################################
--main body text color
bred,bgreen,bblue,balpha=117/255,179/255,209/255,1
--main body text font
mfont="LCDMono"
--main body text size
mfontsize=24
--###################################################
--highlight text color
hred,hgreen,hblue,halpha=117/255,179/255,209/255,1
--highlight font
hfont="LCDMono"
--highlight size
hfontsize=24
--###################################################
--surrounding numbers 1=om, 0=off
surround=0
--surrounding dates text color
sred,sgreen,sblue,salpha=0.3,0.5,0.3,1
--surrounding font
sfont="LCDMono"
--surounding size
sfontsize=24
--###################################################
--indicator box enter 1 for box or 0 for no box
box=0
--use the following 2 numbers to adjust box position
xadjust=2.5
yadjust=4
--set the box dimensions
width=35
height=21
--box color
xred,xgreen,xblue,xalpha=1,0.2,0.8,1
--###################################################
--calendar next month ###############################
--###################################################
--position
across=xpos+493
down=ypos-59.5
--rotate - this will require repositioning above
rotate=0
--###################################################
--horizontal gap between dates
gaph=40
--###################################################
--gap between day titles and first line
gapvar=tonumber(os.date("%m"))
if gapvar==8 then gapt=0 else gapt=35 end
--###################################################
--gap between calendar line
gapl=35
--###################################################
--spacer -- this can help with alignment enter 0, 1 space or 2 spaces between the ""
spacer=" "
--###################################################
--calendar calcs
year=os.date("%G")
today=tonumber(os.date("%d"))
t1 = os.time( { year=year,month=03,day=01,hour=00,min=0,sec=0} );
t2 = os.time( { year=year,month=02,day=01,hour=00,min=0,sec=0} );
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
local day_num = today
local remainder=day_num % 7
month=gapvar
if month==12 then dispmonth=1 else dispmonth=month+1 end
-- out({x=336,y=590,c=0x75b3d1,a=1,f="Ubuntu",fs=32,fw=CAIRO_FONT_WEIGHT_BOLD,txt=month})
-- out({x=396,y=590,c=0x75b3d1,a=1,f="Ubuntu",fs=32,fw=CAIRO_FONT_WEIGHT_BOLD,txt=dispmonth})
if
dispmonth==1
then
start_day=2
elseif
dispmonth==2
then
start_day=5
elseif
dispmonth==3
then
start_day=5
elseif
dispmonth==4
then
start_day=1
elseif
dispmonth==5
then
start_day=3
elseif
dispmonth==6
then
start_day=6
elseif
dispmonth==7
then
start_day=1
elseif
dispmonth==8
then
start_day=4
elseif
dispmonth==9
then
start_day=7
elseif
dispmonth==10
then
start_day=2
elseif
dispmonth==11
then
start_day=4
elseif
dispmonth==12
then
start_day=6
else
start_day=7
end--if
--start_day=day-(day_num % 7)--Monday=1;Tuesday=2;Wednesday=3;Thursday=4;Friday=5;Saturday=6;Sunday=7
if start_day<0 then start_day=7+start_day end
mdays=monthdays[tonumber(month)]
mdaystm=mdays
x=mdays+start_day
dnum={}
dnumh={}
if mdays+start_day<36 then
dlen=35
plen=29
else
dlen=42
plen=36
end--if
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
if dn==(spacer .. today) or dn==today then
dnumh[i]=dn
place=i
else dnumh[i]=" "
end--if
end--if
end--for
--###################################################
cairo_rotate (cr,(math.pi/180)*(rotate))
--print calendar titles
--###################################################
cairo_select_font_face (cr, tfont, CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_BOLD);
cairo_set_font_size (cr, tfontsize);
cairo_set_source_rgba (cr,tred,tgreen,tblue,talpha)
dys={"SU","MO","TU","WE","TH","FR","SA"}
--------------------------------
--use these settings to mess around with positioning
turn=-2
ta=0
move=0
rot=0
--------------------------------
for i=1,7 do
cairo_move_to (cr, across+8+(gaph*(i-1)), down+(i*move))
cairo_rotate (cr,(math.pi/180)*(rot))
cairo_show_text (cr, dys[i])
cairo_stroke (cr)
cairo_rotate (cr,(math.pi/180)*(rot*-1))
end--for
cairo_select_font_face (cr, mfont, CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_BOLD);
cairo_set_font_size (cr, mfontsize);
cairo_set_source_rgba (cr,bred,bgreen,bblue,balpha)
for i=1,plen,7 do
fn=i
for i=fn,fn+6 do
cairo_move_to (cr, across+(gaph*(i-fn))-((((fn-1)/7)+ta)*turn), (i*move)+down+gapt+(gapl*((fn-1)/7)))
cairo_rotate (cr,(math.pi/180)*(rot))
cairo_show_text (cr, dnum[i])
cairo_stroke (cr)
cairo_rotate (cr,(math.pi/180)*(rot*-1))
end--for
end--for
cairo_select_font_face (cr, hfont, CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_BOLD);
cairo_set_font_size (cr, hfontsize);
cairo_set_source_rgba (cr,hred,hgreen,hblue,halpha)
for i=1,plen,7 do
fn=i
for i=fn,fn+6 do
cairo_move_to (cr, across+(gaph*(i-fn))-((((fn-1)/7)+ta)*turn), (i*move)+down+gapt+(gapl*((fn-1)/7)))
cairo_rotate (cr,(math.pi/180)*(rot))
cairo_show_text (cr, dnumh[i])
cairo_stroke (cr)
cairo_rotate (cr,(math.pi/180)*(rot*-1))
end--for
end--for
--###################################################
if surround==1 then
thisstart=tonumber(start_day)+1
thisend=tonumber(start_day)+mdays
previous=tonumber(start_day)
nextmon=dlen-thisend
pmon=tonumber(month)-1
if pmon==0 then pmon=12 end
pmon=monthdays[pmon]
snum={}
for i=1,dlen do
snum[i]=""
end
for i=tonumber(thisend)+1,tonumber(thisend)+nextmon do
snum[i]=i-tonumber(thisend)
end
for i=1,previous do
snum[i]=pmon-(previous-(i))
end
cairo_select_font_face (cr, sfont, CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_BOLD);
cairo_set_font_size (cr, sfontsize);
cairo_set_source_rgba (cr,sred,sgreen,sblue,salpha)
for i=1,plen,7 do
fn=i
for i=fn,fn+6 do
cairo_move_to (cr, across+(gaph*(i-fn))-((((fn-1)/7)+ta)*turn), (i*move)+down+gapt+(gapl*((fn-1)/7)))
cairo_rotate (cr,(math.pi/180)*(rot))
cairo_show_text (cr, snum[i])
cairo_stroke (cr)
cairo_rotate (cr,(math.pi/180)*(rot*-1))
end--for
end--for
end--if
--box aound
if box==1 then
cairo_set_source_rgba (cr,xred,xgreen,xblue,xalpha)
cairo_set_line_width (cr,1)
if place>0 and place<8 then
cy=down+gapt
elseif
place>7 and place<15 then
cy=down+gapt+gapl
elseif
place>13 and place<23 then
cy=down+gapt+gapl+gapl
elseif
place>21 and place<29 then
cy=down+gapt+gapl+gapl+gapl
elseif
place>28 and place<36 then
cy=down+gapt+gapl+gapl+gapl+gapl
end--if place
placey=place %7
if placey==1 then
cx=across
elseif
placey==2 then
cx=across+(gaph*1)
elseif
placey==3 then
cx=across+(gaph*2)
elseif
placey==4 then
cx=across+(gaph*3)
elseif
placey==5 then
cx=across+(gaph*4)
elseif
placey==6 then
cx=across+(gaph*5)
elseif
placey==0 then
cx=across+(gaph*6)
end--if placey
cairo_rectangle (cr,cx-xadjust,cy+yadjust,width,-height)
cairo_stroke (cr)
end--if box
cairo_rotate (cr,(math.pi/180)*(rotate*-1))
--###################################################
--end of calendar
--###################################################
-----------------------------------------------------------------
-- Next Month Name
-----------------------------------------------------------------
xstart=xpos+491
ystart=ypos-58.5
yadd=35
newmnth=month--tonumber(os.date("%m"))--current month number
if newmnth==12 then
out({x=xstart+65,y=ystart-61,c=0xb8b8b9,a=1,f="Augustus Beveled",fs=44,txt="January"})
elseif newmnth==01 then
out({x=xstart+65,y=ystart-61,c=0xb8b8b9,a=1,f="Augustus Beveled",fs=44,txt="February"})
elseif newmnth==02 then
out({x=xstart+80,y=ystart-61,c=0xb8b8b9,a=1,f="Augustus Beveled",fs=44,txt="March"})
elseif newmnth==03 then
out({x=xstart+90,y=ystart-61,c=0xb8b8b9,a=1,f="Augustus Beveled",fs=44,txt="April"})
elseif newmnth==04 then
out({x=xstart+100,y=ystart-61,c=0xb8b8b9,a=1,f="Augustus Beveled",fs=44,txt="May"})
elseif newmnth==05 then
out({x=xstart+100,y=ystart-61,c=0xb8b8b9,a=1,f="Augustus Beveled",fs=44,txt="June"})
elseif newmnth==06 then
out({x=xstart+100,y=ystart-61,c=0xb8b8b9,a=1,f="Augustus Beveled",fs=44,txt="July"})
elseif newmnth==07 then
out({x=xstart+80,y=ystart-61,c=0xb8b8b9,a=1,f="Augustus Beveled",fs=44,txt="August"})
elseif newmnth==08 then
out({x=xstart+55,y=ystart-61,c=0xb8b8b9,a=1,f="Augustus Beveled",fs=44,txt="September"})
elseif newmnth==09 then
out({x=xstart+70,y=ystart-61,c=0xb8b8b9,a=1,f="Augustus Beveled",fs=44,txt="October"})
elseif newmnth==10 then
out({x=xstart+52,y=ystart-61,c=0xb8b8b9,a=1,f="Augustus Beveled",fs=44,txt="November"})
else
out({x=xstart+60,y=ystart-61,c=0xb8b8b9,a=1,f="Augustus Beveled",fs=44,txt="December"})
end--if
]]
--==============================================================================================================================
-- Ubuntu Logo
--==============================================================================================================================
x=xpos+555
ypos=ypos+300
ringout2({cx=x,cy=ypos,wid=2,rad=125,c=0xffffff,a=1,start=0,endang=360})--frame
ringout2({cx=x,cy=ypos,wid=2,rad=124,c=0xf0f0f0,a=1,start=0,endang=360})--frame
ringout2({cx=x,cy=ypos,wid=2,rad=123,c=0xdbdbdb,a=1,start=0,endang=360})--frame
ringout2({cx=x,cy=ypos,wid=5,rad=135,c=0x848484,a=1,start=0,endang=360})--frame
ringout2({cx=x,cy=ypos,wid=5,rad=129,c=0xb8b8b8,a=1,start=0,endang=360})--frame
ringout2({cx=x,cy=ypos,wid=2,rad=122,c=0xb8b8b8,a=1,start=0,endang=360})--frame
ringout2({cx=x,cy=ypos,wid=3,rad=121,c=0x848484,a=1,start=0,endang=360})--frame
ringout2({cx=x,cy=ypos,wid=92,rad=46,c=0x173c4f,a=1,start=0,endang=360})--inner circle
ringout2({cx=x,cy=ypos,wid=28,rad=106,c=0x122e3d,a=1,start=0,endang=360})--outer circle
ringout2({cx=x,cy=ypos,wid=24,rad=44,c=0x5e5e5e,a=1,start=0,endang=360})--black
ringout2({cx=x,cy=ypos,wid=18,rad=44,c=0xdcdcdc,a=1,start=93,endang=207})--white
ringout2({cx=x,cy=ypos,wid=18,rad=44,c=0xf6973a,a=1,start=213,endang=327})--orange
ringout2({cx=x,cy=ypos,wid=18,rad=44,c=0x232323,a=1,start=333,endang=447})--black
ringout2({cx=x+35,cy=ypos-53,wid=20,rad=10,c=0xf6973a,a=1,start=0,endang=360})--orange
ringout2({cx=x+35,cy=ypos-53,wid=4,rad=21,c=0x5e5e5e,a=1,start=0,endang=360})--tan field
ringout2({cx=x+35,cy=ypos+53,wid=20,rad=10,c=0x232323,a=1,start=0,endang=360})--black
ringout2({cx=x+35,cy=ypos+53,wid=4,rad=21,c=0x5e5e5e,a=1,start=0,endang=360})--tan field
ringout2({cx=x-63,cy=ypos,wid=20,rad=10,c=0xdcdcdc,a=1,start=0,endang=360})--white
ringout2({cx=x-63,cy=ypos,wid=4,rad=21,c=0x5e5e5e,a=1,start=0,endang=360})--tan field
ringout2({cx=x,cy=ypos,wid=1,rad=92,c=0xdcdcdc,a=1,start=0,endang=360})--separator
timezone=os.date("%Z")--Pocket Calculator
out({x=460,y=973,c=0xb8b8b9,a=1,f="Augustus Beveled",fs=28,txt="Time Zone"})
-- out({x=xpos+15,y=ypos+170,c=0xf0f0f0,a=1,f="Pocket Calculator",fs=28,txt=":"})
out({x=590,y=973,c=0xf0f0f0,a=1,f="Pocket Calculator",fs=28,txt=":"})
out({x=610,y=973,c=0x75b3d1,a=1,f="Pocket Calculator",fs=28,txt=timezone})
--==============================================================================================================================
-- Circlewriting
--==============================================================================================================================
function addzero100(num)
if tonumber(num) < 10 then
return "00" .. num
elseif tonumber(num) <100 then
return "0" .. num
else
return num
end--if tonumber
end--function addzero
function string:split(delimiter)
local result = { }
local from = 1
local delim_from, delim_to = string.find( self, delimiter, from )
while delim_from do
table.insert( result, string.sub( self, from , delim_from-1 ) )
from = delim_to + 1
delim_from, delim_to = string.find( self, delimiter, from )
end--while delim
table.insert( result, string.sub( self, from ) )
return result
end--function string:split
function circlewriting(cr, text, font, fsize, radi, horiz, verti, tred, tgreen, tblue, talpha, start, finish, var1)
local inum=string.len(text)
range=finish
deg=(finish-start)/(inum-1)
degrads=1*(math.pi/180)
local textcut=string.gsub(text, ".", "%1@@@")
texttable=string.split(textcut, "@@@")
for i = 1,inum do
ival=i
interval=(degrads*(start+(deg*(i-1))))+var1
interval2=degrads*(start+(deg*(i-1)))
txs=0+radi*(math.sin(interval))
tys=0-radi*(math.cos(interval))
cairo_select_font_face (cr, font, CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
cairo_set_font_size (cr, fsize);
cairo_set_source_rgba (cr, tred, tgreen, tblue, talpha);
cairo_move_to (cr, txs+horiz, tys+verti);
cairo_rotate (cr, interval2)
cairo_show_text (cr, (texttable[i]))
cairo_stroke (cr)
cairo_rotate (cr, -interval2)
end--for
end--function circlewriting
function circlewritingdown(cr, text, font, fsize, radi, horiz, verti, tred, tgreen, tblue, talpha, start, finish, var1)
local inum=string.len(text)
deg=(start-finish)/(inum-1)
degrads=1*(math.pi/180)
local textcut=string.gsub(text, ".", "%1@@@")
texttable=string.split(textcut, "@@@")
for i = 1,inum do
ival=i
interval=(degrads*(start-(deg*(i-1))))+var1
interval2=degrads*(start-(deg*(i-1)))
txs=0+radi*(math.sin(interval))
tys=0-radi*(math.cos(interval))
cairo_select_font_face (cr, font, CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
cairo_set_font_size (cr, fsize);
cairo_set_source_rgba (cr, tred, tgreen, tblue, talpha);
cairo_move_to (cr, txs+horiz, tys+verti);
cairo_rotate (cr, interval2+(180*math.pi/180))
cairo_show_text (cr, (texttable[i]))
cairo_stroke (cr)
cairo_rotate (cr, -interval2-(180*math.pi/180))
end--for
end--function circlewritingdown
--circlewriting variable
hdate=tonumber(os.date("%I"))
tdate=os.date('%l:%M %p')
cpu=tonumber(conky_parse('${cpu}'))
--text must be in quotes
text=os.date('%A')--os.date('%b %e, %Y')
--font name must be in quotes
font="Times New Roman"
fontsize=23
radius=100
positionx=xpos+555
positiony=ypos
colorred=220/255
colorgreen=220/255
colorblue=220/255
coloralpha=1
--to set start and finish values for circlewriting, if the text will cross 0 degrees then you must calculate for 360+finish degrees
--eg if you want to go from 270 to 90, then you will input 270 to 450. Finish has to be greater than start.
start=-60
finish=50
letterposition=0
circlewriting(cr, text, font, fontsize, radius, positionx, positiony, colorred, colorgreen, colorblue, coloralpha, start, finish, letterposition)
--circlewritingdown variables
mem=tonumber(conky_parse('${memperc}'))
--text must be in quotes
text=os.date('%b %e, %Y')--tdate--("MEMORY " .. (addzero100(mem)) .. "%")
--font name must be in quotes
font="Times New Roman"
fontsize=24
radius=113
positionx=xpos+555
positiony=ypos
colorred=220/255
colorgreen=220/255
colorblue=220/255
coloralpha=1
--to set start and finish values for circlewritingdown, if the text will cross 0 degrees then you must calculate for 0-finish degrees
--eg if you want to go from 90 to 270, then you will input 90 to -90. Start has to be greater than finish
start=255
finish=110
letterposition=0
circlewritingdown(cr, text, font, fontsize, radius, positionx, positiony, colorred, colorgreen, colorblue, coloralpha, start, finish, letterposition)
--circlewritingdown variable
hdd=tonumber(conky_parse('${fs_used_perc /}'))
--text must be in quotes
text=(" ")--("FILESYS " .. (addzero100(hdd)) .. "%")
--font name must be in quotes
font="Ubuntu"
fontsize=18
radius=80
positionx=260
positiony=280
colorred=1
colorgreen=1
colorblue=1
coloralpha=1
--to set start and finish values for circlewritingdown, if the text will cross 0 degrees then you must calculate for 0-finish degrees
--eg if you want to go from 90 to 270, then you will input 90 to -90. Start has to be greater than finish
start=180
finish=0
letterposition=0.06
circlewritingdown(cr, text, font, fontsize, radius, positionx, positiony, colorred, colorgreen, colorblue, coloralpha, start, finish, letterposition)
--circlewriting variables
swap=tonumber(conky_parse('${swapperc}'))
--text must be in quotes
text=(" ")--("SWAP " .. (addzero100(swap)) .. "% ")
--font name must be in quotes
font="Ubuntu"
fontsize=18
radius=60
positionx=105
positiony=130
colorred=1
colorgreen=1
colorblue=1
coloralpha=1
--to set start and finish values for circlewriting, if the text will cross 0 degrees then you must calculate for 360+finish degrees
--eg if you want to go from 270 to 90, then you will input 270 to 450. Finish has to be greater than start.
start=200
finish=340
letterposition=0
circlewriting(cr, text, font, fontsize, radius, positionx, positiony, colorred, colorgreen, colorblue, coloralpha, start, finish, letterposition)
--======================================================================================================================================================
--end-- if updates>5
cairo_destroy(cr)
cairo_surface_destroy(cs)
cr=nil
end-- end main function
my_new.lua:
Code:
--[[ This script was written by stylintile with a lot of help from mrpeachy on
http://crunchbang.org/forums/viewtopic.php?id=17246 ]]
require 'cairo'
--==============================================================================================================================
-- Functions
--==============================================================================================================================
-----------------------------------------------------------------
-- Color conversion
-----------------------------------------------------------------
local function col(c,a)
return ( (c/0x10000) % 0x100)/255,( (c/0x100) % 0x100)/255,(c % 0x100)/255,a
end--local function
-----------------------------------------------------------------
-- Rectangles
-----------------------------------------------------------------
function rectout(rct)--Lines--###
c=nil
c=(rct.c or 0xffffff)
a=nil
a=(rct.a or 1)
lw=nil
lw=(rct.lw or 3)
tlx=nil
tlx=(rct.tlx or 100)
tly=nil
tly=(rct.tly or 100)
rec_width=nil
rec_width=(rct.rec_width or 50)
rec_height=nil
rec_height=(rct.rec_height or 50)
---------------------------------------
cairo_set_line_width (cr,lw)
cairo_rectangle (cr,tlx,tly,rec_width,rec_height)
cairo_set_source_rgba (cr,col(c,a))
cairo_stroke (cr)
end--function rectout ###
-----------------------------------------------------------------
-- Rings
-----------------------------------------------------------------
function ringout2(rn2)--Meter Rings--###
c=nil
c=(rn2.c or 0xffffff)
a=nil
a=(rn2.a or 1)
lc=nil
lc=(rn2.lc or CAIRO_LINE_CAP_BUTT)
wid=nil
wid=(rn2.wid or 3)
cx=nil
cx=(rn2.cx or 100)
cy=nil
cy=(rn2.cy or 100)
rad=nil
rad=(rn2.rad or 10)
start=nil
start=(rn2.start or 0)
endang=nil
endang=(rn2.endang or 360)
---------------------------------------
cairo_set_line_width (cr,wid)
cairo_set_line_cap (cr, lc)
cairo_set_source_rgba (cr,col(c,a))
cairo_arc (cr,cx,cy,rad,(start-90)*(math.pi/180),(endang-90)*(math.pi/180))
cairo_stroke (cr)
end--function ringout2 ###
-----------------------------------------------------------------
-- Lines (Borders) Display
-----------------------------------------------------------------
function lineout(ln)--Lines--###
c=nil
c=(ln.c or 0xffffff)
a=nil
a=(ln.a or 1)
lw=nil
lw=(ln.lw or 3)
lc=nil
lc=(ln.lc or CAIRO_LINE_CAP_BUTT)
strtx=nil
strtx=(ln.strtx or 0)
strty=nil
strty=(ln.strty or 0)
enx=nil
enx=(ln.enx or 50)
eny=nil
eny=(ln.eny or 50)
---------------------------------------
cairo_set_line_width (cr,lw)
cairo_set_line_cap (cr, lc)
cairo_set_source_rgba (cr,col(c,a))
cairo_move_to (cr,strtx,strty)
cairo_line_to (cr,enx,eny)
cairo_stroke (cr)
end--function lineout ###
-----------------------------------------------------------------
-- Text Display
-----------------------------------------------------------------
function out(tx)--Text--###
c=nil
c=(tx.c or 0xffffff)
a=nil
a=(tx.a or 1)
f=nil
f=(tx.f or "mono")
fs=nil
fs=(tx.fs or 12)
x=nil
x=(tx.x or 0)
y=nil
y=(tx.y or 0)
txt=nil
txt=(tx.txt or "set txt")
fw=nil
fw=(tx.fw or CAIRO_FONT_WEIGHT_NORMAL)
fsl=nil
fsl=(tx.fsl or CAIRO_FONT_SLANT_NORMAL)
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, fsl, fw);
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--Text-- ###
-----------------------------------------------------------------
-- Terminal Command
-----------------------------------------------------------------
function os.capture(cmd, raw)
local f = assert(io.popen(cmd, 'r'))
local s = assert(f:read('*a'))
f:close()
if raw then return s end
s = string.gsub(s, '^%s+', '')
s = string.gsub(s, '%s+$', '')
s = string.gsub(s, '[\n\r]+', ' ')
return s
end
-----------------------------------------------------------------
-- Split String
-----------------------------------------------------------------
function string:split(delimiter)
local result = { }
local from = 1
local delim_from, delim_to = string.find( self, delimiter, from )
while delim_from do
table.insert( result, string.sub( self, from , delim_from-1 ) )
from = delim_to + 1
delim_from, delim_to = string.find( self, delimiter, from )
end
table.insert( result, string.sub( self, from ) )
return result
end--of function
-----------------------------------------------------------------
-- Main
-----------------------------------------------------------------
function conky_main()
if conky_window == nil then return end
local cs = cairo_xlib_surface_create(conky_window.display, conky_window.drawable, conky_window.visual, conky_window.width, conky_window.height)
cr = cairo_create(cs)
local updates=tonumber(conky_parse('${updates}'))
if updates>5 then
--======================================================================================================================================================
--##################################################--------------DISPLAY AREA-------------#############################################################
--======================================================================================================================================================
--==============================================================================================================================
-- Pithos
--==============================================================================================================================
--pithos.php from http://3dgo.net/2011/11/22/pull-info-from-pithos-for-conky/
xpos=680
ypos=348
playing="no"
pithos_playing=tonumber(os.capture("pgrep pithos"))
if pithos_playing==nil then pithos_playing=0 else pithos_playing=1 end
if pithos_playing==1 then
pithos_title=os.capture("php ~/Documents/pithos/pithos.php 'title' | cut -c 1-50")
pithos_artist=os.capture("php ~/Documents/pithos/pithos.php 'artist' | cut -c 1-50")
pithos_album=os.capture("php ~/Documents/pithos/pithos.php 'album' | cut -c 1-50")
out({x=xpos+10,y=ypos,c=0xf0f0f0,a=1,f="Augustus Beveled",fs=26,txt="Pithos Pandora"})
out({x=xpos+82,y=ypos,c=0xf0f0f0,a=1,f="Crystal",fs=26,txt="/"})
out({x=xpos,y=ypos+25,c=0xf0f0f0,a=1,f="Basicdots",fs=14,txt=pithos_title})
out({x=xpos,y=ypos+50,c=0xf0f0f0,a=1,f="Basicdots",fs=14,txt=pithos_artist})
out({x=xpos,y=ypos+75,c=0xf0f0f0,a=1,f="Basicdots",fs=14,txt=pithos_album})
else
out({x=xpos+10,y=ypos,c=0xf0f0f0,a=1,f="Augustus Beveled",fs=26,txt="Pithos Pandora"})
out({x=xpos+82,y=ypos,c=0xf0f0f0,a=1,f="Crystal",fs=26,txt="/"})
out({x=xpos+10,y=ypos+25,c=0xf0f0f0,a=1,f="Augustus Beveled",fs=26,txt="Not Playing"})
end
--==============================================================================================================================
-- Meters
--==============================================================================================================================
xpos=1147
ypos=124
-----------------------------------------------------------------
-- Border and Title
-----------------------------------------------------------------
lineout({strtx=xpos-27,enx=xpos+278,strty=ypos-61,eny=ypos-61,c=0x848484,a=1,lw=3})
lineout({strtx=xpos-26,enx=xpos-26,strty=ypos-61,eny=ypos+909,c=0x848484,a=1,lw=3})
lineout({strtx=xpos-27,enx=xpos+278,strty=ypos+909,eny=ypos+909,c=0x848484,a=1,lw=3})
out({x=xpos-17,y=ypos-65,c=0xf0f0f0,a=1,f="Augustus Beveled",fs=26,txt="Meters"})
-----------------------------------------------------------------
-- Meter Variables
-----------------------------------------------------------------
home=tonumber(conky_parse('${fs_used_perc /}'))
swap=tonumber(conky_parse('${swapperc}'))
mem=tonumber(conky_parse('${memperc}'))
cpuavg=tonumber(conky_parse('${cpu cpu0}'))
cpu1=tonumber(conky_parse('${cpu cpu1}'))
cpu2=tonumber(conky_parse('${cpu cpu2}'))
cpu3=tonumber(conky_parse('${cpu cpu3}'))
cpu4=tonumber(conky_parse('${cpu cpu4}'))
load1=tonumber(conky_parse('${loadavg 1}'))
load2=tonumber(conky_parse('${loadavg 2}'))
load3=tonumber(conky_parse('${loadavg 3}'))
upeth=tonumber(conky_parse('${upspeedf eth0}'))
downeth=tonumber(conky_parse('${downspeedf eth0}'))
uplan=tonumber(conky_parse('${upspeedf wlan0}'))
downlan=tonumber(conky_parse('${downspeedf wlan0}'))
if home==nil then home=0 end
if swap==nil then swap=0 end
if mem==nil then mem=0 end
if cpuavg==nil then cpuavg=0 end
if cpu1==nil then cpu1=0 end
if cpu2==nil then cpu2=0 end
if cpu3==nil then cpu3=0 end
if cpu4==nil then cpu4=0 end
if load1==nil then load1=0 end
if load2==nil then load2=0 end
if load3==nil then load3=0 end
if upeth==nil then upeth=0 end
if downeth==nil then downeth=0 end
if uplan==nil then uplan=0 end
if downlan==nil then downlan=0 end
metertablea={home,swap,mem,cpuavg,cpu1,cpu2,cpu3,cpu4,load1,load2,load3,upeth,downeth,uplan,downlan}
metertableb={100,100,100,100,100,100,100,100,4,4,4,100,500,100,500}
-----------------------------------------------------------------
-- Background Bars
-----------------------------------------------------------------
x=xpos+22
xlen=210
lcap=CAIRO_LINE_CAP_ROUND
lw=9
c=0x75b3d1
a=0.2
cairo_set_line_width (cr,lw)
cairo_set_line_cap (cr, lcap)
cairo_set_source_rgba (cr,col(c,a))
for i=1,15 do
y=(ypos-15)+((i-1)*64)
cairo_move_to (cr,x,y)
cairo_line_to (cr,x+xlen,y)
cairo_stroke (cr)
end
-----------------------------------------------------------------
-- Meter Background
-----------------------------------------------------------------
x=xpos+22
xlen=210
lcap=CAIRO_LINE_CAP_ROUND
lw=9
c=0x75b3d1
a=0.4
cairo_set_line_width (cr,lw)
cairo_set_line_cap (cr, lcap)
cairo_set_source_rgba (cr,col(c,a))
for i=1,15 do
y=(ypos-15)+((i-1)*64)
cairo_move_to (cr,x,y)
cairo_line_to (cr,x+((xlen/metertableb[i])*metertablea[i]),y)
cairo_stroke (cr)
end
-----------------------------------------------------------------
-- Meter Foreground
-----------------------------------------------------------------
x=xpos+22
xlen=210
lcap=CAIRO_LINE_CAP_ROUND
lw=4
c=0x75b3d1
a=0.7
cairo_set_line_width (cr,lw)
cairo_set_line_cap (cr, lcap)
cairo_set_source_rgba (cr,col(c,a))
for i=1,15 do
y=(ypos-15)+((i-1)*64)
cairo_move_to (cr,x,y)
cairo_line_to (cr,x+((xlen/metertableb[i])*metertablea[i]),y)
cairo_stroke (cr)
end
-----------------------------------------------------------------
-- Text Variables
-----------------------------------------------------------------
homesize=conky_parse("${fs_size /}")
homefree=conky_parse("${fs_free /}")
homeperc=conky_parse("${fs_used_perc /}")
maxram=conky_parse("${memmax}")
freeram=conky_parse("${memfree}")
usedram=conky_parse("${memperc}")
swapsize=conky_parse("${swapmax}")
swapfree=conky_parse("${swapfree}")
swapperc=conky_parse("${swapperc}")
load1=conky_parse("${loadavg 1}")
load2=conky_parse("${loadavg 2}")
load3=conky_parse("${loadavg 3}")
cpuavg=conky_parse("${cpu cpu0}")
cpu1=tonumber(conky_parse("${cpu cpu1}"))
cpu2=tonumber(conky_parse("${cpu cpu2}"))
cpu3=tonumber(conky_parse("${cpu cpu3}"))
cpu4=tonumber(conky_parse("${cpu cpu4}"))
upeth=conky_parse("${upspeedf eth0}")
downeth=conky_parse("${downspeedf eth0}")
upwlan=conky_parse("${upspeedf wlan0}")
downwlan=conky_parse("${downspeedf wlan0}")
-----------------------------------------------------------------
-- Labels
-----------------------------------------------------------------
datayadd=64 -- y=datay+(dataadd*1) use 1 or more
-- internet=(conky_parse("${if_up eth0}1${else}0${endif}"))
-- net1=tonumber(internet)
wireless=(conky_parse("${if_up wlan0}1${else}0${endif}"))
net2=tonumber(wireless)
meterlabel={"Home","Swap","RAM","CPU Avg.","CPU","CPU","CPU","CPU","Load","Load","Load","Ethernet Up","Ethernet Down","Wireless Up","Wireless Down"}
meterxpos={xpos+93,xpos+94,xpos+93,xpos+72,xpos+95,xpos+95,xpos+95,xpos+95,xpos+94,xpos+94,xpos+94,xpos+56,xpos+36,xpos+52,xpos+37}
meterentries=#meterlabel
out({x=xpos+150,y=ypos+232,c=0xf0f0f0,a=0.7,f="Crystal",fs=26,txt="1"})
out({x=xpos+150,y=(ypos+232)+(datayadd),c=0xf0f0f0,a=0.7,f="Crystal",fs=26,txt="2"})
out({x=xpos+150,y=(ypos+232)+(datayadd*2),c=0xf0f0f0,a=0.7,f="Crystal",fs=26,txt="3"})
out({x=xpos+150,y=(ypos+232)+(datayadd*3),c=0xf0f0f0,a=0.7,f="Crystal",fs=26,txt="4"})
out({x=xpos+155,y=(ypos+232)+(datayadd*4),c=0xf0f0f0,a=0.7,f="Crystal",fs=26,txt="1"})
out({x=xpos+155,y=(ypos+232)+(datayadd*5),c=0xf0f0f0,a=0.7,f="Crystal",fs=26,txt="2"})
out({x=xpos+155,y=(ypos+232)+(datayadd*6),c=0xf0f0f0,a=0.7,f="Crystal",fs=26,txt="3"})
f="Augustus Beveled"
fs=CAIRO_FONT_SLANT_NORMAL
fw=CAIRO_FONT_WEIGHT_NORMAL
fs=20
c=0xf0f0f0
a=1
cairo_select_font_face (cr, f, CAIRO_FONT_SLANT_NORMAL, fw);
cairo_set_font_size (cr, fs)
cairo_set_source_rgba (cr,col(c,a))
for i=1,tonumber(meterentries) do
y=(ypos-24)+((i-1)*64)
cairo_move_to (cr,meterxpos[i]+5,y)
cairo_show_text (cr,meterlabel[i])
cairo_stroke (cr)
end--for
if net2==1 then
out({x=xpos+155,y=ypos-79+(datayadd*14)+18,c=0x16ec16,a=1,f="Ubuntu",fs=11,txt="Connected"})
else
out({x=xpos+148,y=ypos-79+(datayadd*14)+18,c=0xf10d0d,a=1,f="Ubuntu",fs=11,txt="Not Connected"})
end--if
-----------------------------------------------------------------
-- Information Display
-----------------------------------------------------------------
freq1=conky_parse("${freq_g cpu1}")
freq2=conky_parse("${freq_g cpu2}")
freq3=conky_parse("${freq_g cpu3}")
freq4=conky_parse("${freq_g cpu4}")
if cpu1==nil then cpu1=0 end
if cpu2==nil then cpu2=0 end
if cpu3==nil then cpu3=0 end
if cpu4==nil then cpu4=0 end
out({x=xpos+36,y=(ypos+2),c=0xb7b7b8,a=1,f="Ubuntu",fs=9,fw=CAIRO_FONT_WEIGHT_BOLD,txt="Size: "..homesize.." Free: "..homefree.." "..homeperc.."% Used"})
out({x=xpos+36,y=(ypos+2)+(datayadd*1),c=0xb7b7b8,a=1,f="Ubuntu",fs=9,fw=CAIRO_FONT_WEIGHT_BOLD,txt="Size: "..swapsize.." Free: "..swapfree.." "..swapperc.."% Used"})
out({x=xpos+36,y=(ypos+2)+(datayadd*2),c=0xb7b7b8,a=1,f="Ubuntu",fs=9,fw=CAIRO_FONT_WEIGHT_BOLD,txt="Total: "..maxram.." Free: "..freeram.." "..usedram.."% Used"})
out({x=xpos+101,y=(ypos+2)+(datayadd*3),c=0xb7b7b8,a=1,f="Ubuntu",fs=9,fw=CAIRO_FONT_WEIGHT_BOLD,txt="CPU Avg. : "..cpuavg.."%"})
out({x=xpos+77,y=(ypos+2)+(datayadd*4),c=0xb7b7b8,a=1,f="Ubuntu",fs=9,fw=CAIRO_FONT_WEIGHT_BOLD,txt="CPU 1: "..cpu1.."% @ "..freq1.." GHz"})
out({x=xpos+77,y=(ypos+2)+(datayadd*5),c=0xb7b7b8,a=1,f="Ubuntu",fs=9,fw=CAIRO_FONT_WEIGHT_BOLD,txt="CPU 2: "..cpu2.."% @ "..freq2.." GHz"})
out({x=xpos+77,y=(ypos+2)+(datayadd*6),c=0xb7b7b8,a=1,f="Ubuntu",fs=9,fw=CAIRO_FONT_WEIGHT_BOLD,txt="CPU 3: "..cpu3.."% @ "..freq3.." GHz"})
out({x=xpos+77,y=(ypos+2)+(datayadd*7),c=0xb7b7b8,a=1,f="Ubuntu",fs=9,fw=CAIRO_FONT_WEIGHT_BOLD,txt="CPU 4: "..cpu4.."% @ "..freq4.." GHz"})
out({x=xpos+79,y=(ypos+2)+(datayadd*8),c=0xb7b7b8,a=1,f="Ubuntu",fs=9,fw=CAIRO_FONT_WEIGHT_BOLD,txt="Load Avg. (1 Min.): "..load1})
out({x=xpos+79,y=(ypos+2)+(datayadd*9),c=0xb7b7b8,a=1,f="Ubuntu",fs=9,fw=CAIRO_FONT_WEIGHT_BOLD,txt="Load Avg. (5 Min.): "..load2})
out({x=xpos+79,y=(ypos+2)+(datayadd*10),c=0xb7b7b8,a=1,f="Ubuntu",fs=9,fw=CAIRO_FONT_WEIGHT_BOLD,txt="Load Avg. (15 Min.): "..load3})
out({x=xpos+38,y=(ypos+2)+(datayadd*11),c=0xb7b7b8,a=1,f="Ubuntu",fs=9,fw=CAIRO_FONT_WEIGHT_BOLD,txt="Upspeed eth0: "..upeth.."KiB/s"})
out({x=xpos+78,y=(ypos+2)+(datayadd*12),c=0xb7b7b8,a=1,f="Ubuntu",fs=9,fw=CAIRO_FONT_WEIGHT_BOLD,txt="Downspeed eth0: "..downeth.."KiB/s"})
out({x=xpos+38,y=(ypos+2)+(datayadd*13),c=0xb7b7b8,a=1,f="Ubuntu",fs=9,fw=CAIRO_FONT_WEIGHT_BOLD,txt="Upspeed wlan0: "..upwlan.."KiB/s"})
out({x=xpos+78,y=(ypos+2)+(datayadd*14),c=0xb7b7b8,a=1,f="Ubuntu",fs=9,fw=CAIRO_FONT_WEIGHT_BOLD,txt="Downspeed wlan0: "..downwlan.."KiB/s"})
-----------------------------------------------------------------
-- Text Background Lines
-----------------------------------------------------------------
x=xpos+17
xlen=220
lcap=CAIRO_LINE_CAP_BUTT
lw=15
c=0x848484
a=0.4
cairo_set_line_width (cr,lw)
cairo_set_line_cap (cr, lcap)
cairo_set_source_rgba (cr,col(c,a))
for i=1,15 do
y=(ypos-2)+((i-1)*64)
cairo_move_to (cr,x,y)
cairo_line_to (cr,x+xlen,y)
cairo_stroke (cr)
end
-----------------------------------------------------------------
-- Border @ Top of Boxes
-----------------------------------------------------------------
x=xpos+17
xlen=220
lcap=CAIRO_LINE_CAP_BUTT
lw=10
c=0x848484
a=0.4
cairo_set_line_width (cr,lw)
cairo_set_line_cap (cr, lcap)
cairo_set_source_rgba (cr,col(c,a))
for i=1,15 do
y=(ypos-50)+((i-1)*64)
cairo_move_to (cr,x,y)
cairo_line_to (cr,x+xlen,y)
cairo_stroke (cr)
end
-----------------------------------------------------------------
-- Left Semicircles
-----------------------------------------------------------------
c=0x848484
a=0.4
x=xpos+17
wid=30
rad=15
start=180
endang=360
lc=CAIRO_LINE_CAP_BUTT
cairo_set_line_width (cr,wid)
cairo_set_line_cap (cr, lc)
cairo_set_source_rgba (cr,col(c,a))
for i=1,15 do
y=(ypos-25)+((i-1)*64)
cairo_arc (cr,x,y,rad,(start-90)*(math.pi/180),(endang-90)*(math.pi/180))
cairo_stroke (cr)
end
-----------------------------------------------------------------
-- Right Semicircles
-----------------------------------------------------------------
c=0x848484
a=0.4
x=xpos+237
wid=30
rad=15
start=0
endang=180
lc=CAIRO_LINE_CAP_BUTT
cairo_set_line_width (cr,wid)
cairo_set_line_cap (cr, lc)
cairo_set_source_rgba (cr,col(c,a))
for i=1,15 do
y=(ypos-25)+((i-1)*64)
cairo_arc (cr,x,y,rad,(start-90)*(math.pi/180),(endang-90)*(math.pi/180))
cairo_stroke (cr)
end
--==============================================================================================================================
-- Date & Time
--==============================================================================================================================
xpos=867
ypos=829
-----------------------------------------------------------------
-- Border and Title
-----------------------------------------------------------------
-----------------------------------------------------------------
-- Clock Background
-----------------------------------------------------------------
ringout2({cx=xpos,cy=ypos,wid=2,rad=125,c=0xffffff,a=1,start=0,endang=360})--frame
ringout2({cx=xpos,cy=ypos,wid=2,rad=124,c=0xf0f0f0,a=1,start=0,endang=360})--frame
ringout2({cx=xpos,cy=ypos,wid=2,rad=123,c=0xdbdbdb,a=1,start=0,endang=360})--frame
ringout2({cx=xpos,cy=ypos,wid=5,rad=135,c=0x848484,a=1,start=0,endang=360})--frame
ringout2({cx=xpos,cy=ypos,wid=5,rad=129,c=0xb8b8b8,a=1,start=0,endang=360})--frame
ringout2({cx=xpos,cy=ypos,wid=2,rad=122,c=0xb8b8b8,a=1,start=0,endang=360})--frame
ringout2({cx=xpos,cy=ypos,wid=92,rad=46,c=0x173c4f,a=1,start=0,endang=360})
ringout2({cx=xpos,cy=ypos,wid=28,rad=106,c=0x122e3d,a=1,start=0,endang=360})
ringout2({cx=xpos,cy=ypos,wid=3,rad=5,c=0x126464,a=1,start=0,endang=360})
ringout2({cx=xpos,cy=ypos,wid=3,rad=2,c=0x126464,a=1,start=0,endang=360})
ringout2({cx=xpos,cy=ypos,wid=1,rad=6,c=0xc3c3c3,a=0.3,start=0,endang=360})
ringout2({cx=xpos,cy=ypos,wid=1,rad=3,c=0xc3c3c3,a=0.5,start=0,endang=360})
-----------------------------------------------------------------
-- Clock Numbers
-----------------------------------------------------------------
xpl=xpos-111
ypl=ypos-98
time_now=os.date("%H:%M:%S")
utc_hr=tonumber(os.date("%H"))
utc_now=utc_hr+4
utc_min_sec=os.date("%M:%S")
out({x=xpos-110,y=ypos+170,c=0xf0f0f0,a=1,f="Augustus Beveled",fs=28,txt="UTC Time"})
out({x=xpos+15,y=ypos+170,c=0xf0f0f0,a=1,f="Pocket Calculator",fs=28,txt=":"})
out({x=xpos+30,y=ypos+170,c=0x75b3d1,a=1,f="Pocket Calculator",fs=28,txt=utc_now..":"..utc_min_sec})
lineout({strtx=xpos-47,enx=xpos+47,strty=ypos-40,eny=ypos-40,c=0x000000,a=1,lw=24})
rectout({tlx=xpos-50,tly=ypos-55,rec_width=100,rec_height=30,c=0x122e3d,a=1,lw=1})
rectout({tlx=xpos-49,tly=ypos-54,rec_width=98,rec_height=28,c=0x0c1f29,a=1,lw=1})
rectout({tlx=xpos-48,tly=ypos-53,rec_width=96,rec_height=26,c=0x060f14,a=1,lw=1})
rectout({tlx=xpos-47,tly=ypos-52,rec_width=94,rec_height=24,c=0x03080a,a=1,lw=1})
rectout({tlx=xpos-51,tly=ypos-56,rec_width=101,rec_height=31,c=0x848484,a=1,lw=0.5})
out({x=xpos-45,y=ypos-31,c=0x478080,a=1,f="Pocket Calculator",fs=28,txt=time_now})
out({x=xpl+99,y=ypl,c=0xdcdcdc,a=1,f="Times New Roman",fs=24,txt="12"})
out({x=xpl+159,y=ypl+13,c=0xdcdcdc,a=1,f="Times New Roman",fs=24,txt="1"})
out({x=xpl+47,y=ypl+13,c=0xdcdcdc,a=1,f="Times New Roman",fs=24,txt="11"})
out({x=xpl+197,y=ypl+54,c=0xdcdcdc,a=1,f="Times New Roman",fs=24,txt="2"})
out({x=xpl+6,y=ypl+54,c=0xdcdcdc,a=1,f="Times New Roman",fs=24,txt="10"})
out({x=xpl+212,y=ypl+106,c=0xdcdcdc,a=1,f="Times New Roman",fs=24,txt="3"})
out({x=xpl,y=ypl+106,c=0xdcdcdc,a=1,f="Times New Roman",fs=24,txt="9"})
out({x=xpl+197,y=ypl+156,c=0xdcdcdc,a=1,f="Times New Roman",fs=24,txt="4"})
out({x=xpl+14,y=ypl+156,c=0xdcdcdc,a=1,f="Times New Roman",fs=24,txt="8"})
out({x=xpl+52,y=ypl+197,c=0xdcdcdc,a=1,f="Times New Roman",fs=24,txt="7"})
out({x=xpl+161,y=ypl+197,c=0xdcdcdc,a=1,f="Times New Roman",fs=24,txt="5"})
out({x=xpl+105,y=ypl+213,c=0xdcdcdc,a=1,f="Times New Roman",fs=24,txt="6"})
out({x=xpl+90,y=ypl+156,c=0xdcdcdc,a=1,f="Ubuntu Mono",fsl=CAIRO_FONT_SLANT_ITALIC,fs=16,txt="TIMUX"})
-----------------------------------------------------------------
-- Clock
-----------------------------------------------------------------
--###################################################
--CLOCK SETTINGS
clock_radius=90
clock_centerx=xpos
clock_centery=ypos
--12 or 24
clock_type=12
--how many marks around edge
number_marks=12
--set border options
clock_border_width=1
--set color and alpha for clock border
cbr,cbg,cbb,cba=220/255,220/255,220/255,1--full opaque white
--gap from clock border to hour marks
b_to_m=5
--set mark length
m_length=10
--set mark line width
m_width=2
--set mark line cap type
m_cap=CAIRO_LINE_CAP_ROUND
--set mark color and alpha,red blue green alpha
mr,mg,mb,ma=220/255,220/255,220/255,1--opaque white
-----seconds hand setup
--set length of seconds hand
sh_length=115
--set hand width
sh_width=1
--set hand line cap
sh_cap=CAIRO_LINE_CAP_ROUND
--set seconds hand color
shr,shg,shb,sha=175/255,0,0,1--fully opaque red
-----minues hand setup
--set length of minutes hand
mh_length=95
--set hand width
mh_width=4
--set hand line cap
mh_cap=CAIRO_LINE_CAP_ROUND
--set minute hand color
mhr,mhg,mhb,mha=18/255,100/255,100/255,1--fully opaque white
-----hour hand setup
--set length of hour hand
hh_length=75
--set hand width
hh_width=6
--set hand line cap
hh_cap=CAIRO_LINE_CAP_ROUND
--set hour hand color
hhr,hhg,hhb,hha=18/255,100/255,100/255,1--tan
--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
--set line cap type
cairo_set_line_cap (cr, m_cap)
--set line width
cairo_set_line_width (cr,m_width)
--set color and alpha for marks
cairo_set_source_rgba (cr,mr,mg,mb,ma)
--start for loop
for i=1,number_marks do
--drawing code uisng the value of i to calculate degrees
--calculate start point for 12 oclock mark
radius=m_start_rad
point=(math.pi/180)*((i-1)*(360/number_marks))
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 oclock mark
radius=m_end_rad
point=(math.pi/180)*((i-1)*(360/number_marks))
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##################################
if clock_type==12 then
hours=tonumber(os.date("%I"))--12 hour clock
--convert hours to seconds
h_to_s=hours*60*60
elseif clock_type==24 then
hours=tonumber(os.date("%H"))--24 hour clock
--convert hours to seconds
h_to_s=hours*60*60
end--if
minutes=tonumber(os.date("%M"))
--convert minutes to seconds
m_to_s=minutes*60
--get current seconds
seconds=tonumber(os.date("%S"))
--draw hours hand ###################################
--get hours minutes seconds as just seconds
hsecs=h_to_s+m_to_s+seconds
--calculate degrees for the hand each second
hsec_degs=hsecs*(360/(60*60*clock_type))--im using an equation instead of typing the calculation straight in because the result of 360/43200 gave us decimal places
--set radius we will use to calculate hand points
radius=hh_length
--set our starting line coordinates, the center of the circle
cairo_move_to (cr,clock_centerx,clock_centery)
--calculate coordinates for end of minutes 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)
cairo_set_source_rgba (cr,hhr,hhg,hhb,hha)
cairo_set_line_cap (cr, hh_cap)
cairo_stroke (cr)
--draw hours hand ###################################
--get hours minutes seconds as just seconds
hsecs=h_to_s+m_to_s+seconds
--calculate degrees for the hand each second
hsec_degs=hsecs*(360/(60*60*clock_type))--im using an equation instead of typing the calculation straight in because the result of 360/43200 gave us decimal places
--set radius we will use to calculate hand points
radius=hh_length
--set our starting line coordinates, the center of the circle
cairo_move_to (cr,clock_centerx,clock_centery)
--calculate coordinates for end of minutes 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,3)
cairo_set_source_rgba (cr,195/255,195/255,195/255,0.3)
cairo_set_line_cap (cr, hh_cap)
cairo_stroke (cr)
--draw minutes hand
--get minutes and seconds just as seconds
msecs=m_to_s+seconds
--calculate degrees for the hand each second
msec_degs=msecs*0.1
--set radius we will use to calculate hand points
radius=mh_length
--set our starting line coordinates, the center of the circle
cairo_move_to (cr,clock_centerx,clock_centery)
--calculate coordinates for end of minutes 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)
cairo_set_source_rgba (cr,mhr,mhg,mhb,mha)
cairo_set_line_cap (cr, mh_cap)
cairo_stroke (cr)
--draw minutes hand
--get minutes and seconds just as seconds
msecs=m_to_s+seconds
--calculate degrees for the hand each second
msec_degs=msecs*0.1
--set radius we will use to calculate hand points
radius=mh_length
--set our starting line coordinates, the center of the circle
cairo_move_to (cr,clock_centerx,clock_centery)
--calculate coordinates for end of minutes 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,2)
cairo_set_source_rgba (cr,195/255,195/255,195/255,0.3)
cairo_set_line_cap (cr, mh_cap)
cairo_stroke (cr)
--draw seconds hand #################################
--calculate degrees for the hand each second
sec_degs=seconds*6
--set radius we will use to calculate hand points
radius=sh_length
--set our starting 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)
cairo_set_source_rgba (cr,shr,shg,shb,sha)
cairo_set_line_cap (cr, sh_cap)
cairo_stroke (cr)
--======================================================================================================================================================
--##################################################------------END DISPLAY AREA-----------#############################################################
--======================================================================================================================================================
end-- if updates>5
cairo_destroy(cr)
cairo_surface_destroy(cs)
cr=nil
end-- end main function
my_right.lua
Code:
--[[ This script was written by stylintile with a lot of help from mrpeachy on
http://crunchbang.org/forums/viewtopic.php?id=17246 ]]
require 'cairo'
--==============================================================================================================================
-- Functions
--==============================================================================================================================
-----------------------------------------------------------------
-- Color conversion
-----------------------------------------------------------------
local function col(c,a)
return ( (c/0x10000) % 0x100)/255,( (c/0x100) % 0x100)/255,(c % 0x100)/255,a
end--local function
-----------------------------------------------------------------
-- Rectangles
-----------------------------------------------------------------
function rectout(rct)--Lines--###
c=nil
c=(rct.c or 0xffffff)
a=nil
a=(rct.a or 1)
lw=nil
lw=(rct.lw or 3)
tlx=nil
tlx=(rct.tlx or 100)
tly=nil
tly=(rct.tly or 100)
rec_width=nil
rec_width=(rct.rec_width or 50)
rec_height=nil
rec_height=(rct.rec_height or 50)
---------------------------------------
cairo_set_line_width (cr,lw)
cairo_rectangle (cr,tlx,tly,rec_width,rec_height)
cairo_set_source_rgba (cr,col(c,a))
cairo_stroke (cr)
end--function rectout ###
-----------------------------------------------------------------
-- Rings
-----------------------------------------------------------------
function ringout2(rn2)--Meter Rings--###
c=nil
c=(rn2.c or 0xffffff)
a=nil
a=(rn2.a or 1)
lc=nil
lc=(rn2.lc or CAIRO_LINE_CAP_BUTT)
wid=nil
wid=(rn2.wid or 3)
cx=nil
cx=(rn2.cx or 100)
cy=nil
cy=(rn2.cy or 100)
rad=nil
rad=(rn2.rad or 10)
start=nil
start=(rn2.start or 0)
endang=nil
endang=(rn2.endang or 360)
---------------------------------------
cairo_set_line_width (cr,wid)
cairo_set_line_cap (cr, lc)
cairo_set_source_rgba (cr,col(c,a))
cairo_arc (cr,cx,cy,rad,(start-90)*(math.pi/180),(endang-90)*(math.pi/180))
cairo_stroke (cr)
end--function ringout2 ###
-----------------------------------------------------------------
-- Lines (Borders) Display
-----------------------------------------------------------------
function lineout(ln)--Lines--###
c=nil
c=(ln.c or 0xffffff)
a=nil
a=(ln.a or 1)
lw=nil
lw=(ln.lw or 3)
lc=nil
lc=(ln.lc or CAIRO_LINE_CAP_BUTT)
strtx=nil
strtx=(ln.strtx or 0)
strty=nil
strty=(ln.strty or 0)
enx=nil
enx=(ln.enx or 50)
eny=nil
eny=(ln.eny or 50)
---------------------------------------
cairo_set_line_width (cr,lw)
cairo_set_line_cap (cr, lc)
cairo_set_source_rgba (cr,col(c,a))
cairo_move_to (cr,strtx,strty)
cairo_line_to (cr,enx,eny)
cairo_stroke (cr)
end--function lineout ###
-----------------------------------------------------------------
-- Text Display
-----------------------------------------------------------------
function out(tx)--Text--###
c=nil
c=(tx.c or 0xffffff)
a=nil
a=(tx.a or 1)
f=nil
f=(tx.f or "mono")
fs=nil
fs=(tx.fs or 12)
x=nil
x=(tx.x or 0)
y=nil
y=(tx.y or 0)
txt=nil
txt=(tx.txt or "set txt")
fw=nil
fw=(tx.fw or CAIRO_FONT_WEIGHT_NORMAL)
fsl=nil
fsl=(tx.fsl or CAIRO_FONT_SLANT_NORMAL)
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, fsl, fw);
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--Text-- ###
-----------------------------------------------------------------
-- Terminal Command
-----------------------------------------------------------------
function os.capture(cmd, raw)
local f = assert(io.popen(cmd, 'r'))
local s = assert(f:read('*a'))
f:close()
if raw then return s end
s = string.gsub(s, '^%s+', '')
s = string.gsub(s, '%s+$', '')
s = string.gsub(s, '[\n\r]+', ' ')
return s
end
-----------------------------------------------------------------
-- Split String
-----------------------------------------------------------------
function string:split(delimiter)
local result = { }
local from = 1
local delim_from, delim_to = string.find( self, delimiter, from )
while delim_from do
table.insert( result, string.sub( self, from , delim_from-1 ) )
from = delim_to + 1
delim_from, delim_to = string.find( self, delimiter, from )
end
table.insert( result, string.sub( self, from ) )
return result
end--of function
-----------------------------------------------------------------
-- Main
-----------------------------------------------------------------
function conky_main()
if conky_window == nil then return end
local cs = cairo_xlib_surface_create(conky_window.display, conky_window.drawable, conky_window.visual, conky_window.width, conky_window.height)
cr = cairo_create(cs)
local updates=tonumber(conky_parse('${updates}'))
if updates>5 then
--======================================================================================================================================================
--##################################################--------------DISPLAY AREA-------------#############################################################
--======================================================================================================================================================
--==============================================================================================================================
-- Pithos
--==============================================================================================================================
--pithos.php from http://3dgo.net/2011/11/22/pull-info-from-pithos-for-conky/
xpos=680
ypos=348
playing="no"
pithos_playing=tonumber(os.capture("pgrep pithos"))
if pithos_playing==nil then pithos_playing=0 else pithos_playing=1 end
if pithos_playing==1 then
pithos_title=os.capture("php ~/Documents/pithos/pithos.php 'title' | cut -c 1-50")
pithos_artist=os.capture("php ~/Documents/pithos/pithos.php 'artist' | cut -c 1-50")
pithos_album=os.capture("php ~/Documents/pithos/pithos.php 'album' | cut -c 1-50")
out({x=xpos+10,y=ypos,c=0xf0f0f0,a=1,f="Augustus Beveled",fs=26,txt="Pithos Pandora"})
out({x=xpos+82,y=ypos,c=0xf0f0f0,a=1,f="Crystal",fs=26,txt="/"})
out({x=xpos,y=ypos+25,c=0xf0f0f0,a=1,f="Basicdots",fs=14,txt=pithos_title})
out({x=xpos,y=ypos+50,c=0xf0f0f0,a=1,f="Basicdots",fs=14,txt=pithos_artist})
out({x=xpos,y=ypos+75,c=0xf0f0f0,a=1,f="Basicdots",fs=14,txt=pithos_album})
else
out({x=xpos+10,y=ypos,c=0xf0f0f0,a=1,f="Augustus Beveled",fs=26,txt="Pithos Pandora"})
out({x=xpos+82,y=ypos,c=0xf0f0f0,a=1,f="Crystal",fs=26,txt="/"})
out({x=xpos+10,y=ypos+25,c=0xf0f0f0,a=1,f="Augustus Beveled",fs=26,txt="Not Playing"})
end
--==============================================================================================================================
-- Meters
--==============================================================================================================================
xpos=1147
ypos=124
-----------------------------------------------------------------
-- Border and Title
-----------------------------------------------------------------
lineout({strtx=xpos-27,enx=xpos+278,strty=ypos-61,eny=ypos-61,c=0x848484,a=1,lw=3})
lineout({strtx=xpos-26,enx=xpos-26,strty=ypos-61,eny=ypos+909,c=0x848484,a=1,lw=3})
lineout({strtx=xpos-27,enx=xpos+278,strty=ypos+909,eny=ypos+909,c=0x848484,a=1,lw=3})
out({x=xpos-17,y=ypos-65,c=0xf0f0f0,a=1,f="Augustus Beveled",fs=26,txt="Meters"})
-----------------------------------------------------------------
-- Meter Variables
-----------------------------------------------------------------
home=tonumber(conky_parse('${fs_used_perc /}'))
swap=tonumber(conky_parse('${swapperc}'))
mem=tonumber(conky_parse('${memperc}'))
cpuavg=tonumber(conky_parse('${cpu cpu0}'))
cpu1=tonumber(conky_parse('${cpu cpu1}'))
cpu2=tonumber(conky_parse('${cpu cpu2}'))
cpu3=tonumber(conky_parse('${cpu cpu3}'))
cpu4=tonumber(conky_parse('${cpu cpu4}'))
load1=tonumber(conky_parse('${loadavg 1}'))
load2=tonumber(conky_parse('${loadavg 2}'))
load3=tonumber(conky_parse('${loadavg 3}'))
upeth=tonumber(conky_parse('${upspeedf eth0}'))
downeth=tonumber(conky_parse('${downspeedf eth0}'))
uplan=tonumber(conky_parse('${upspeedf wlan0}'))
downlan=tonumber(conky_parse('${downspeedf wlan0}'))
if home==nil then home=0 end
if swap==nil then swap=0 end
if mem==nil then mem=0 end
if cpuavg==nil then cpuavg=0 end
if cpu1==nil then cpu1=0 end
if cpu2==nil then cpu2=0 end
if cpu3==nil then cpu3=0 end
if cpu4==nil then cpu4=0 end
if load1==nil then load1=0 end
if load2==nil then load2=0 end
if load3==nil then load3=0 end
if upeth==nil then upeth=0 end
if downeth==nil then downeth=0 end
if uplan==nil then uplan=0 end
if downlan==nil then downlan=0 end
metertablea={home,swap,mem,cpuavg,cpu1,cpu2,cpu3,cpu4,load1,load2,load3,upeth,downeth,uplan,downlan}
metertableb={100,100,100,100,100,100,100,100,4,4,4,100,500,100,500}
-----------------------------------------------------------------
-- Background Bars
-----------------------------------------------------------------
x=xpos+22
xlen=210
lcap=CAIRO_LINE_CAP_ROUND
lw=9
c=0x75b3d1
a=0.2
cairo_set_line_width (cr,lw)
cairo_set_line_cap (cr, lcap)
cairo_set_source_rgba (cr,col(c,a))
for i=1,15 do
y=(ypos-15)+((i-1)*64)
cairo_move_to (cr,x,y)
cairo_line_to (cr,x+xlen,y)
cairo_stroke (cr)
end
-----------------------------------------------------------------
-- Meter Background
-----------------------------------------------------------------
x=xpos+22
xlen=210
lcap=CAIRO_LINE_CAP_ROUND
lw=9
c=0x75b3d1
a=0.4
cairo_set_line_width (cr,lw)
cairo_set_line_cap (cr, lcap)
cairo_set_source_rgba (cr,col(c,a))
for i=1,15 do
y=(ypos-15)+((i-1)*64)
cairo_move_to (cr,x,y)
cairo_line_to (cr,x+((xlen/metertableb[i])*metertablea[i]),y)
cairo_stroke (cr)
end
-----------------------------------------------------------------
-- Meter Foreground
-----------------------------------------------------------------
x=xpos+22
xlen=210
lcap=CAIRO_LINE_CAP_ROUND
lw=4
c=0x75b3d1
a=0.7
cairo_set_line_width (cr,lw)
cairo_set_line_cap (cr, lcap)
cairo_set_source_rgba (cr,col(c,a))
for i=1,15 do
y=(ypos-15)+((i-1)*64)
cairo_move_to (cr,x,y)
cairo_line_to (cr,x+((xlen/metertableb[i])*metertablea[i]),y)
cairo_stroke (cr)
end
-----------------------------------------------------------------
-- Text Variables
-----------------------------------------------------------------
homesize=conky_parse("${fs_size /}")
homefree=conky_parse("${fs_free /}")
homeperc=conky_parse("${fs_used_perc /}")
maxram=conky_parse("${memmax}")
freeram=conky_parse("${memfree}")
usedram=conky_parse("${memperc}")
swapsize=conky_parse("${swapmax}")
swapfree=conky_parse("${swapfree}")
swapperc=conky_parse("${swapperc}")
load1=conky_parse("${loadavg 1}")
load2=conky_parse("${loadavg 2}")
load3=conky_parse("${loadavg 3}")
cpuavg=conky_parse("${cpu cpu0}")
cpu1=tonumber(conky_parse("${cpu cpu1}"))
cpu2=tonumber(conky_parse("${cpu cpu2}"))
cpu3=tonumber(conky_parse("${cpu cpu3}"))
cpu4=tonumber(conky_parse("${cpu cpu4}"))
upeth=conky_parse("${upspeedf eth0}")
downeth=conky_parse("${downspeedf eth0}")
upwlan=conky_parse("${upspeedf wlan0}")
downwlan=conky_parse("${downspeedf wlan0}")
-----------------------------------------------------------------
-- Labels
-----------------------------------------------------------------
datayadd=64 -- y=datay+(dataadd*1) use 1 or more
-- internet=(conky_parse("${if_up eth0}1${else}0${endif}"))
-- net1=tonumber(internet)
wireless=(conky_parse("${if_up wlan0}1${else}0${endif}"))
net2=tonumber(wireless)
meterlabel={"Home","Swap","RAM","CPU Avg.","CPU","CPU","CPU","CPU","Load","Load","Load","Ethernet Up","Ethernet Down","Wireless Up","Wireless Down"}
meterxpos={xpos+93,xpos+94,xpos+93,xpos+72,xpos+95,xpos+95,xpos+95,xpos+95,xpos+94,xpos+94,xpos+94,xpos+56,xpos+36,xpos+52,xpos+37}
meterentries=#meterlabel
out({x=xpos+150,y=ypos+232,c=0xf0f0f0,a=0.7,f="Crystal",fs=26,txt="1"})
out({x=xpos+150,y=(ypos+232)+(datayadd),c=0xf0f0f0,a=0.7,f="Crystal",fs=26,txt="2"})
out({x=xpos+150,y=(ypos+232)+(datayadd*2),c=0xf0f0f0,a=0.7,f="Crystal",fs=26,txt="3"})
out({x=xpos+150,y=(ypos+232)+(datayadd*3),c=0xf0f0f0,a=0.7,f="Crystal",fs=26,txt="4"})
out({x=xpos+155,y=(ypos+232)+(datayadd*4),c=0xf0f0f0,a=0.7,f="Crystal",fs=26,txt="1"})
out({x=xpos+155,y=(ypos+232)+(datayadd*5),c=0xf0f0f0,a=0.7,f="Crystal",fs=26,txt="2"})
out({x=xpos+155,y=(ypos+232)+(datayadd*6),c=0xf0f0f0,a=0.7,f="Crystal",fs=26,txt="3"})
f="Augustus Beveled"
fs=CAIRO_FONT_SLANT_NORMAL
fw=CAIRO_FONT_WEIGHT_NORMAL
fs=20
c=0xf0f0f0
a=1
cairo_select_font_face (cr, f, CAIRO_FONT_SLANT_NORMAL, fw);
cairo_set_font_size (cr, fs)
cairo_set_source_rgba (cr,col(c,a))
for i=1,tonumber(meterentries) do
y=(ypos-24)+((i-1)*64)
cairo_move_to (cr,meterxpos[i]+5,y)
cairo_show_text (cr,meterlabel[i])
cairo_stroke (cr)
end--for
if net2==1 then
out({x=xpos+155,y=ypos-79+(datayadd*14)+18,c=0x16ec16,a=1,f="Ubuntu",fs=11,txt="Connected"})
else
out({x=xpos+148,y=ypos-79+(datayadd*14)+18,c=0xf10d0d,a=1,f="Ubuntu",fs=11,txt="Not Connected"})
end--if
-----------------------------------------------------------------
-- Information Display
-----------------------------------------------------------------
freq1=conky_parse("${freq_g cpu1}")
freq2=conky_parse("${freq_g cpu2}")
freq3=conky_parse("${freq_g cpu3}")
freq4=conky_parse("${freq_g cpu4}")
if cpu1==nil then cpu1=0 end
if cpu2==nil then cpu2=0 end
if cpu3==nil then cpu3=0 end
if cpu4==nil then cpu4=0 end
out({x=xpos+36,y=(ypos+2),c=0xb7b7b8,a=1,f="Ubuntu",fs=9,fw=CAIRO_FONT_WEIGHT_BOLD,txt="Size: "..homesize.." Free: "..homefree.." "..homeperc.."% Used"})
out({x=xpos+36,y=(ypos+2)+(datayadd*1),c=0xb7b7b8,a=1,f="Ubuntu",fs=9,fw=CAIRO_FONT_WEIGHT_BOLD,txt="Size: "..swapsize.." Free: "..swapfree.." "..swapperc.."% Used"})
out({x=xpos+36,y=(ypos+2)+(datayadd*2),c=0xb7b7b8,a=1,f="Ubuntu",fs=9,fw=CAIRO_FONT_WEIGHT_BOLD,txt="Total: "..maxram.." Free: "..freeram.." "..usedram.."% Used"})
out({x=xpos+101,y=(ypos+2)+(datayadd*3),c=0xb7b7b8,a=1,f="Ubuntu",fs=9,fw=CAIRO_FONT_WEIGHT_BOLD,txt="CPU Avg. : "..cpuavg.."%"})
out({x=xpos+77,y=(ypos+2)+(datayadd*4),c=0xb7b7b8,a=1,f="Ubuntu",fs=9,fw=CAIRO_FONT_WEIGHT_BOLD,txt="CPU 1: "..cpu1.."% @ "..freq1.." GHz"})
out({x=xpos+77,y=(ypos+2)+(datayadd*5),c=0xb7b7b8,a=1,f="Ubuntu",fs=9,fw=CAIRO_FONT_WEIGHT_BOLD,txt="CPU 2: "..cpu2.."% @ "..freq2.." GHz"})
out({x=xpos+77,y=(ypos+2)+(datayadd*6),c=0xb7b7b8,a=1,f="Ubuntu",fs=9,fw=CAIRO_FONT_WEIGHT_BOLD,txt="CPU 3: "..cpu3.."% @ "..freq3.." GHz"})
out({x=xpos+77,y=(ypos+2)+(datayadd*7),c=0xb7b7b8,a=1,f="Ubuntu",fs=9,fw=CAIRO_FONT_WEIGHT_BOLD,txt="CPU 4: "..cpu4.."% @ "..freq4.." GHz"})
out({x=xpos+79,y=(ypos+2)+(datayadd*8),c=0xb7b7b8,a=1,f="Ubuntu",fs=9,fw=CAIRO_FONT_WEIGHT_BOLD,txt="Load Avg. (1 Min.): "..load1})
out({x=xpos+79,y=(ypos+2)+(datayadd*9),c=0xb7b7b8,a=1,f="Ubuntu",fs=9,fw=CAIRO_FONT_WEIGHT_BOLD,txt="Load Avg. (5 Min.): "..load2})
out({x=xpos+79,y=(ypos+2)+(datayadd*10),c=0xb7b7b8,a=1,f="Ubuntu",fs=9,fw=CAIRO_FONT_WEIGHT_BOLD,txt="Load Avg. (15 Min.): "..load3})
out({x=xpos+38,y=(ypos+2)+(datayadd*11),c=0xb7b7b8,a=1,f="Ubuntu",fs=9,fw=CAIRO_FONT_WEIGHT_BOLD,txt="Upspeed eth0: "..upeth.."KiB/s"})
out({x=xpos+78,y=(ypos+2)+(datayadd*12),c=0xb7b7b8,a=1,f="Ubuntu",fs=9,fw=CAIRO_FONT_WEIGHT_BOLD,txt="Downspeed eth0: "..downeth.."KiB/s"})
out({x=xpos+38,y=(ypos+2)+(datayadd*13),c=0xb7b7b8,a=1,f="Ubuntu",fs=9,fw=CAIRO_FONT_WEIGHT_BOLD,txt="Upspeed wlan0: "..upwlan.."KiB/s"})
out({x=xpos+78,y=(ypos+2)+(datayadd*14),c=0xb7b7b8,a=1,f="Ubuntu",fs=9,fw=CAIRO_FONT_WEIGHT_BOLD,txt="Downspeed wlan0: "..downwlan.."KiB/s"})
-----------------------------------------------------------------
-- Text Background Lines
-----------------------------------------------------------------
x=xpos+17
xlen=220
lcap=CAIRO_LINE_CAP_BUTT
lw=15
c=0x848484
a=0.4
cairo_set_line_width (cr,lw)
cairo_set_line_cap (cr, lcap)
cairo_set_source_rgba (cr,col(c,a))
for i=1,15 do
y=(ypos-2)+((i-1)*64)
cairo_move_to (cr,x,y)
cairo_line_to (cr,x+xlen,y)
cairo_stroke (cr)
end
-----------------------------------------------------------------
-- Border @ Top of Boxes
-----------------------------------------------------------------
x=xpos+17
xlen=220
lcap=CAIRO_LINE_CAP_BUTT
lw=10
c=0x848484
a=0.4
cairo_set_line_width (cr,lw)
cairo_set_line_cap (cr, lcap)
cairo_set_source_rgba (cr,col(c,a))
for i=1,15 do
y=(ypos-50)+((i-1)*64)
cairo_move_to (cr,x,y)
cairo_line_to (cr,x+xlen,y)
cairo_stroke (cr)
end
-----------------------------------------------------------------
-- Left Semicircles
-----------------------------------------------------------------
c=0x848484
a=0.4
x=xpos+17
wid=30
rad=15
start=180
endang=360
lc=CAIRO_LINE_CAP_BUTT
cairo_set_line_width (cr,wid)
cairo_set_line_cap (cr, lc)
cairo_set_source_rgba (cr,col(c,a))
for i=1,15 do
y=(ypos-25)+((i-1)*64)
cairo_arc (cr,x,y,rad,(start-90)*(math.pi/180),(endang-90)*(math.pi/180))
cairo_stroke (cr)
end
-----------------------------------------------------------------
-- Right Semicircles
-----------------------------------------------------------------
c=0x848484
a=0.4
x=xpos+237
wid=30
rad=15
start=0
endang=180
lc=CAIRO_LINE_CAP_BUTT
cairo_set_line_width (cr,wid)
cairo_set_line_cap (cr, lc)
cairo_set_source_rgba (cr,col(c,a))
for i=1,15 do
y=(ypos-25)+((i-1)*64)
cairo_arc (cr,x,y,rad,(start-90)*(math.pi/180),(endang-90)*(math.pi/180))
cairo_stroke (cr)
end
--==============================================================================================================================
-- Date & Time
--==============================================================================================================================
xpos=867
ypos=829
-----------------------------------------------------------------
-- Border and Title
-----------------------------------------------------------------
-----------------------------------------------------------------
-- Clock Background
-----------------------------------------------------------------
ringout2({cx=xpos,cy=ypos,wid=2,rad=125,c=0xffffff,a=1,start=0,endang=360})--frame
ringout2({cx=xpos,cy=ypos,wid=2,rad=124,c=0xf0f0f0,a=1,start=0,endang=360})--frame
ringout2({cx=xpos,cy=ypos,wid=2,rad=123,c=0xdbdbdb,a=1,start=0,endang=360})--frame
ringout2({cx=xpos,cy=ypos,wid=5,rad=135,c=0x848484,a=1,start=0,endang=360})--frame
ringout2({cx=xpos,cy=ypos,wid=5,rad=129,c=0xb8b8b8,a=1,start=0,endang=360})--frame
ringout2({cx=xpos,cy=ypos,wid=2,rad=122,c=0xb8b8b8,a=1,start=0,endang=360})--frame
ringout2({cx=xpos,cy=ypos,wid=92,rad=46,c=0x173c4f,a=1,start=0,endang=360})
ringout2({cx=xpos,cy=ypos,wid=28,rad=106,c=0x122e3d,a=1,start=0,endang=360})
ringout2({cx=xpos,cy=ypos,wid=3,rad=5,c=0x126464,a=1,start=0,endang=360})
ringout2({cx=xpos,cy=ypos,wid=3,rad=2,c=0x126464,a=1,start=0,endang=360})
ringout2({cx=xpos,cy=ypos,wid=1,rad=6,c=0xc3c3c3,a=0.3,start=0,endang=360})
ringout2({cx=xpos,cy=ypos,wid=1,rad=3,c=0xc3c3c3,a=0.5,start=0,endang=360})
-----------------------------------------------------------------
-- Clock Numbers
-----------------------------------------------------------------
xpl=xpos-111
ypl=ypos-98
time_now=os.date("%H:%M:%S")
utc_hr=tonumber(os.date("%H"))
utc_now=utc_hr+4
utc_min_sec=os.date("%M:%S")
out({x=xpos-110,y=ypos+170,c=0xf0f0f0,a=1,f="Augustus Beveled",fs=28,txt="UTC Time"})
out({x=xpos+15,y=ypos+170,c=0xf0f0f0,a=1,f="Pocket Calculator",fs=28,txt=":"})
out({x=xpos+30,y=ypos+170,c=0x75b3d1,a=1,f="Pocket Calculator",fs=28,txt=utc_now..":"..utc_min_sec})
lineout({strtx=xpos-47,enx=xpos+47,strty=ypos-40,eny=ypos-40,c=0x000000,a=1,lw=24})
rectout({tlx=xpos-50,tly=ypos-55,rec_width=100,rec_height=30,c=0x122e3d,a=1,lw=1})
rectout({tlx=xpos-49,tly=ypos-54,rec_width=98,rec_height=28,c=0x0c1f29,a=1,lw=1})
rectout({tlx=xpos-48,tly=ypos-53,rec_width=96,rec_height=26,c=0x060f14,a=1,lw=1})
rectout({tlx=xpos-47,tly=ypos-52,rec_width=94,rec_height=24,c=0x03080a,a=1,lw=1})
rectout({tlx=xpos-51,tly=ypos-56,rec_width=101,rec_height=31,c=0x848484,a=1,lw=0.5})
out({x=xpos-45,y=ypos-31,c=0x478080,a=1,f="Pocket Calculator",fs=28,txt=time_now})
out({x=xpl+99,y=ypl,c=0xdcdcdc,a=1,f="Times New Roman",fs=24,txt="12"})
out({x=xpl+159,y=ypl+13,c=0xdcdcdc,a=1,f="Times New Roman",fs=24,txt="1"})
out({x=xpl+47,y=ypl+13,c=0xdcdcdc,a=1,f="Times New Roman",fs=24,txt="11"})
out({x=xpl+197,y=ypl+54,c=0xdcdcdc,a=1,f="Times New Roman",fs=24,txt="2"})
out({x=xpl+6,y=ypl+54,c=0xdcdcdc,a=1,f="Times New Roman",fs=24,txt="10"})
out({x=xpl+212,y=ypl+106,c=0xdcdcdc,a=1,f="Times New Roman",fs=24,txt="3"})
out({x=xpl,y=ypl+106,c=0xdcdcdc,a=1,f="Times New Roman",fs=24,txt="9"})
out({x=xpl+197,y=ypl+156,c=0xdcdcdc,a=1,f="Times New Roman",fs=24,txt="4"})
out({x=xpl+14,y=ypl+156,c=0xdcdcdc,a=1,f="Times New Roman",fs=24,txt="8"})
out({x=xpl+52,y=ypl+197,c=0xdcdcdc,a=1,f="Times New Roman",fs=24,txt="7"})
out({x=xpl+161,y=ypl+197,c=0xdcdcdc,a=1,f="Times New Roman",fs=24,txt="5"})
out({x=xpl+105,y=ypl+213,c=0xdcdcdc,a=1,f="Times New Roman",fs=24,txt="6"})
out({x=xpl+90,y=ypl+156,c=0xdcdcdc,a=1,f="Ubuntu Mono",fsl=CAIRO_FONT_SLANT_ITALIC,fs=16,txt="TIMUX"})
-----------------------------------------------------------------
-- Clock
-----------------------------------------------------------------
--###################################################
--CLOCK SETTINGS
clock_radius=90
clock_centerx=xpos
clock_centery=ypos
--12 or 24
clock_type=12
--how many marks around edge
number_marks=12
--set border options
clock_border_width=1
--set color and alpha for clock border
cbr,cbg,cbb,cba=220/255,220/255,220/255,1--full opaque white
--gap from clock border to hour marks
b_to_m=5
--set mark length
m_length=10
--set mark line width
m_width=2
--set mark line cap type
m_cap=CAIRO_LINE_CAP_ROUND
--set mark color and alpha,red blue green alpha
mr,mg,mb,ma=220/255,220/255,220/255,1--opaque white
-----seconds hand setup
--set length of seconds hand
sh_length=115
--set hand width
sh_width=1
--set hand line cap
sh_cap=CAIRO_LINE_CAP_ROUND
--set seconds hand color
shr,shg,shb,sha=175/255,0,0,1--fully opaque red
-----minues hand setup
--set length of minutes hand
mh_length=95
--set hand width
mh_width=4
--set hand line cap
mh_cap=CAIRO_LINE_CAP_ROUND
--set minute hand color
mhr,mhg,mhb,mha=18/255,100/255,100/255,1--fully opaque white
-----hour hand setup
--set length of hour hand
hh_length=75
--set hand width
hh_width=6
--set hand line cap
hh_cap=CAIRO_LINE_CAP_ROUND
--set hour hand color
hhr,hhg,hhb,hha=18/255,100/255,100/255,1--tan
--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
--set line cap type
cairo_set_line_cap (cr, m_cap)
--set line width
cairo_set_line_width (cr,m_width)
--set color and alpha for marks
cairo_set_source_rgba (cr,mr,mg,mb,ma)
--start for loop
for i=1,number_marks do
--drawing code uisng the value of i to calculate degrees
--calculate start point for 12 oclock mark
radius=m_start_rad
point=(math.pi/180)*((i-1)*(360/number_marks))
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 oclock mark
radius=m_end_rad
point=(math.pi/180)*((i-1)*(360/number_marks))
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##################################
if clock_type==12 then
hours=tonumber(os.date("%I"))--12 hour clock
--convert hours to seconds
h_to_s=hours*60*60
elseif clock_type==24 then
hours=tonumber(os.date("%H"))--24 hour clock
--convert hours to seconds
h_to_s=hours*60*60
end--if
minutes=tonumber(os.date("%M"))
--convert minutes to seconds
m_to_s=minutes*60
--get current seconds
seconds=tonumber(os.date("%S"))
--draw hours hand ###################################
--get hours minutes seconds as just seconds
hsecs=h_to_s+m_to_s+seconds
--calculate degrees for the hand each second
hsec_degs=hsecs*(360/(60*60*clock_type))--im using an equation instead of typing the calculation straight in because the result of 360/43200 gave us decimal places
--set radius we will use to calculate hand points
radius=hh_length
--set our starting line coordinates, the center of the circle
cairo_move_to (cr,clock_centerx,clock_centery)
--calculate coordinates for end of minutes 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)
cairo_set_source_rgba (cr,hhr,hhg,hhb,hha)
cairo_set_line_cap (cr, hh_cap)
cairo_stroke (cr)
--draw hours hand ###################################
--get hours minutes seconds as just seconds
hsecs=h_to_s+m_to_s+seconds
--calculate degrees for the hand each second
hsec_degs=hsecs*(360/(60*60*clock_type))--im using an equation instead of typing the calculation straight in because the result of 360/43200 gave us decimal places
--set radius we will use to calculate hand points
radius=hh_length
--set our starting line coordinates, the center of the circle
cairo_move_to (cr,clock_centerx,clock_centery)
--calculate coordinates for end of minutes 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,3)
cairo_set_source_rgba (cr,195/255,195/255,195/255,0.3)
cairo_set_line_cap (cr, hh_cap)
cairo_stroke (cr)
--draw minutes hand
--get minutes and seconds just as seconds
msecs=m_to_s+seconds
--calculate degrees for the hand each second
msec_degs=msecs*0.1
--set radius we will use to calculate hand points
radius=mh_length
--set our starting line coordinates, the center of the circle
cairo_move_to (cr,clock_centerx,clock_centery)
--calculate coordinates for end of minutes 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)
cairo_set_source_rgba (cr,mhr,mhg,mhb,mha)
cairo_set_line_cap (cr, mh_cap)
cairo_stroke (cr)
--draw minutes hand
--get minutes and seconds just as seconds
msecs=m_to_s+seconds
--calculate degrees for the hand each second
msec_degs=msecs*0.1
--set radius we will use to calculate hand points
radius=mh_length
--set our starting line coordinates, the center of the circle
cairo_move_to (cr,clock_centerx,clock_centery)
--calculate coordinates for end of minutes 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,2)
cairo_set_source_rgba (cr,195/255,195/255,195/255,0.3)
cairo_set_line_cap (cr, mh_cap)
cairo_stroke (cr)
--draw seconds hand #################################
--calculate degrees for the hand each second
sec_degs=seconds*6
--set radius we will use to calculate hand points
radius=sh_length
--set our starting 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)
cairo_set_source_rgba (cr,shr,shg,shb,sha)
cairo_set_line_cap (cr, sh_cap)
cairo_stroke (cr)
--======================================================================================================================================================
--##################################################------------END DISPLAY AREA-----------#############################################################
--======================================================================================================================================================
end-- if updates>5
cairo_destroy(cr)
cairo_surface_destroy(cs)
cr=nil
end-- end main function
pithos.php (needs php5 and pithos installed and a Pandora account);
Code:
#!/usr/bin/php
<?php
$song=`dbus-send --print-reply --dest=net.kevinmehall.Pithos /net/kevinmehall/Pithos net.kevinmehall.Pithos.GetCurrentSong`;
$matches = array();
switch($argv[1]) {
case 'album':
$pattern = '~"album".*?"(.*?)".*~s';
break;
case 'title':
$pattern = '~"title".*?"(.*?)".*~s';
break;
case 'artist':
$pattern = '~"artist".*?"(.*?)".*~s';
break;
default:
exit;
}
preg_match($pattern, $song, $matches);
if($matches) {
echo $matches[1];
}
?>
schedule.txt:
Code:
04 25 Open
04 26 Open
04 29 Ken & Sandy
04 30 Ken & Sandy
05 01 Ken & Sandy
05 02 Thomas
05 03 Thomas
05 06 Open
05 07 Open
05 08 Open
05 09 Open
05 10 Open
05 13 Open
todo.txt:
Code:
01 Call Mrs Thomas
01 Fix tile saw
01 Organize shed
01 Organize tools
01 Bid for Ken & Sandy
03 Organize computer room
04 Finish soffit
06 Done
07 Done
08 Done
and finally, the startup script, conky_start.sh:
Code:
#!/bin/bash
sleep 1 &&
conky -d -c /home/dale/.my_right_rc
sleep 1 &&
conky -d -c /home/dale/.nosmoke_rc
sleep 1 &&
conky -d -c /home/dale/.my_info_lua_rc
sleep 5 &&
conky -d -c /home/dale/.my_new_lua_rc
exit
and last but not least, the screenshot. To the awesome community I borrowed, stole, copied and learned from,Thank You!!!
Bookmarks