Code:
--this is a lua script for use in conky
--==============================================================================================================================
-------------------------------------------------------Index--------------------------------------------------------------------
--==============================================================================================================================
--Required
--Functions
-- A) Color conversion
-- B) Rectangles
-- C) Rings
-- D) Lines (Borders) Display
-- E) Text Display
-- F) Terminal Command
-- G) Main
--Sections
-- 1) Holidays
-- 1A) Border and Title
-- 1B) Text Display
-- 2) SPECIAL DAYS
-- 2A) Border and Title
-- 2B) Text Display
-- 3) Schedule
-- 3A) Border and Title
-- 3B) Text Display
-- 4)To Do
-- 4A) Border and Title
-- 4B) Text Display
-- 5) System Information
-- 5A) Borders
-- 5B) Variables
-- 5C) Title, Headers and Labels
-- 5D) Text Display
-- 6) Guayadeque
-- 6A) Border and Title
-- 6B) Text Display
-- 6C) Top Curlique (Not Running)
-- 6D) Bottom Curlique (Not Running)
-- 6E) Bottom Curlique (Running)
-- 7) Sobriety
-- 7A) Border and Title
-- 7B) Text Display
-- 7C) Eye Blink
-- 8) Ubuntu Plaque
-- 8A) Background
-- 8B) Frame
-- 8C) Text and Accent Lines
-- 9) Meters
-- 9A) Border and Title
-- 9B) Meter Variables
-- 9C) Background Bars
-- 9D) Meter Background
-- 9E) Meter Foreground
-- 9F) Text Variables
-- 9G) Labels
-- 9H) Information Display
-- 9I) Text Background Lines
-- 9J) Border @ Top of Boxes
-- 9K) Right Semicircles
-- 9L) Left Semicircles
-- 10) Date & Time
-- 10A) Border and Title
-- 10B) Clock Background
-- 10C) Clock Numbers
-- 10D) Clock
-- 10E) Current Month Name
-- 10F) Current Month Calendar
-- 10G) Next Month Calendar
-- 10H) Next Month Name
-- 11) Ubuntu Logo
-- 12) Circlewriting
--==============================================================================================================================
-- Required
--==============================================================================================================================
require 'cairo'
--==============================================================================================================================
-- Functions
--==============================================================================================================================
-----------------------------------------------------------------
-- A) Color conversion
-----------------------------------------------------------------
local function col(c,a)
return ( (c/0x10000) % 0x100)/255,( (c/0x100) % 0x100)/255,(c % 0x100)/255,a
end--local function
-----------------------------------------------------------------
-- B) 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 ###
-----------------------------------------------------------------
-- C) 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 ###
-----------------------------------------------------------------
-- D) 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 ###
-----------------------------------------------------------------
-- E) 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)
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-- ###
-----------------------------------------------------------------
-- F) 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
-----------------------------------------------------------------
-- G) 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-------------#############################################################
--======================================================================================================================================================
--==============================================================================================================================
-- 1) Holidays
--==============================================================================================================================
xpos=10
ypos=60
-----------------------------------------------------------------
-- 1A) Border and Title
-----------------------------------------------------------------
lineout({strtx=xpos-5,enx=xpos+290,strty=ypos-17,eny=ypos-17,c=0x848484,a=1,lw=3})
lineout({strtx=xpos+289,enx=xpos+289,strty=ypos-18,eny=ypos+655,c=0x848484,a=1,lw=3})
lineout({strtx=xpos-5,enx=xpos+290,strty=ypos+656,eny=ypos+656,c=0x848484,a=1,lw=3})
out({x=xpos+5,y=ypos-21,c=0xf0f0f0,a=1,f="Augustus Beveled",fs=26,txt="Holidays"})
-----------------------------------------------------------------
-- 1B) Text Display
-----------------------------------------------------------------
hdate=tonumber(os.date("%j"))--today is daynumb 172
--mthtable day of year as number. eg:January 1st is 1, and December 31st is 366 (in 2012)
holtable={1,16,24,33,43,45,51,51,52,71,77,92,97,99,100,
113,126,134,140,148,149,149,166,169,186,204,
247,253,255,260,261,272,282,290,294,305,309,
316,327,328,331,342,360,366}
holtableb={
"01-01 Sun New Year's Day",
"01-16 Mon Martin Luther King Day",
"01-24 Tue Belly Laugh Day",
"02-02 Thu Groundhog Day",
"02-12 Sun Lincoln's Birthday",
"02-14 Tue Valentine's Day",
"02-20 Mon Presidents Day",
"02-20 Mon Washington's Birthday",
"02-21 Tue Mardi Gras Carnival",
"03-11 Sun Daylight Saving (Start)",
"03-17 Sat St- Patrick's Day",
"04-01 Sun AprilFool's Day",
"04-06 Fri Good Friday",
"04-08 Sun Easter",
"04-09 Mon Easter Monday",
"04-22 Sun Earth Day",
"05-05 Sat Cinco de Mayo",
"05-13 Sun Mother's Day",
"05-19 Sat Armed Forces Day",
"05-27 Sun Pentecost",
"05-28 Mon Memorial Day",
"05-28 Mon Pentecost Monday",
"06-14 Thu Flag Day",
"06-17 Sun Father's Day",
"07-04 Wed Independence Day",
"07-22 Sun Parents' Day",
"09-03 Mon Labor Day",
"09-09 Sun Grandparents' Day",
"09-11 Tue Patriot Day",
"09-16 Sun Stepfamily Day",
"09-17 Mon Citizenship Day",
"09-28 Fri Native American Day",
"10-08 Mon Columbus Day",
"10-16 Tue Boss's Day",
"10-20 Sat Sweetest Day",
"10-31 Wed Halloween",
"11-04 Sun Daylight Saving (End)",
"11-11 Sun Veterans' Day",
"11-22 Thu Thanksgiving",
"11-23 Fri Black Friday",
"11-26 Mon Cyber Monday",
"12-07 Fri Pearl Harbor Remembrance Day",
"12-25 Tue Christmas Day",
"12-31 Mon New Year's Eve"
}
holentries=#holtable
cairo_set_font_size (cr, 14)
cairo_select_font_face (cr, "Ubuntu Mono", CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_BOLD);
for i=1,tonumber(holentries) do
holdate=tonumber(holtable[i])
if
holdate < hdate
then
c=0x275166
elseif
holdate==hdate
then
c=0xffd700
else
c=0x75b3d1
end--if
y=ypos+((i-1)*14)
cairo_set_source_rgba (cr,col(c,1))
cairo_move_to (cr,xpos,y)
cairo_show_text (cr,holtableb[i])
cairo_stroke (cr)
end--for
--==============================================================================================================================
-- 2) SPECIAL DAYS
--==============================================================================================================================
xpos=10
ypos=795
-----------------------------------------------------------------
-- 2A) Border and Title
-----------------------------------------------------------------
lineout({strtx=xpos-5,enx=xpos+290,strty=ypos-17,eny=ypos-17,c=0x848484,a=1,lw=3})
lineout({strtx=xpos-5,enx=xpos+290,strty=ypos+218,eny=ypos+218,c=0x848484,a=1,lw=3})
lineout({strtx=xpos+289,enx=xpos+289,strty=ypos-17,eny=ypos+218,c=0x848484,a=1,lw=3})
out({x=xpos+5,y=ypos-21,c=0xf0f0f0,a=1,f="Augustus Beveled",fs=26,txt="Special Days"})
-----------------------------------------------------------------
-- 2B) Text Display
-----------------------------------------------------------------
--mthtable day of year as number. eg:January 1st is 1, and December 31st is 366 (in 2012)
specdaytable={3,6,24,48,139,177,204,224,268,290,310,313,326}
specdaytableb={
"01-03 Tue Cathy's AA Anniversary",
"01-06 Fri Nathan's Birthday",
"01-24 Tue My Birthday (1961)",
"02-17 Fri Don's Birthday (1952)",
"05-18 Fri Brittany's Graduation",
"06-25 Mon Tony's Birthday (1977)",
"07-22 Sun Tig's Birthday (1972)",
"08-11 Sat Pooh's Birthday (1970)",
"09-24 Mon Brittany's Birthday",
"10-16 Tue Cathy & Don's Anniversary",
"11-05 Mon My 2nd AA Anniversary (2010)",
"11-08 Thu Butch's Birthday (1953)",
"11-21 Wed Cathy's Birthday (1952)"
}
specdayentries=#specdaytable
cairo_set_font_size (cr, 14)
cairo_select_font_face (cr, "Ubuntu Mono", CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_BOLD);
for i=1,tonumber(specdayentries) do
specdate=tonumber(specdaytable[i])
if
specdate < hdate
then
c=0x275166
elseif
specdate==hdate
then
c=0xffd700
else
c=0x75b3d1
end--if
y=ypos+((i-1)*14)
cairo_set_source_rgba (cr,col(c,a))
cairo_move_to (cr,xpos,y)
cairo_show_text (cr,specdaytableb[i])
cairo_stroke (cr)
end--for
--==============================================================================================================================
-- 3) Schedule
--==============================================================================================================================
xpos=330
ypos=60
-----------------------------------------------------------------
-- 3A) Border and Title
-----------------------------------------------------------------
rectout({tlx=xpos-6,tly=ypos-17,rec_width=280,rec_height=212,c=0x848484,a=1,lw=3})
out({x=xpos+5,y=ypos-21,c=0xf0f0f0,a=1,f="Augustus Beveled",fs=26,txt="Schedule"})
-----------------------------------------------------------------
-- 3B) Text Display
-----------------------------------------------------------------
scheduletable={
os.capture("sed -n '1p' /home/dale/Documents/schedule.txt"),
os.capture("sed -n '2p' /home/dale/Documents/schedule.txt"),
os.capture("sed -n '3p' /home/dale/Documents/schedule.txt"),
os.capture("sed -n '4p' /home/dale/Documents/schedule.txt"),
os.capture("sed -n '5p' /home/dale/Documents/schedule.txt"),
os.capture("sed -n '6p' /home/dale/Documents/schedule.txt"),
os.capture("sed -n '7p' /home/dale/Documents/schedule.txt"),
os.capture("sed -n '8p' /home/dale/Documents/schedule.txt"),
os.capture("sed -n '9p' /home/dale/Documents/schedule.txt"),
os.capture("sed -n '10p' /home/dale/Documents/schedule.txt")
}
c=0x75b3d1
a=1
numschedlinesc=tonumber(os.capture("sed -n '$=' /home/dale/Documents/schedule.txt"))
numschedlinesb=numschedlinesc-1
scheduleentries=#scheduletable
cairo_set_font_size (cr, 14)
cairo_select_font_face (cr, "Ubuntu Mono", CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_BOLD);
cairo_set_source_rgba (cr,col(c,a))
for i=1,tonumber(scheduleentries) do
y=ypos+((i-1)*14)
cairo_move_to (cr,xpos,y)
cairo_show_text (cr,scheduletable[i])
cairo_stroke (cr)
end--for
--==============================================================================================================================
-- 4)To Do
--==============================================================================================================================
xpos=330
ypos=313
-----------------------------------------------------------------
-- 4A) Border and Title
-----------------------------------------------------------------
rectout({tlx=xpos-6,tly=ypos-17,rec_width=280,rec_height=177,c=0x848484,a=1,lw=3})
out({x=xpos+5,y=ypos-21,c=0xf0f0f0,a=1,f="Augustus Beveled",fs=26,txt="To Do"})
-----------------------------------------------------------------
-- 4B) Text Display
-----------------------------------------------------------------
todotable={os.capture("sed -n '1p' /home/dale/Documents/todo.txt"),
os.capture("sed -n '2p' /home/dale/Documents/todo.txt"),
os.capture("sed -n '3p' /home/dale/Documents/todo.txt"),
os.capture("sed -n '4p' /home/dale/Documents/todo.txt"),
os.capture("sed -n '5p' /home/dale/Documents/todo.txt"),
os.capture("sed -n '6p' /home/dale/Documents/todo.txt"),
os.capture("sed -n '7p' /home/dale/Documents/todo.txt"),
os.capture("sed -n '8p' /home/dale/Documents/todo.txt"),
os.capture("sed -n '9p' /home/dale/Documents/todo.txt"),
os.capture("sed -n '10p' /home/dale/Documents/todo.txt")
}
c=0x75b3d1
a=1
todoentries=#todotable
cairo_set_font_size (cr, 14)
cairo_select_font_face (cr, "Ubuntu Mono", CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_BOLD);
cairo_set_source_rgba (cr,col(c,a))
for i=1,tonumber(todoentries) do
y=ypos+((i-1)*14)
cairo_move_to (cr,xpos,y)
cairo_show_text (cr,todotable[i])
cairo_stroke (cr)
end--for
--==============================================================================================================================
-- 5) System Information
--==============================================================================================================================
datayadd=12 -- y=datay+(dataadd*1) use 1 or more
datax=630
dataxadd1=228
dataxadd2=497
dataxadd3=191
datay=82 -- y=datay or
datayadd2=148
dataxadd4=395
dataxadd5=535
-----------------------------------------------------------------
-- 5A) 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})
-----------------------------------------------------------------
-- 5B) Variables
-----------------------------------------------------------------
freq=conky_parse("${freq_g}")
volume=conky_parse("${mixer}")
OpSys1=os.capture("cat /etc/issue.net")
OpSys2=os.capture("sed -n '82p' /boot/config-2.6.38-15-generic | cut -c 47-51")
kernel_name=os.capture("sed -n '5p' /usr/src/linux-headers-2.6.38-15-generic/Makefile | cut -c 8-35")
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}")
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=conky_parse("${wireless_link_qual_perc wlan0}")
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")
fanspeed=os.capture("sensors | grep 'fan1' | cut -c 13-21")
uptime=conky_parse("${uptime_short}")
GPU=os.capture("sensors | grep 'temp1' | cut -c 15-21")
southbridge=os.capture("sensors | grep 'temp2' | cut -c 15-21")
systemp=os.capture("sensors | grep 'temp3' | cut -c 15-21")
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}")
-----------------------------------------------------------------
-- 5C) 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+268,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+595,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"})
-----------------------------------------------------------------
-- 5D) Text Display
-----------------------------------------------------------------
info_label={"MoBo:","Installed Memory:","HDD Size:","Architecture:","GPU:","Audio Controller:","Volume:",
"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:",
"CPU1 Temperature:","CPU2 Temperature:","CPU3 Temperature:","CPU4 Temperature:","CPU Fan Speed:",
"GPU Temp:","Southbridge Temp:","System Temp:","Total Processes:","Running Processes:",
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
info_table={"MSI Z68MA-ED55 (MS-7676)","8 GiB","320 GiB","x86_64","Integrated Sandy Bridge","Cougar Point",volume.."%",--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,fanspeed,--1st column bottom
GPU,southbridge,systemp,totproc,runproc,--2nd column bottom
topcpu1,topcpu2,topcpu3,topcpu4,topcpu5,--3rd column bottom
topmem1,topmem2,topmem3,topmem4,topmem5}--4th column bottom
info_tablex={datax+72,datax+185,datax+173,datax+175,datax+91,datax+145,datax+182,--1st column top
datax+(dataxadd1)+209,datax+(dataxadd1)+126,datax+(dataxadd1)+106,datax+(dataxadd1)+162,datax+(dataxadd1)+224,datax+(dataxadd1)+181,datax+(dataxadd1)+186,--2nd column top
datax+(dataxadd2)+109,datax+(dataxadd2)+121,datax+(dataxadd2)+117,datax+(dataxadd2)+144,datax+(dataxadd2)+154,datax+(dataxadd2)+154,datax+(dataxadd2)+146,--3rd column top
datax+140,datax+140,datax+140,datax+140,datax+123,--1st column bottom
datax+(dataxadd3)+149,datax+(dataxadd3)+149,datax+(dataxadd3)+149,datax+(dataxadd3)+157,datax+(dataxadd3)+164,--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
--==============================================================================================================================
-- 6) Guayadeque
--==============================================================================================================================
xpos=1330
ypos=39
-----------------------------------------------------------------
-- 6A) Border and Title
-----------------------------------------------------------------
rectout({tlx=xpos-9,tly=ypos+4,rec_width=279,rec_height=212,c=0x848484,a=1,lw=3})
out({x=xpos,y=ypos,c=0xf0f0f0,a=1,f="Augustus Beveled",fs=26,txt="Guayadeque"})
-----------------------------------------------------------------
-- 6B) Text Display
-----------------------------------------------------------------
rbox1=(conky_parse("${if_running guayadeque}1${else}0${endif}"))
rbox2=tonumber(rbox1)
if
rbox2==0
then
out({x=xpos+46,y=ypos+86,c=0xf0f0f0,a=1,f="Augustus Beveled",fs=26,txt="Guayadeque Is"})
out({x=xpos+45,y=ypos+121,c=0xf0f0f0,a=1,f="Augustus Beveled",fs=26,txt="Not Currently"})
out({x=xpos+81,y=ypos+156,c=0xf0f0f0,a=1,f="Augustus Beveled",fs=26,txt="Running"})
-----------------------------------------------------------------
-- 6C) Top Curlique (Not Running)
-----------------------------------------------------------------
ringout2({cx=xpos+33,cy=ypos+31,wid=3,rad=15,c=0x848484,a=1,start=155,endang=420})
ringout2({cx=xpos+227,cy=ypos+31,wid=3,rad=15,c=0x848484,a=1,start=300,endang=565})
ringout2({cx=xpos+130,cy=ypos+31,wid=3,rad=15,c=0x848484,a=1,start=0,endang=360})
lineout({strtx=xpos+39,enx=xpos+124,strty=ypos+45,eny=ypos+17,c=0x848484,a=1,lw=3})
lineout({strtx=xpos+136,enx=xpos+221,strty=ypos+17,eny=ypos+45,c=0x848484,a=1,lw=3})
-----------------------------------------------------------------
-- 6D) Bottom Curlique (Not Running)
-----------------------------------------------------------------
ringout2({cx=xpos+33,cy=ypos+191,wid=3,rad=15,c=0x848484,a=1,start=120,endang=385})
ringout2({cx=xpos+227,cy=ypos+191,wid=3,rad=15,c=0x848484,a=1,start=335,endang=240})
ringout2({cx=xpos+130,cy=ypos+191,wid=3,rad=15,c=0x848484,a=1,start=0,endang=360})
lineout({strtx=xpos+39,enx=xpos+124,strty=ypos+177,eny=ypos+205,c=0x848484,a=1,lw=3})
lineout({strtx=xpos+136,enx=xpos+221,strty=ypos+205,eny=ypos+177,c=0x848484,a=1,lw=3})
end--if
-----------------------------------------------------------------
-- 6E) Bottom Curlique (Running)
-----------------------------------------------------------------
if
rbox2==1
then
ringout2({cx=xpos+33,cy=ypos+191,wid=3,rad=15,c=0x848484,a=1,start=155,endang=420})
ringout2({cx=xpos+227,cy=ypos+191,wid=3,rad=15,c=0x848484,a=1,start=300,endang=565})
ringout2({cx=xpos+130,cy=ypos+191,wid=3,rad=15,c=0x848484,a=1,start=0,endang=360})
lineout({strtx=xpos+39,enx=xpos+124,strty=ypos+205,eny=ypos+177,c=0x848484,a=1,lw=3})
lineout({strtx=xpos+136,enx=xpos+221,strty=ypos+177,eny=ypos+205,c=0x848484,a=1,lw=3})
end--if
--==============================================================================================================================
-- 7) Sobriety
--==============================================================================================================================
xpos=1330
ypos=292
-----------------------------------------------------------------
-- 7A) Border and Title
-----------------------------------------------------------------
rectout({tlx=xpos-9,tly=ypos+4,rec_width=279,rec_height=177,c=0x848484,a=1,lw=3})
out({x=xpos,y=ypos,c=0xf0f0f0,a=1,f="Augustus Beveled",fs=26,txt="Sobriety"})
-----------------------------------------------------------------
-- 7B) Text Display
-----------------------------------------------------------------
--------------------------------------------------------------------------------------------310
weeknumber=os.date('%U')
dayasnumber=os.date('%j')
years=os.date('%Y')-2010-1
dayssober=(years*365)+dayasnumber+25+31
yearssober=math.floor(dayssober/365)
yearstodays=(yearssober*365)+1
monthssober=math.floor((dayssober-(years*365))/30.4)
monthstodays=math.floor(monthssober*30.4)
-- days=math.floor(dayssober-(yearssober*365)-(monthssober*30.4))
days=dayssober-yearstodays-monthstodays
--------------------------------------------------------------------------------------------
out({x=xpos+15,y=ypos+28,c=0x75b3d1,a=1,f="Ubuntu",fs=18,fw=CAIRO_FONT_WEIGHT_BOLD,txt="I have not had a drink since"})
out({x=xpos+75,y=ypos+48,c=0xb7b7b8,a=1,f="Ubuntu",fs=20,fw=CAIRO_FONT_WEIGHT_BOLD,txt="Nov.5,2010"})
out({x=xpos+37,y=ypos+68,c=0x75b3d1,a=1,f="Ubuntu",fs=18,fw=CAIRO_FONT_WEIGHT_BOLD,txt="I have been sober for"})
out({x=xpos+47,y=ypos+88,c=0xb7b7b8,a=1,f="Ubuntu",fs=18,fw=CAIRO_FONT_WEIGHT_BOLD,txt=years.." Yr "..monthssober.." Mths "..days.." Days"})
-- out({x=xpos+27,y=ypos+88,c=0xb7b7b8,a=1,f="Ubuntu",fs=18,fw=CAIRO_FONT_WEIGHT_BOLD,txt="1 Yr 7 Months & 29 Days"})
out({x=xpos+119,y=ypos+108,c=0x75b3d1,a=1,f="Ubuntu",fs=18,fw=CAIRO_FONT_WEIGHT_BOLD,txt="or"})
out({x=xpos+60,y=ypos+128,c=0xb7b7b8,a=1,f="Ubuntu",fs=18,fw=CAIRO_FONT_WEIGHT_BOLD,txt=dayssober.." Total Days!"})
out({x=xpos+87,y=ypos+148,c=0x75b3d1,a=1,f="Ubuntu",fs=18,fw=CAIRO_FONT_WEIGHT_BOLD,txt="But now..."})
out({x=xpos+14,y=ypos+168,c=0x00ff00,a=1,f="Ubuntu",fs=18,fw=CAIRO_FONT_WEIGHT_BOLD,txt="I'M ADDICTED TO CONKY!!!"})
out({x=xpos+22,y=ypos+123,c=0xb8b8b9,a=1,f="Ubuntu",fs=18,fw=CAIRO_FONT_WEIGHT_BOLD,txt="."})
out({x=xpos+21,y=ypos+135,c=0xb8b8b9,a=1,f="Ubuntu",fs=12,fw=CAIRO_FONT_WEIGHT_BOLD,txt="o"})
out({x=xpos+235,y=ypos+123,c=0xb8b8b9,a=1,f="Ubuntu",fs=18,fw=CAIRO_FONT_WEIGHT_BOLD,txt="."})
out({x=xpos+234,y=ypos+135,c=0xb8b8b9,a=1,f="Ubuntu",fs=12,fw=CAIRO_FONT_WEIGHT_BOLD,txt="o"})
-- out({x=xpos+14,y=ypos+198,c=0x00ff00,a=1,f="Ubuntu",fs=18,fw=CAIRO_FONT_WEIGHT_BOLD,txt=monthssober})
-- out({x=xpos+14,y=ypos+218,c=0x00ff00,a=1,f="Ubuntu",fs=18,fw=CAIRO_FONT_WEIGHT_BOLD,txt=monthstodays})
-----------------------------------------------------------------
-- 7C) Eye Blink
-----------------------------------------------------------------
ringout2({cx=xpos+13,cy=ypos+112,wid=2,rad=6,c=0xb8b8b9,a=1,start=140,endang=220})--eye blink
ringout2({cx=xpos+34,cy=ypos+112,wid=2,rad=6,c=0xb8b8b9,a=1,start=140,endang=220})--eye blink
ringout2({cx=xpos+226,cy=ypos+112,wid=2,rad=6,c=0xb8b8b9,a=1,start=140,endang=220})--eye blink
ringout2({cx=xpos+247,cy=ypos+112,wid=2,rad=6,c=0xb8b8b9,a=1,start=140,endang=220})--eye blink
ringout2({cx=xpos+24,cy=ypos+118,wid=2,rad=25,c=0xb8b8b9,a=1,start=0,endang=360})--eye blink
ringout2({cx=xpos+237,cy=ypos+118,wid=2,rad=25,c=0xb8b8b9,a=1,start=0,endang=360})--eye blink
update_num=tonumber(updates)
if update_num==nil then update_num=1 end
if (update_num % 10 == 0) then
reset_num=update_num
end--if
if reset_num==nil then reset_num=1 end
if
(reset_num >0)then
timer_num=tonumber(update_num-reset_num)
end--if
if
timer_num==3
or
timer_num==5
or
timer_num==8
or
timer_num==0
then
out({x=xpos+6,y=ypos+120,c=0x00ff00,a=1,f="Ubuntu",fs=18,fw=CAIRO_FONT_WEIGHT_BOLD,txt="O O"})
out({x=xpos+219,y=ypos+120,c=0x00ff00,a=1,f="Ubuntu",fs=18,fw=CAIRO_FONT_WEIGHT_BOLD,txt="O O"})
end--if
--==============================================================================================================================
-- 8) Ubuntu Plaque
--==============================================================================================================================
xpos=730
ypos=426
-----------------------------------------------------------------
-- 8A) Background
-----------------------------------------------------------------
lineout({strtx=xpos-21,enx=xpos+490,strty=410,eny=410,c=0x122e3d,a=1,lw=105})
-----------------------------------------------------------------
-- 8B) Frame
-----------------------------------------------------------------
rectout({tlx=xpos-24,tly=ypos-73,rec_width=514,rec_height=112,c=0xffffff,a=1,lw=2})
rectout({tlx=xpos-23,tly=ypos-72,rec_width=512,rec_height=110,c=0xf0f0f0,a=1,lw=2})
rectout({tlx=xpos-22,tly=ypos-71,rec_width=510,rec_height=108,c=0xdbdbdb,a=1,lw=2})
rectout({tlx=xpos-35,tly=ypos-84,rec_width=535,rec_height=133,c=0x848484,a=1,lw=5})
rectout({tlx=xpos-29,tly=ypos-78,rec_width=524,rec_height=121,c=0xb8b8b8,a=1,lw=5})
rectout({tlx=xpos-21,tly=ypos-70,rec_width=508,rec_height=106,c=0xb8b8b8,a=1,lw=2})
lineout({strtx=xpos-37,enx=xpos-20,strty=ypos-86,eny=ypos-69,c=0x000000,a=1,lw=0.5})
lineout({strtx=xpos-37,enx=xpos-20,strty=ypos+51,eny=ypos+34,c=0x000000,a=1,lw=0.5})
lineout({strtx=xpos+486,enx=xpos+503,strty=ypos-69,eny=ypos-86,c=0x000000,a=1,lw=0.5})
lineout({strtx=xpos+486,enx=xpos+503,strty=ypos+34,eny=ypos+51,c=0x000000,a=1,lw=0.5})
-----------------------------------------------------------------
-- 8C) Text and Accent Lines
-----------------------------------------------------------------
out({x=xpos+6,y=ypos,c=0xf0f0f0,a=1,f="Crystal",fs=50,txt="Ubuntu 10.04.4"})
lineout({strtx=xpos,enx=xpos+467,strty=ypos+7,eny=ypos+7,c=0xf0f0f0,a=1,lw=1})
lineout({strtx=xpos,enx=xpos+467,strty=ypos-43,eny=ypos-43,c=0xf0f0f0,a=1,lw=1})
--==============================================================================================================================
-- 9) Meters
--==============================================================================================================================
xpos=1647
ypos=104
-----------------------------------------------------------------
-- 9A) 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"})
-----------------------------------------------------------------
-- 9B) 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=1 end
if swap==nil then swap=1 end
if mem==nil then mem=1 end
if cpuavg==nil then cpuavg=1 end
if cpu1==nil then cpu1=1 end
if cpu2==nil then cpu2=1 end
if cpu3==nil then cpu3=1 end
if cpu4==nil then cpu4=1 end
if load1==nil then load1=1 end
if load2==nil then load2=1 end
if load3==nil then load3=1 end
if upeth==nil then upeth=1 end
if downeth==nil then downeth=1 end
if uplan==nil then uplan=1 end
if downlan==nil then downlan=1 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}
-----------------------------------------------------------------
-- 9C) 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+((i-1)*64)
cairo_move_to (cr,x,y)
cairo_line_to (cr,x+xlen,y)
cairo_stroke (cr)
end
-----------------------------------------------------------------
-- 9D) 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+((i-1)*64)
cairo_move_to (cr,x,y)
cairo_line_to (cr,x+((xlen/metertableb[i])*metertablea[i]),y)
cairo_stroke (cr)
end
-----------------------------------------------------------------
-- 9E) 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+((i-1)*64)
cairo_move_to (cr,x,y)
cairo_line_to (cr,x+((xlen/metertableb[i])*metertablea[i]),y)
cairo_stroke (cr)
end
-----------------------------------------------------------------
-- 9F) 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=conky_parse("${cpu cpu1}")
cpu2=conky_parse("${cpu cpu2}")
cpu3=conky_parse("${cpu cpu3}")
cpu4=conky_parse("${cpu cpu4}")
upeth=conky_parse("${upspeedf eth0}")
downeth=conky_parse("${downspeedf eth0}")
upwlan=conky_parse("${upspeedf wlan0}")
downwlan=conky_parse("${downspeedf wlan0}")
-----------------------------------------------------------------
-- 9G) 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=26
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 net1==1 then
out({x=xpos+155,y=ypos-90+(datayadd*12)+18,c=0x16ec16,a=1,f="Ubuntu",fs=11,txt="Connected"})
else
out({x=xpos+148,y=ypos-90+(datayadd*12)+18,c=0xf10d0d,a=1,f="Ubuntu",fs=11,txt="Not Connected"})
end--if
if net2==1 then
out({x=xpos+155,y=ypos-90+(datayadd*14)+18,c=0x16ec16,a=1,f="Ubuntu",fs=11,txt="Connected"})
else
out({x=xpos+148,y=ypos-90+(datayadd*14)+18,c=0xf10d0d,a=1,f="Ubuntu",fs=11,txt="Not Connected"})
end--if
-----------------------------------------------------------------
-- 9H) 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}")
out({x=xpos+36,y=(ypos-9),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-9)+(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-9)+(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-9)+(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-9)+(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-9)+(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-9)+(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-9)+(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-9)+(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-9)+(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-9)+(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-9)+(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-9)+(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-9)+(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-9)+(datayadd*14),c=0xb7b7b8,a=1,f="Ubuntu",fs=9,fw=CAIRO_FONT_WEIGHT_BOLD,txt="Downspeed wlan0: "..downwlan.."KiB/s"})
-----------------------------------------------------------------
-- 9I) Text Background Lines
-----------------------------------------------------------------
x=xpos+17
xlen=220
lcap=CAIRO_LINE_CAP_BUTT
lw=15
c=0x848484
a=0.25
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-11)+((i-1)*64)
cairo_move_to (cr,x,y)
cairo_line_to (cr,x+xlen,y)
cairo_stroke (cr)
end
-----------------------------------------------------------------
-- 9J) Border @ Top of Boxes
-----------------------------------------------------------------
x=xpos+17
xlen=220
lcap=CAIRO_LINE_CAP_BUTT
lw=6
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-52)+((i-1)*64)
cairo_move_to (cr,x,y)
cairo_line_to (cr,x+xlen,y)
cairo_stroke (cr)
end
-----------------------------------------------------------------
-- 9K) Left Semicircles
-----------------------------------------------------------------
-- ringout2({cx=xpos+17,cy=ypos-25,wid=10,rad=5,c=0x848484,a=1,start=180,endang=360})
-- ringout2({cx=xpos+17,cy=ypos-25+64,wid=10,rad=5,c=0x848484,a=0.5,start=180,endang=360})
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
-----------------------------------------------------------------
-- 9L) 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
--==============================================================================================================================
-- 10) Date & Time
--==============================================================================================================================
xpos=497
ypos=824
-----------------------------------------------------------------
-- 10A) Border and Title
-----------------------------------------------------------------
rectout({tlx=xpos-174,tly=ypos-194,rec_width=1278,rec_height=383,c=0x848484,a=1,lw=3})
out({x=xpos-162,y=ypos-198,c=0xf0f0f0,a=1,f="Augustus Beveled",fs=26,txt="Date and Time"})
-----------------------------------------------------------------
-- 10B) 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})
-----------------------------------------------------------------
-- 10C) Clock Numbers
-----------------------------------------------------------------
xpl=xpos-111
ypl=ypos-98
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"})
-----------------------------------------------------------------
-- 10D) 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)
-----------------------------------------------------------------
-- 10E) Current Month Name
-----------------------------------------------------------------
month=conky_parse("${time %B}")
c=0xb7b7b8
a=1
-------------------------------
font="Augustus Beveled";font_size=44;text=month;x=xpos+273;y=ypos-119;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)
-----------------------------------------------------------------
-- 10F) 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+168.5
down=ypos-58.5
--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=0
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
--###################################################
-----------------------------------------------------------------
-- 10G) 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 this 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==6 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=tonumber(os.date("%m"))+1
dispmonth=month
if
dispmonth==7
then
start_day=7
elseif
dispmonth==8
then
start_day=3
elseif
dispmonth==9
then
start_day=6
elseif
dispmonth==10
then
start_day=1
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=0
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
--###################################################
-----------------------------------------------------------------
-- 10H) Next Month Name
-----------------------------------------------------------------
xstart=xpos+491
ystart=ypos-58.5
yadd=35
newmnth=tonumber(os.date("%m"))--current month number
if newmnth==06 then
out({x=xstart+95,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+62,y=ystart-61,c=0xb8b8b9,a=1,f="Augustus Beveled",fs=44,txt="November"})
else
out({x=xstart+68,y=ystart-61,c=0xb8b8b9,a=1,f="Augustus Beveled",fs=44,txt="December"})
end--if
--==============================================================================================================================
-- 11) Ubuntu Logo
--==============================================================================================================================
x=xpos+931
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
--==============================================================================================================================
-- 12) 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')
--[[if
hdate<10
then
ystart=240
else
ystart=235
end
if
hdate<10
then
yend=145
else
yend=140
end]]
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+931
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+930
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 DISPLAY AREA-----------#############################################################
--======================================================================================================================================================
end-- if updates>5
cairo_destroy(cr)
cairo_surface_destroy(cs)
cr=nil
end-- end main function
fortune_rc:
Code:
--Script by mrpeachy
--Template by stylintile
--Based on template by Sector11
--os.capture by dk75
--Last modification 06-03-12 by stylintile
--[[
The latest script is a lua only weather script. aka: v9000
http://crunchbanglinux.org/forums/topic/16100/weather-in-conky/
the file:
http://dl.dropbox.com/u/19008369/v9000.tar.gz
mrppeachys LUA Tutorial
http://crunchbanglinux.org/forums/topic/17246/how-to-using-lua-scripts-in-conky/
]]
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
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)
local function col(c,a)
return ( (c/0x10000) % 0x100)/255,( (c/0x100) % 0x100)/255,(c % 0x100)/255,a
end--local function
---------------------------------------
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 ###################################################################
_G.weather_script = function()--#### DO NOT EDIT THIS LINE ##############
--these tables hold the coordinates for each repeat do not edit #########
top_left_x_coordinate={}--###############################################
top_left_y_coordinate={}--###############################################
--#######################################################################
--SET DEFAULTS ##########################################################
--set defaults do not localise these defaults if you use a seperate display script
default_font="Anonymous Pro:bold"--font must be in quotes
default_font_size=11
default_color=0xffffff--white
default_alpha=1--fully opaque
default_image_width=50
default_image_height=50
--END OF DEFAULTS #######################################################
--START OF WEATHER CODE -- START OF WEATHER CODE -- START OF WEATHER CODE
out({c=0x75b3d1,a=1,f="Augustus Beveled",fs=36,x=60,y=90,txt="Weather for Loganville Georgia"})-- "..weather_location})
out({c=0x75b3d1,a=1,f="Anonymous Pro",fs=36,x=445,y=93,txt=","})-- "..weather_location})
out({c=0xffd700,a=1,f="Anonymous Pro:bold",fs=11,x=705,y=815,txt=now["date"].." "..now["month_short"].." "..now["year"]..": Fetched @ "..now["time"]})
image({x=90,y=165,h=60,w=60,file=now["weather_icon"]})
image({x=310,y=165,w=60,h=60,file=now["wind_icon"]})
image({x=200,y=167,h=55,w=55,file=moon_icon[1]})
-- Temp / FeelsLike & CONDITIONS TEXT
out({c=0xffd700,a=1,f="Digital-7",fs=50,x=146,y=337,txt=now["temp"]})
out({c=0xffd700,a=1,f="Digital-7",fs=50,x=261,y=337,txt=now["feels_like"]})
out({c=0x75b3d1,a=1,f="Anonymous Pro:bold",fs=11,x=151,y=290,txt="Temp:"})
out({c=0x75b3d1,a=1,f="Anonymous Pro:bold",fs=11,x=256,y=290,txt="Feels Like:"})
out({c=0x75b3d1,a=1,f="Anonymous Pro:bold",fs=22,x=60,y=260,txt=now["conditions"]})
out({c=0xffd700,a=1,f="Anonymous Pro:bold",fs=36,x=195,y=150,txt="Now"})
-- data titles
-- data output
datay=360 -- y=datay or
dataadd=14 -- y=datay+(dataadd*1) use 1 or more
out({c=0x75b3d1,a=1,f="Anonymous Pro:bold",fs=11,x=95,y=datay,txt="Heat Index:"})
out({c=0xe5e5e5,a=1,f="Anonymous Pro:bold",fs=11,x=175,y=datay,txt=now["heat_index"].."°"})
out({c=0x75b3d1,a=1,f="Anonymous Pro:bold",fs=11,x=95,y=datay+(dataadd*1),txt="Dew Point:"})
out({c=0xe5e5e5,a=1,f="Anonymous Pro:bold",fs=11,x=175,y=datay+(dataadd*1),txt=now["dew_point"].."°"})
out({c=0x75b3d1,a=1,f="Anonymous Pro:bold",fs=11,x=95,y=datay+(dataadd*2),txt="Wind Chill:"})
out({c=0xe5e5e5,a=1,f="Anonymous Pro:bold",fs=11,x=175,y=datay+(dataadd*2),txt=now["wind_chill"].."°"})
out({c=0x75b3d1,a=1,f="Anonymous Pro:bold",fs=11,x=255,y=datay,txt="Barometer:"})
out({c=0xe5e5e5,a=1,f="Anonymous Pro:bold",fs=11,x=335,y=datay,txt=now["pressure_mb"].." in"})
out({c=0x75b3d1,a=1,f="Anonymous Pro:bold",fs=11,x=255,y=datay+(dataadd*1),txt="Ceiling:"})
out({c=0xe5e5e5,a=1,f="Anonymous Pro:bold",fs=11,x=335,y=datay+(dataadd*1),txt=now["ceiling"]})
out({c=0x75b3d1,a=1,f="Anonymous Pro:bold",fs=11,x=255,y=datay+(dataadd*2),txt="Visibility:"})
out({c=0xe5e5e5,a=1,f="Anonymous Pro:bold",fs=11,x=335,y=datay+(dataadd*2),txt=now["visibility"]})
out({c=0x75b3d1,a=1,f="Anonymous Pro:bold",fs=11,x=95,y=datay+(dataadd*4),txt="Weather Alerts:"})
out({c=0xe5e5e5,a=1,f="Anonymous Pro:bold",fs=11,x=195,y=datay+(dataadd*4),txt=alert_number})
out({c=0x75b3d1,a=1,f="Anonymous Pro:bold",fs=11,x=95,y=datay+(dataadd*5),txt="Alert Type:"})
out({c=0xe5e5e5,a=1,f="Anonymous Pro:bold",fs=11,x=195,y=datay+(dataadd*5),txt=alert_type[1]})
--
out({c=0x75b3d1,a=1,f="Anonymous Pro:bold",fs=11,x=95,y=datay+(dataadd*6),txt="Alert Issued @:"})
out({c=0xe5e5e5,a=1,f="Anonymous Pro:bold",fs=11,x=195,y=datay+(dataadd*6),txt=alert_issued[1]})
----------------------
-- Pollen Count-------
----------------------
datay=30 -- y=datay or
dataadd=14 -- y=datay+(dataadd*1) use 1 or more
VAR2 = os.capture("cat /home/dale/test/test1 | grep 'out of 12' | cut -d'>' -f2 | cut -d'<' -f1")
VAR3 = os.capture("cat /home/dale/test/test3 | grep 'Pollen Type' | cut -c 39-")
out({c=0x75b3d1,a=1,f="Anonymous Pro:bold",fs=16,x=1150,y=datay,txt="Pollen Index"})
out({c=0x75b3d1,a=1,f="Anonymous Pro:bold",fs=11,x=1160,y=datay+(dataadd*1),txt="Low:"})
out({c=0x75b3d1,a=1,f="Anonymous Pro:bold",fs=11,x=1240,y=datay+(dataadd*1),txt="0.00-2.40"})
out({c=0x75b3d1,a=1,f="Anonymous Pro:bold",fs=11,x=1160,y=datay+(dataadd*2),txt="Low/Medium:"})
out({c=0x75b3d1,a=1,f="Anonymous Pro:bold",fs=11,x=1240,y=datay+(dataadd*2),txt="2.50-4.80"})
out({c=0x75b3d1,a=1,f="Anonymous Pro:bold",fs=11,x=1160,y=datay+(dataadd*3),txt="Medium:"})
out({c=0x75b3d1,a=1,f="Anonymous Pro:bold",fs=11,x=1240,y=datay+(dataadd*3),txt="4.90-7.20"})
out({c=0x75b3d1,a=1,f="Anonymous Pro:bold",fs=11,x=1160,y=datay+(dataadd*4),txt="Medium/High:"})
out({c=0x75b3d1,a=1,f="Anonymous Pro:bold",fs=11,x=1240,y=datay+(dataadd*4),txt="7.30-9.60"})
out({c=0x75b3d1,a=1,f="Anonymous Pro:bold",fs=11,x=1160,y=datay+(dataadd*5),txt="High:"})
out({c=0x75b3d1,a=1,f="Anonymous Pro:bold",fs=11,x=1240,y=datay+(dataadd*5),txt="9.70-12.0"})
out({c=0x75b3d1,a=1,f="Anonymous Pro:bold",fs=16,x=1320,y=datay,txt="Pollen Count"})
out({c=0x75b3d1,a=1,f="Anonymous Pro:bold",fs=16,x=1320,y=datay+(dataadd*3),txt="Pollen Type(s)"})
out({c=0xe5e5e5,a=1,f="Anonymous Pro:bold",fs=11,x=1330,y=datay+(dataadd*1),txt=VAR2})
out({c=0xe5e5e5,a=1,f="Anonymous Pro:bold",fs=11,x=1330,y=datay+(dataadd*4),txt=VAR3})
out({c=0xffd700,a=1,f="Anonymous Pro:bold",fs=22,x=195,y=596,txt="Today"})
-- lines
lineout({strtx=431,enx=431,strty=110,eny=800,c=0x848484,a=1,lw=2})
lineout({strtx=46,enx=46,strty=110,eny=800,c=0x848484,a=1,lw=2})
lineout({strtx=45,enx=432,strty=110,eny=110,c=0x848484,a=1,lw=2})
lineout({strtx=45,enx=432,strty=570,eny=570,c=0x848484,a=1,lw=2})
lineout({strtx=45,enx=432,strty=800,eny=800,c=0x848484,a=1,lw=2})
lineout({strtx=75,enx=400,strty=459,eny=459,c=0x848484,a=1,lw=1})
lineout({strtx=805,enx=805,strty=110,eny=800,c=0x848484,a=1,lw=1})
lineout({strtx=1180,enx=1180,strty=110,eny=800,c=0x848484,a=1,lw=1})
lineout({strtx=1555,enx=1555,strty=110,eny=800,c=0x848484,a=1,lw=1})
lineout({strtx=430,enx=1555,strty=110,eny=110,c=0x848484,a=1,lw=1})
lineout({strtx=430,enx=1555,strty=335,eny=335,c=0x848484,a=1,lw=1})
lineout({strtx=430,enx=1555,strty=570,eny=570,c=0x848484,a=1,lw=1})
lineout({strtx=430,enx=1555,strty=800,eny=800,c=0x848484,a=1,lw=1})
--=================================================================
--Taskbar
--=================================================================
mail=os.capture("python /home/dale/scripts/gmail_parser.py username password 3")
curtime=os.date('%H:%M')
curdate=os.date('%b %e, %Y')
RAM=conky_parse("${memperc}")
CPU=conky_parse("${cpu cpu0}")
--Taskbar=================================================================
lineout({strtx=0,enx=1600,strty=860,eny=860,c=0x5c8ca4,a=1,lw=30})
lineout({strtx=0,enx=1600,strty=860,eny=860,c=0x679eb9,a=1,lw=27})
lineout({strtx=0,enx=1600,strty=860,eny=860,c=0x75b3d1,a=1,lw=24})
lineout({strtx=0,enx=1600,strty=860,eny=860,c=0x89d2f5,a=1,lw=21})
lineout({strtx=0,enx=1600,strty=860,eny=860,c=0x8fdaff,a=1,lw=18})
lineout({strtx=0,enx=1600,strty=860,eny=860,c=0xb9e7fe,a=1,lw=15})
--=================================================================89d2f5 8fdaff b9e7fe 679eb9 5c8ca4
out({c=0x1f4066,a=1,f="Ubuntu:bold",fs=18,x=920,y=866,txt=mail})
out({c=0x1f4066,a=1,f="Pocket Calculator",fs=32,x=1020,y=870,txt="RAM "..RAM.." %"})
out({c=0x1f4066,a=1,f="Pocket Calculator",fs=32,x=1160,y=870,txt="CPU "..CPU.." %"})
out({c=0x1f4066,a=1,f="Pocket Calculator",fs=34,x=1490,y=871,txt=curtime})
out({c=0x1f4066,a=1,f="Pocket Calculator",fs=32,x=1310,y=870,txt=curdate})
--=================================================================
image({x=870,y=848,w=40,h=25,file="/home/dale/Pictures/Mail2.png"})
--os.date %H:%M
--${time %b %e, %Y} ${voffset -1}${font Pocket Calculator:size=26}${time %H:%M}
-- 3 hour output
-- 1st hour
out({c=0x75b3d1,x=120,y=485,txt=now["fc_hour1_time"].." "..now["fc_hour1_ampm"]})
image({w=40,h=40,x=120,y=495,file=now["fc_hour1_wicon"]})
out({x=130,y=555,txt=now["fc_hour1_temp"] .."°"})
-- 2nd hour
out({c=0x75b3d1,x=210,y=485,txt=now["fc_hour2_time"].." "..now["fc_hour2_ampm"]})
image({w=40,h=40,x=210,y=495,file=now["fc_hour2_wicon"]})
out({x=220,y=555,txt=now["fc_hour2_temp"] .."°"})
-- 3rd hour
out({c=0x75b3d1,x=300,y=485,txt=now["fc_hour3_time"].." "..now["fc_hour3_ampm"]})
image({w=40,h=40,x=300,y=495,file=now["fc_hour3_wicon"]})
out({x=310,y=555,txt=now["fc_hour3_temp"] .."°"})
-- line
--start or weather forecast table section
--set start forecast day
start_day=1
--set total forecast days you want to display
number_of_days=10
topy=150
topyy=235 -- topy+(topyy*1)
topx=60
topxx=375
--set coordinates for top lef corners for each repeat
top_left_x_coordinate[1],top_left_y_coordinate[1] =topx ,topy+(topyy*2)
top_left_x_coordinate[2],top_left_y_coordinate[2] =topx+(topxx*1) ,topy
top_left_x_coordinate[3],top_left_y_coordinate[3] =topx+(topxx*2) ,topy
top_left_x_coordinate[4],top_left_y_coordinate[4] =topx+(topxx*3) ,topy
top_left_x_coordinate[5],top_left_y_coordinate[5] =topx+(topxx*1) ,topy+(topyy*1)
top_left_x_coordinate[6],top_left_y_coordinate[6] =topx+(topxx*2) ,topy+(topyy*1)
top_left_x_coordinate[7],top_left_y_coordinate[7] =topx+(topxx*3) ,topy+(topyy*1)
top_left_x_coordinate[8],top_left_y_coordinate[8] =topx+(topxx*1) ,topy+(topyy*2)
top_left_x_coordinate[9],top_left_y_coordinate[9] =topx+(topxx*2) ,topy+(topyy*2)
top_left_x_coordinate[10],top_left_y_coordinate[10] =topx+(topxx*3) ,topy+(topyy*2)
--########################################################################################
for i=start_day,number_of_days-(start_day-1) do --start of day repeat, do not edit #######
tlx=top_left_x_coordinate[i] --sets top left x position for each repeat ##################
tly=top_left_y_coordinate[i] --sets top left y position for each repeat ##################
--########################################################################################
out({c=0x75b3d1,a=1,f="Anonymous Pro:bold",fs=20,x=tlx+15,y=tly,txt=forecast_day[i].." "..forecast_month_short[i].." "..forecast_date[i]})
out({c=0xe5e5e5,a=1,f="Anonymous Pro:bold",fs=15,x=tlx+15,y=tly+22,txt=conditions_short[i]})
image({x=tlx+227,y=tly+25,h=50,w=50,file=weather_icon[i]})
image({x=tlx+297,y=tly+27,h=45,w=45,file=moon_icon[i]})
out({c=0x75b3d1,a=1,f="Anonymous Pro:bold",fs=14,x=tlx+15,y=tly+45,txt="HIGH:"})
out({c=0xffd700,a=1,f="Digital-7",fs=20,x=tlx+60,y=tly+45,txt=high_temp[i]})
out({c=0x75b3d1,a=1,f="Anonymous Pro:bold",fs=14,x=tlx+15,y=tly+68,txt="LOW:"})
out({c=0x00BFFF,a=1,f="Digital-7",fs=20,x=tlx+60,y=tly+68,txt=low_temp[i]})
out({c=0x75b3d1,a=1,f="Anonymous Pro:bold",fs=11,x=tlx+15,y=tly+90,txt="Precipitation:"})
out({c=0xe5e5e5,a=1,f="Anonymous Pro:bold",fs=11,x=tlx+100,y=tly+90,txt=precipitation[i].."%"})
out({c=0x75b3d1,a=1,f="Anonymous Pro:bold",fs=11,x=tlx+15,y=tly+105,txt="Humidity:"})
out({c=0xe5e5e5,a=1,f="Anonymous Pro:bold",fs=11,x=tlx+100,y=tly+105,txt=humidity[i].."%"})
out({c=0x75b3d1,a=1,f="Anonymous Pro:bold",fs=11,x=tlx+15,y=tly+120,txt="Wind Speed:"})
out({c=0xe5e5e5,a=1,f="Anonymous Pro:bold",fs=11,x=tlx+100,y=tly+120,txt=wind_mph[i].." mph"})
out({c=0x75b3d1,a=1,f="Anonymous Pro:bold",fs=11,x=tlx+15,y=tly+135,txt="Cloud Cover:"})
out({c=0xe5e5e5,a=1,f="Anonymous Pro:bold",fs=11,x=tlx+100,y=tly+135,txt=cloud_cover[i].." %"})
out({c=0x75b3d1,a=1,f="Anonymous Pro:bold",fs=11,x=tlx+15,y=tly+150,txt="UV Index:"})
out({c=0xe5e5e5,a=1,f="Anonymous Pro:bold",fs=11,x=tlx+100,y=tly+150,txt=uv_index_num[i].." "..uv_index_txt[i]})
out({c=0x75b3d1,a=1,f="Anonymous Pro:bold",fs=14,x=tlx+237,y=tly+15,txt="Sun:"})
out({c=0x75b3d1,a=1,f="Anonymous Pro:bold",fs=11,x=tlx+185,y=tly+95,txt="Rise:"})
out({c=0xe5e5e5,a=1,f="Anonymous Pro:bold",fs=11,x=tlx+225,y=tly+95,txt=sun_rise[i]})
out({c=0x75b3d1,a=1,f="Anonymous Pro:bold",fs=11,x=tlx+185,y=tly+110,txt="Set:"})
out({c=0xe5e5e5,a=1,f="Anonymous Pro:bold",fs=11,x=tlx+225,y=tly+110,txt=sun_set[i]})
out({c=0x75b3d1,a=1,f="Anonymous Pro:bold",fs=14,x=tlx+298,y=tly+15,txt="Moon:"})
out({c=0xe5e5e5,a=1,f="Anonymous Pro:bold",fs=11,x=tlx+295,y=tly+95,txt=moon_rise[i]})
out({c=0xe5e5e5,a=1,f="Anonymous Pro:bold",fs=11,x=tlx+295,y=tly+110,txt=moon_set[i]})
out({c=0x75b3d1,a=1,f="Anonymous Pro:bold",fs=14,x=tlx+235,y=tly+133,txt="Moon Phase:"})
out({c=0xe5e5e5,a=1,f="Anonymous Pro:bold",fs=14,x=tlx+220,y=tly+150,txt=moon_phase[i]})
--########################################################################################
end--of forecast repeat section ##########################################################
--########################################################################################
--END OF WEATHER CODE ----END OF WEATHER CODE ----END OF WEATHER CODE ---
--#######################################################################
end--of weather_display function do not edit this line ##################
--#######################################################################
The rest of the weather files and gmail scripts did not change from my earlier post, so I didn't include them, and the files for guayadeque music player are at the link in my earlier post (Awesome player, by the way).
Bookmarks