SEARCH

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

You are not logged in.

#2051 2011-03-27 03:37:13

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

Re: My Conky Config

dogmatictea wrote:

Sorry to bring up an old post. I just thought it should be known that I'm fooling around with this script to better place all my times (on a completely different wallpaper and using ${hr} instead of meters) I am having a bit of trouble with a clean way to use a different timezone in LUA. I have the tz code for honolulu in conky, I just don't know how it'll transfer over into LUA.

if you could get the right time in conky then you can get the right time in lau using the conky_parse command

mytime=conky_parse("${conky commands as you would use them in the conkyrc}")

it might be a good idea to split the commands up, so one string is minutes, another is hours etc

im sure there is a lua native way of doing it, but the above should work

Offline

Help fund CrunchBang, donate to the project!

#2052 2011-03-27 04:17:23

dogmatictea
Member
From: South Korea
Registered: 2011-03-04
Posts: 12

Re: My Conky Config

Thank you, Mr. Peachy. You're the best. I ended up figuring out that I had a tiny error in my conky_parse. The reason I say thank you is because I would have never done this without the help of the RGB slanted graph. I still have the mayan calendar, but I'll pull it out late 2012.


th_Screenshot-2-1.png


--Doesn't matter how you comment
##Just make it count.

Offline

#2053 2011-03-27 04:32:14

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

Re: My Conky Config

@dogmatictea you are very welcome smile

Offline

#2054 2011-03-27 10:16:31

wlourf
#! CrunchBanger
Registered: 2010-02-13
Posts: 153
Website

Re: My Conky Config

mrpeachy wrote:

it might be a good idea to split the commands up, so one string is minutes, another is hours etc

im sure there is a lua native way of doing it, but the above should work

Hi MrPeachy,

Something like this :

os.date("%d %b"), --conky_parse("${time %d %b}"),
os.date("%H"),   --conky_parse("${time %H}"),

works fine smile

Offline

#2055 2011-03-27 16:27:52

Sector11
77345 ¡#
From: SR11 Cockpit
Registered: 2010-05-05
Posts: 13,409
Website

Re: My Conky Config

gkokaisel wrote:
Sector11 wrote:

Ask if you want something.

Awesome. Mind sharing your tint2 config?

Conky thread?  tint2? 

Sure why not, it's waiting for you in the My tint2 config thread.  big_smile
Heed the warning though.

Offline

#2056 2011-03-27 16:48:51

Sector11
77345 ¡#
From: SR11 Cockpit
Registered: 2010-05-05
Posts: 13,409
Website

Re: My Conky Config

Jojan wrote:

Here is my conky configuration for my laptop.

Screenshot:

Screenshot: not working but I had to see that calendar in action:
thmb_2011-1-jojan-1.png

NICE!  I love the simplistic beauty of it.  And that calendar is a fine piece of work (great).

My guess is that "vecka" is week in Swedish.

I don't have a battery so I canged the last few lines:

#BAT:${tab}${battery_percent BAT0}%
#${battery_bar 3,240 BAT0}
BAT:${tab}none%
${cpubar cpu0 3,240}

and all references to CPU have been changed to cpu0 as I only have one.

Another nice touch, your conky is the first I have seen using ${tab}

tab     (width, (start))
     Puts a tab of the specified width, starting from column 'start'. The unit is pixels for both arguments.

Looks like you found an undocumented feature, it "seems" from your conky that ${tab} has default setting not documented:

${tab 10, x}

x being the last conky ${command output}

which is really something nice to know!  I have to play with that now.

Thanks.

Offline

#2057 2011-03-27 19:58:23

jeffreyC
#! Die Hard
Registered: 2010-09-02
Posts: 596

Re: My Conky Config

In the 2.6.36 series kernels and earlier acpitemp is used for cpu temperature in conky, in 2.6.37 kernels and maybe later hwmon is used, would there be a simple way to have one conkyrc that could read either ?


There's a reason you separate military and the police. One fights the enemies of the state, the other serves and protects the people. When the military becomes both, then the enemies of the state tend to become the people.

Offline

#2058 2011-03-28 12:08:20

Jojan
Member
From: Sweden
Registered: 2011-03-26
Posts: 19

Re: My Conky Config

Sector11 wrote:
Jojan wrote:

Here is my conky configuration for my laptop.

Screenshot:

Screenshot: not working but I had to see that calendar in action:
thmb_2011-1-jojan-1.png

Ah, it works just fine for me. :-\ Strange. Can you it when you click the link? http://img859.imageshack.us/img859/7016/myconky.png

Sector11 wrote:

NICE!  I love the simplistic beauty of it.  And that calendar is a fine piece of work (great).

My guess is that "vecka" is week in Swedish.

I like simplistic beauty, it is sort of the reason why I enjoy GNU/Linux. And yes, "vecka" is "week".

Sector11 wrote:

Thanks.

You're welcome. Glad someone else can make use of it.

I noticed an error in the calendar script. On my Ubuntu machine:

:~$ cal | head -n 2 | tail -n 1
må ti on to fr lö sö

However, in #! it returns

:~$ cal | head -n 2 | tail -n 1
sö må ti on to fr lö

And weeks should start with Monday (må as in måndag), so a simple fix is to hard code the days instead of calling cal. If someone knows how to fix so that I get Monday first in cal, that would be very much appreciated. When I Google for it I get alot of old solutions saying that -m flag will fix it, but it does not do that any more.

Offline

#2059 2011-03-28 12:55:58

Sector11
77345 ¡#
From: SR11 Cockpit
Registered: 2010-05-05
Posts: 13,409
Website

Re: My Conky Config

Jojan wrote:

And weeks should start with Monday (må as in måndag), so a simple fix is to hard code the days instead of calling cal. If someone knows how to fix so that I get Monday first in cal, that would be very much appreciated. When I Google for it I get alot of old solutions saying that -m flag will fix it, but it does not do that any more.

More later, I have to run, but have a look at this: Two line Calendar

Also if I can do this to get Spanish months - I'm certain you can do the same for days:

TEXT
${color6}${goto 13}${if_match "${time %b}"=="Jan"}ene${else}\
${if_match "${time %b}"=="Feb"}feb${else}\
${if_match "${time %b}"=="Mar"}mar${else}\
${if_match "${time %b}"=="Apr"}abr${else}\
${if_match "${time %b}"=="May"}may${else}\
${if_match "${time %b}"=="Jun"}jun${else}\
${if_match "${time %b}"=="Jul"}jul${else}\
${if_match "${time %b}"=="Aug"}aug${else}\
${if_match "${time %b}"=="Sep"}sep${else}\
${if_match "${time %b}"=="Oct"}oct${else}\
${if_match "${time %b}"=="Nov"}nov${else}\
${if_match "${time %b}"=="Dec"}dec$\
{endif}${endif}${endif}${endif}${endif}${endif}${endif}${endif}${endif}${endif}${endif}${endif}${color}
${execpi 86400 ~/Conky/scripts/conkycal-1.sh -vl es|sed 's/^/\${goto 5}/'}

The \ means what follows is on the same line

Last edited by Sector11 (2011-03-28 17:37:23)

Offline

#2060 2011-03-28 17:39:03

Jojan
Member
From: Sweden
Registered: 2011-03-26
Posts: 19

Re: My Conky Config

Sector11 wrote:
Jojan wrote:

And weeks should start with Monday (må as in måndag), so a simple fix is to hard code the days instead of calling cal. If someone knows how to fix so that I get Monday first in cal, that would be very much appreciated. When I Google for it I get alot of old solutions saying that -m flag will fix it, but it does not do that any more.

More later, I have to run, but have a look at this: Two line Calendar

That did solve anything. It just said that cal -m does not longer work but ncal -M does. Also, I just want three weeks, previous, this and next week.

Sector11 wrote:

Also if I can do this to get Spanish months - I'm certain you can do the same for days:

[...]

The \ means what follows is on thew same line

The names of the days does not change, so just having to put them as constants does not hurt.

Offline

#2061 2011-03-28 18:06:26

Sector11
77345 ¡#
From: SR11 Cockpit
Registered: 2010-05-05
Posts: 13,409
Website

Re: My Conky Config

Jojan wrote:
Sector11 wrote:
Jojan wrote:

And weeks should start with Monday (må as in måndag), so a simple fix is to hard code the days instead of calling cal. If someone knows how to fix so that I get Monday first in cal, that would be very much appreciated. When I Google for it I get alot of old solutions saying that -m flag will fix it, but it does not do that any more.

More later, I have to run, but have a look at this: Two line Calendar

That didn't solve anything. It just said that cal -m does not longer work but ncal -M does. Also, I just want three weeks, previous, this and next week.

That's what I really like about your calendar.  three weeks always ... Very nice.

I realize it wasn't an answer for your problem , I was just pointing out a calendar with day names separated and other options.  Sorry for the confusion.

Jojan wrote:
Sector11 wrote:

Also if I can do this to get Spanish months - I'm certain you can do the same for days:

[...]

The \ means what follows is on thew same line

The names of the days does not change, so just having to put them as constants does not hurt.

It didn't dawn on me that your system will output day names in Swedish (duh! roll )

I wonder if a bash or python script could output a calendar starting on Monday.
Hmmmmm ...

Offline

#2062 2011-03-28 19:35:25

Tunafish
#! Die Hard
From: the Netherlands
Registered: 2010-03-07
Posts: 1,204

Re: My Conky Config

Jojan wrote:

And weeks should start with Monday (må as in måndag), so a simple fix is to hard code the days instead of calling cal. If someone knows how to fix so that I get Monday first in cal, that would be very much appreciated. When I Google for it I get alot of old solutions saying that -m flag will fix it, but it does not do that any more.

In older versions of cal (less than a year ago) the -m flag was working. I've seen bug reports about this issue, but it's not solved yet.

Tuna.


sed 's/stress/relaxation/g'
Privacy & Security on #!

Offline

#2063 2011-03-29 04:35:43

gkokaisel
New Member
Registered: 2011-03-20
Posts: 4

Re: My Conky Config

Sector11 wrote:
gkokaisel wrote:
Sector11 wrote:

Ask if you want something.

Awesome. Mind sharing your tint2 config?

Conky thread?  tint2? 

Sure why not, it's waiting for you in the My tint2 config thread.  big_smile
Heed the warning though.

Thanks! It worked brilliantly. Just a little color tweaking was all I needed to do.

Offline

#2064 2011-03-29 13:42:33

Sector11
77345 ¡#
From: SR11 Cockpit
Registered: 2010-05-05
Posts: 13,409
Website

Re: My Conky Config

gkokaisel wrote:

Thanks! It worked brilliantly. Just a little color tweaking was all I needed to do.

Glad to help.

Offline

#2065 2011-03-29 18:30:02

Jojan
Member
From: Sweden
Registered: 2011-03-26
Posts: 19

Re: My Conky Config

Jojan wrote:

Here is my conky configuration for my laptop.

Screenshot:
myconky.png

~/,conkyrc

##############################################
#  Settings
##############################################
background yes
use_xft yes
xftfont courier:size=10
xftalpha 1
update_interval 2.0
total_run_times 0
own_window yes
own_window_transparent yes
own_window_type desktop
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
double_buffer yes
minimum_size 200 200
maximum_width 500
draw_shades no
draw_outline no
draw_borders no
draw_graph_borders no
default_color d8d8d8
default_shade_color 000000
default_outline_color d9d7d6
alignment top_right
gap_x 20
gap_y 50
no_buffers yes
uppercase no
cpu_avg_samples 2
override_utf8_locale yes
##############################################
#  Output
##############################################
TEXT
${offset 10}${font openlogos:size=50 } U J t${font}
${alignc}${execi 86400 cat /etc/issue.net}
${alignc}${kernel}

${execpi 7200 /home/jojan/.src/vecka.bash}

MEM:${tab}${memperc}% av ${memmax}
${membar 3,240}

SWP:${tab}${swapperc}% av ${swapmax}
${swapbar 3,240}

HDD:${tab}
/${tab}${tab}${tab}${tab}${tab} ${fs_used_perc /}% av ${fs_size /}.
${fs_bar 3,240 /}
/home${tab} ${fs_used_perc /home}% av ${fs_size /home}.
${fs_bar 3,240 /home}

CPU:${tab}${cpu cpu0}% av ${freq_g cpu0}GHz
${cpubar 3,240 CPU0}
${voffset -5}${cpubar 3,116 CPU1} ${cpubar 3,116 CPU2}

BAT:${tab}${battery_percent BAT0}%
${battery_bar 3,240 BAT0}

And this is the script I use for the small calendar:

#!/bin/bash
SAVEFILE="/home/jojan/.src/vecka"
YEAR=$(date +%Y)
TODAY=$(date +%d)
THISWEEK=$(date +%V)

echo "  $(date +%b)  $(cal | head -n 2 | tail -n 1)"
cat $SAVEFILE | grep -A 1 -B 1 "v$THISWEEK"     | sed "s/ $TODAY/ "'${color red}'"$TODAY"'${color}'"/"
echo -n '${font}'

where

:~$ head .src/vecka
  v05  31 01 02 03 04 05 06
  v06  07 08 09 10 11 12 13
  v07  14 15 16 17 18 19 20
  v08  21 22 23 24 25 26 27
  v09  28 01 02 03 04 05 06
  v10  07 08 09 10 11 12 13
  v11  14 15 16 17 18 19 20
  v12  21 22 23 24 25 26 27
  v13  28 29 30 31 01 02 03
  v14  04 05 06 07 08 09 10
:~$

I forgot something. Here is the code I use to generate my "vecka" file. It used to be alot uglier before I notcied that you could use the -d flag to date.

#!/bin/bash

# Give year as argument.
if [ -z $1 ]; then
    YEAR=$(date +%Y)
else
    YEAR=$1
fi

################################################################################
# Is is leap year?
if [ $(expr $YEAR % 4 == 0) == 1 ] && [ $(expr $YEAR % 100 != 0) == 1 ] || \
   [ $(expr $YEAR % 400 == 0) == 1 ]; then
    FEB=29
else
    FEB=28
fi

################################################################################
SW="01"  # Starting week
SD="0"   # Starting day
while [ "$SW" != "02" ]; do
    SD=$(( $SD + 1 ))
    SW=$(date +%V -d "$SD JAN $YEAR 00:00:00")
done

if [ $SD -gt 7 ]; then
    SD=$(( $SD - 7 ))
    SW="01"
fi

################################################################################
EW="52"  # Ending week
ED="32"  # Ending day
while [ "$EW" != "51" ]; do
    ED=$(( $ED - 1 ))
    EW=$(date +%V -d "$ED DEC $YEAR 00:00:00")
done

if [ $ED -lt 25 ]; then
    ED=$(( $ED + 7 ))
    EW="52"
fi

################################################################################
# January
for i in $(seq -w $SD 31); do
    SEQ=$(echo "$SEQ $i")
done

# Other months
for M in $FEB 31 30 31 30 31 31 30 31 30; do
    for i in $(seq -w 1 $M); do
        SEQ=$(echo "$SEQ $i")
    done
done

# December
for i in $(seq -w 1 $ED); do
    SEQ=$(echo "$SEQ $i")
done

################################################################################
# This is where the action happens
for i in $(seq -w $SW $EW); do
    let A=$(echo $i | sed s/^0//)*21-20
    let B=A+19
    echo -e "    v$i  $(echo $SEQ | cut -c $A-$B | sed "s/^[ ]*//g")"
done

exit 0

As you can see, years won't have week 52 and none will have week 53 (but not every year has that one). So you will once every year fix one or two weeks.

Offline

#2066 2011-03-31 01:56:59

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

Re: My Conky Config

good old conkyrc code ... ok i cheated a bit, my calendar is lua
tODFtZA
just activated the vnstat database so no network data yet
and i need to set up my weather...although i may just put a text based weather readout using curl and a simple weather rss feed
but its a starting point for a persistant run on startup conky
i havnt had one of those for ages!
conkyrc

##############################################
#  Settings
##############################################
max_specials 1999000
max_user_text 1900000
background no
use_xft yes
xftfont Acknowledge TT BRK:size=10
xftalpha 1
update_interval 1
total_run_times 0
own_window yes
own_window_transparent yes
own_window_type override
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
double_buffer yes
minimum_size 210 800
maximum_width 210
draw_shades no
draw_outline no
draw_borders no
draw_graph_borders yes
default_color white
default_shade_color black
default_outline_color white
alignment top_right
gap_x 10
gap_y 10
no_buffers yes
uppercase no
cpu_avg_samples 2
override_utf8_locale yes
text_buffer_size 100000
top_name_width 5

lua_load /home/mcdowall/lua/calendar2.lua
lua_draw_hook_pre draw_fig

TEXT
${hr}
S Y S T E M    I N F O
${hr}
Host${goto 88}: ${nodename}
Uptime${goto 88}: ${uptime}
RAM${goto 88}: ${mem}/${memmax}
${goto 50}${membar 5,164}
${goto 50}PROCESSE BY MEM:
${goto 88}NAME${goto 135}MEM%${goto 180}PID
${goto 88}${top_mem name 1}${goto 135}${top_mem mem 1}${goto 180}${top_mem pid 1}
${goto 88}${top_mem name 2}${goto 135}${top_mem mem 2}${goto 180}${top_mem pid 2}
${goto 88}${top_mem name 3}${goto 135}${top_mem mem 3}${goto 180}${top_mem pid 3}
SWAP${goto 88}: ${swap}/${swapmax}
${goto 50}${swapbar 5,164}
VOLUMES:
${goto 50}ROOT${goto 88}: ${fs_used /}/${fs_size /}
${goto 50}${fs_bar 5,164 /}
${goto 50}HOME${goto 88}: ${fs_used /home}/${fs_size /home}
${goto 50}${fs_bar 5,164 /home}
CENTRAL PROCESSOR:
${goto 50}CORE${goto 85}1: ${cpu cpu1}%${goto 134}${cpubar cpu1 5,80}
${goto 50}CORE${goto 81}2: ${cpu cpu2}%${goto 134}${cpubar cpu2 5,80}
${goto 50}CORE${goto 81}3: ${cpu cpu3}%${goto 134}${cpubar cpu3 5,80}
${goto 50}PROCESSE BY CPU:
${goto 88}NAME${goto 135}MEM%${goto 180}PID
${goto 88}${top name 1}${goto 135}${top cpu 1}${goto 180}${top pid 1}
${goto 88}${top name 2}${goto 135}${top cpu 2}${goto 180}${top pid 2}
${goto 88}${top name 3}${goto 135}${top cpu 3}${goto 180}${top pid 3}
${hr}
D A T E    A N D    T I M E
${hr}
DATE${goto 88}: ${time %m/%d/%Y}
TIME${goto 88}: ${time %H:%M:%S}






${hr}
N E T W O R K
${hr}
CURRENT ACTIVITY:
${goto 50}UPSPEED${goto 120}: ${upspeed eth1}
${goto 50}${upspeedgraph 10,164 eth0}
${goto 50}DOWNSPEED${goto 120}: ${downspeed eth1}
${goto 50}${downspeedgraph 10,164 eth0}
NETOWRK DATA: waiting on vnstat
${goto 50}${Time %A %D}
${goto 50}Tx${goto 120}: ${execi 1800 str=$(date +%D) && vnstat -d |grep $str | awk -F$str '{print $2}' |awk -F'|' '{print $1}'| sed -e 's/^[ \t]*//'}
${goto 50}Rx${goto 120}: ${execi 1800 str=$(date +%D) && vnstat -d |grep $str | awk -F$str '{print $2}' |awk -F'|' '{print $2}'| sed -e 's/^[ \t]*//'}
${goto 50}Total${goto 120}: ${execi 1800 str=$(date +%D) && vnstat -d |grep $str | awk -F$str '{print $2}' |awk -F'|' '{print $3}'| sed -e 's/^[ \t]*//'}
${goto 50}Avg.Rate${goto 120}: ${execi 1800 str=$(date +%D) && vnstat -d |grep $str | awk -F$str '{print $2}' |awk -F'|' '{print $4}'| sed -e 's/^[ \t]*//'}

${goto 50}${Time %B}
${goto 50}Tx${goto 120}: ${execi 1800 str=$(date +%h) && str2=$(date +%y) && vnstat -m |grep $str | awk -F$str2 '{print $2}' |awk -F'|' '{print $1}'| sed -e 's/^[ \t]*//'}
${goto 50}Rx${goto 120}: ${execi 1800 str=$(date +%h) && vnstat -m |grep $str | awk -F$str '{print $2}' |awk -F'|' '{print $2}'| sed -e 's/^[ \t]*//'}
${goto 50}Total${goto 120}: ${execi 1800 str=$(date +%h) && vnstat -m |grep $str | awk -F$str '{print $2}' |awk -F'|' '{print $3}'| sed -e 's/^[ \t]*//'}
${goto 50}Avg.Rate${goto 120}: ${execi 1800 str=$(date +%h) && vnstat -m |grep $str | awk -F$str '{print $2}' |awk -F'|' '{print $4}'| sed -e 's/^[ \t]*//'}
${hr}
W E A T H E R
${hr}
to be set up

lua calendar

--lua calendar script by mrpeachy Feb 2011
require 'cairo'
--------------------------------------------------------------------------------
function conky_draw_fig()
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 -- starts the display
--####################################################################################################
--####################################################################################################
--title text color
tred,tgreen,tblue,talpha=1,1,1,1
--title text font
tfont="Acknowledge TT BRK"
--title text size
tfontsize=12
--###################################################
--main body text color
bred,bgreen,bblue,balpha=1,1,1,1
--main body text font
mfont="Acknowledge TT BRK"
--main body text size
mfontsize=12
--###################################################
--highlight text color
hred,hgreen,hblue,halpha=1,1,0,1
--highlight font
hfont="Acknowledge TT BRK"
--highlight size
hfontsize=12
--###################################################
--surrounding numbers (previous and next month) 1=on, 0=off
surround=1
--surrounding dates text color
sred,sgreen,sblue,salpha=0.6,0.6,0.6,1
--surrounding font
sfont="Acknowledge TT BRK"
--surounding size
sfontsize=12
--###################################################
--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=34
height=23
--box color
xred,xgreen,xblue,xalpha=1,0.2,0.8,1
--##################################################
--position
across=50
down=412
--rotate - this will require repositioning above
rotate=0
--###################################################
--horizontal gap between dates
gaph=25
--###################################################
--gap between day titles and first line
gapt=12
--###################################################
--gap between calendar line
gapl=12
--###################################################
--spacer -- this can help with alignment enter 0, 1 space or 2 spaces between the ""
spacer=""
--###################################################
--start day, enter 0 for sunday, 1 for monday
sday=0
--###################################################
--## END OF CALENDAR SETUP ##########################
--###################################################
--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-sday
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
for i=1,dlen do
if i<=start_day then dnum[i]="  "
else dn=i-start_day
if dn=="nil" then dn=0 end
if dn<=9 then dn=(spacer .. dn) end
if i>x then dn="" end
dnum[i]=dn
dnumh[i]=dn
if dn==(spacer .. today) or dn==today then
dnum[i]=""
end
if dn==(spacer .. today) or dn==today then
dnumh[i]=dn
place=i
else dnumh[i]="  "
end
end
end--for
--###################################################
cairo_rotate (cr,(math.pi/180)*(rotate))
--print calendar titles
--###################################################
cairo_select_font_face (cr, tfont, CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
cairo_set_font_size (cr, tfontsize);
cairo_set_source_rgba (cr,tred,tgreen,tblue,talpha)
if sday==0 then
dys={"SU","MO","TU","WE","TH","FR","SA"}
else
dys={"MO","TU","WE","TH","FR","SA","SU"}
end
--------------------------------
--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+(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
cairo_select_font_face (cr, mfont, CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
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
end
cairo_select_font_face (cr, hfont, CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
cairo_set_font_size (cr, hfontsize);
cairo_set_source_rgba (cr,hred,hgreen,hblue,halpha)
for i=1,plen,7 do
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
end
--###############################################################################
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_NORMAL);
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
end
end
--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
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
cairo_rectangle (cr,cx-xadjust,cy+yadjust,width,-height)
cairo_stroke (cr)
end
--###################################################
cairo_rotate (cr,(math.pi/180)*(rotate*-1))
--end of calendar
--###################################################
--#################################################################################
end--end if 5
end--end main function

link to font
Acknowledge TT BRK
http://www.abstractfonts.com/font/1339

Last edited by mrpeachy (2011-03-31 02:55:08)

Offline

#2067 2011-03-31 15:36:28

Sector11
77345 ¡#
From: SR11 Cockpit
Registered: 2010-05-05
Posts: 13,409
Website

Re: My Conky Config

mrpeachy wrote:

good old conkyrc code ... ok i cheated a bit, my calendar is lua

mrpeachy with a conky?  What a novel idea!!!

I of course know you for your GREAT LUA scripts ... but I don't think I have ever seen a full conky by you and I have to admit, this looks intriguing to say the least.

Can't wait to see the weather!

Offline

#2068 2011-03-31 16:35:12

Sector11
77345 ¡#
From: SR11 Cockpit
Registered: 2010-05-05
Posts: 13,409
Website

Re: My Conky Config

Jojan wrote:

I forgot something. Here is the code I use to generate my "vecka" file. It used to be alot uglier before I notcied that you could use the -d flag to date.

#!/bin/bash

# Give year as argument.
if [ -z $1 ]; then
    YEAR=$(date +%Y)
else
    YEAR=$1
fi

################################################################################
# Is is leap year?
if [ $(expr $YEAR % 4 == 0) == 1 ] && [ $(expr $YEAR % 100 != 0) == 1 ] || \
   [ $(expr $YEAR % 400 == 0) == 1 ]; then
    FEB=29
else
    FEB=28
fi

################################################################################
SW="01"  # Starting week
SD="0"   # Starting day
while [ "$SW" != "02" ]; do
    SD=$(( $SD + 1 ))
    SW=$(date +%V -d "$SD JAN $YEAR 00:00:00")
done

if [ $SD -gt 7 ]; then
    SD=$(( $SD - 7 ))
    SW="01"
fi

################################################################################
EW="52"  # Ending week
ED="32"  # Ending day
while [ "$EW" != "51" ]; do
    ED=$(( $ED - 1 ))
    EW=$(date +%V -d "$ED DEC $YEAR 00:00:00")
done

if [ $ED -lt 25 ]; then
    ED=$(( $ED + 7 ))
    EW="52"
fi

################################################################################
# January
for i in $(seq -w $SD 31); do
    SEQ=$(echo "$SEQ $i")
done

# Other months
for M in $FEB 31 30 31 30 31 31 30 31 30; do
    for i in $(seq -w 1 $M); do
        SEQ=$(echo "$SEQ $i")
    done
done

# December
for i in $(seq -w 1 $ED); do
    SEQ=$(echo "$SEQ $i")
done

################################################################################
# This is where the action happens
for i in $(seq -w $SW $EW); do
    let A=$(echo $i | sed s/^0//)*21-20
    let B=A+19
    echo -e "    v$i  $(echo $SEQ | cut -c $A-$B | sed "s/^[ ]*//g")"
done

exit 0

As you can see, years won't have week 52 and none will have week 53 (but not every year has that one). So you will once every year fix one or two weeks.


One question - Does this year have to be run every year?
I see a cron job:

Jan 1 run script!

Last edited by Sector11 (2011-03-31 16:35:46)

Offline

#2069 2011-03-31 19:08:42

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

Re: My Conky Config

Sector11 wrote:
mrpeachy wrote:

good old conkyrc code ... ok i cheated a bit, my calendar is lua

mrpeachy with a conky?  What a novel idea!!!

I of course know you for your GREAT LUA scripts ... but I don't think I have ever seen a full conky by you and I have to admit, this looks intriguing to say the least.

Can't wait to see the weather!

i used to have one that ran on startup (basic information and weather all done in conkyrc) and I had it for a long time... then when i had to reinstall my os (old hdd was playing up) i never got around to redoing it

anyway...here is the current looks of things
tODIxNA

ive been cheating again... more lua bits and pieces (stolen from past lua scripts and shrunken a little)

i try for simple... but there's just something that wont let me stop big_smile

weather still needs to be addressed

code to anyone who wants it

Last edited by mrpeachy (2011-03-31 19:10:09)

Offline

#2070 2011-03-31 20:45:22

wlourf
#! CrunchBanger
Registered: 2010-02-13
Posts: 153
Website

Re: My Conky Config

Hi all!
An all Lua Conky for me ;-)

t-vertical_conky_i4d94e70e0009ea78.png

Files are on my dA page.

Offline

#2071 2011-03-31 22:09:08

Sector11
77345 ¡#
From: SR11 Cockpit
Registered: 2010-05-05
Posts: 13,409
Website

Re: My Conky Config

wlourf wrote:

Hi all!
An all Lua Conky for me ;-)

t-vertical_conky_i4d94e70e0009ea78.png

Files are on my dA page.


Now that is nice!  I like it.

Offline

#2072 2011-04-01 05:01:36

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

Re: My Conky Config

take a look at the cpu% usage for conky in this screenshot
tODIxeA

now take a look at how much cpu power conky is using in this screenshot
tODJhNQ

the difference?

the conky in the first screen was constructed primarily in a conkyrc file (except the calendar)

the conky in the second screen was constructed entirely in a lua script which just runs through conky
nothing under TEXT in the second example

the pure lua conky runs almost 1/3 the load of a conkyrc based setup.

my conkyrc file did contain a lot of spacing (gotos offsets,voffsets etc) which is something i think drives the cpu up.

In the past i have complained about the text handling in lua, that you need far too many lines to get the text on there.
but i have taken a few steps towards making text entry in lua, for the purposes of making conkies, easier

here is the lua file that does it all... its not finished... conkyrc still has lua beat in the built in graphs department unfortunately
so i still have some graphs to construct

--lua conky setup by mrpeachy April 2011
--[[
in conkyrc before TEXT call as follows
lua_load /path to file/conky.lua
lua_draw_hook_pre draw_fig

note in conky rc add
top_name_width 5
to settings
]]

require 'cairo'
function string:split(delimiter)
local result = { }
local from  = 1
local delim_from, delim_to = string.find( self, delimiter, from  )
while delim_from do
table.insert( result, string.sub( self, from , delim_from-1 ) )
from  = delim_to + 1
delim_from, delim_to = string.find( self, delimiter, from  )
end
table.insert( result, string.sub( self, from  ) )
return result
end

function round(num, idp)
  local mult = 10^(idp or 0)
  return math.floor(num * mult + 0.5) / mult
end

function max(a)
local mi = 1                        --index of max value
local m = a[mi]                        --max value
for i, val in ipairs(a) do      --can use pairs() as well, ipairs() indicates an array-like table
if val > m then
mi = i
m = val
end
end
return m, mi        --neat feature of lua, can return multiple values
end

function dnumg(s)
str=string.gsub(s,"[ /%a]","")
return str
end

function dunit(s)
str=string.gsub(s,"[%d%p ]","")
return str
end

--------------------------------------------------------------------------------
function conky_draw_fig()
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}'))
--####################################################################################################
--initializ tables
if updates==3 then
cpusecdata={}
cpusecdatal=60
cpumindata={}
cpumindatal=30
cpu5mindata={}
cpu5mindatal=60
cpu10mindata={}
cpu10mindatal=60
cpuavg={0,0,0,0,0}
cpuavgl=5
--memtables
memsecdata={}
memsecdatal=60
memmindata={}
memmindatal=30
mem5mindata={}
mem5mindatal=60
mem10mindata={}
mem10mindatal=60
memavg={0,0,0,0,0}
memavgl=5
end

if updates>5 then -- starts the display
--####################################################################################################
--cpu and mem graphs
cpu=tonumber(conky_parse("${cpu cpu0}"))
for i=1,tonumber(cpusecdatal) do
if cpusecdata[i+1]==nil then cpusecdata[i+1]=0 end
cpusecdata[i]=cpusecdata[i+1]    
if i==cpusecdatal then
cpusecdata[cpusecdatal]=cpu
end--if
end--end for
--set cpu minute average data
timer1=(updates % 60)+1--1 minute clock
cpuminavg=0
if timer1==1 then
for i=1,tonumber(cpumindatal) do
cpuminavg=cpuminavg+cpusecdata[i]
if cpumindata[i+1]==nil then cpumindata[i+1]=0 end
cpumindata[i]=cpumindata[i+1]    
if i==cpumindatal then
cpumindata[cpumindatal]=cpuminavg/60
end--if
end--end for
end--if timer
--##################################################
mem=tonumber(conky_parse("${memperc}"))
for i=1,tonumber(memsecdatal) do
if memsecdata[i+1]==nil then memsecdata[i+1]=0 end
memsecdata[i]=memsecdata[i+1]    
if i==memsecdatal then
memsecdata[memsecdatal]=mem
end--if
end--end for
--set mem minute average data
memminavg=0
if timer1==1 then
for i=1,tonumber(memmindatal) do
memminavg=memminavg+memsecdata[i]
if memmindata[i+1]==nil then memmindata[i+1]=0 end
memmindata[i]=memmindata[i+1]    
if i==memmindatal then
memmindata[memmindatal]=memminavg/60
end--if
end--end for
end--if timer
--draw graphs
cpulred,cpulgreen,cpulblue,cpulalpha=1,1,1,1
cpured,cpugreen,cpublue,cpualpha=1,1,1,1
cpualpha2=1
--cpu second graph
setx=5.5
sety=243.5
--set gap 
gapy=30
for i=1,tonumber(cpumindatal) do
cairo_set_line_width (cr,1)
cairo_set_source_rgba (cr,cpured,cpugreen,cpublue,cpualpha2)
adjust=2.5
heightm=32
across=setx
down=sety+heightm
if cpumindata[i]==nil then cpumindata[i]=0 end
if cpumindata[i+1]==nil then cpumindata[i+1]=0 end
idata=(cpumindata[i]/100)*heightm
iplus=(cpumindata[i+1]/100)*heightm
if iplus==0 or iplus==nil then cairo_set_source_rgba (cr,0,0,0,0) end
cairo_move_to (cr,across+(i*adjust),down-idata)
cairo_line_to (cr,across+((i+1)*adjust),down-iplus)
cairo_stroke (cr)
end--end for
font="Acknowledge TT BRK"
fontsize=14
cairo_select_font_face (cr, font, CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
cairo_set_font_size (cr, fontsize);
cairo_set_source_rgba (cr,0.5,0.5,0.5,1)
cairo_move_to (cr,across,down-((heightm/4)*0))
cairo_rel_line_to (cr,adjust*cpumindatal,0)
cairo_stroke (cr)
cairo_move_to (cr,across,down-((heightm/4)*1))
cairo_rel_line_to (cr,adjust*cpumindatal,0)
cairo_stroke (cr)
cairo_move_to (cr,across,down-((heightm/4)*2))
cairo_rel_line_to (cr,adjust*cpumindatal,0)
cairo_stroke (cr)
cairo_move_to (cr,across,down-((heightm/4)*3))
cairo_rel_line_to (cr,adjust*cpumindatal,0)
cairo_stroke (cr)
cairo_move_to (cr,across,down-((heightm/4)*4))
cairo_rel_line_to (cr,adjust*cpumindatal,0)
cairo_stroke (cr)
--x axis label
downm=down+10
cairo_move_to (cr,across,downm)
cairo_show_text (cr, "30")
cairo_stroke (cr)
add=adjust*14
cairo_move_to (cr,across+add,downm)
cairo_show_text (cr, "15")
cairo_stroke (cr)
add=add+adjust*15
cairo_move_to (cr,across+add,downm)
cairo_show_text (cr, "0")
cairo_stroke (cr)
------------------------------------------------------
setx=5.5
sety=86.5
for i=1,tonumber(memmindatal) do
cairo_set_line_width (cr,1)
cairo_set_source_rgba (cr,cpured,cpugreen,cpublue,cpualpha2)
adjust=2.5
heightm=32
across=setx
down=sety+heightm
if memmindata[i]==nil then memmindata[i]=0 end
if memmindata[i+1]==nil then memmindata[i+1]=0 end
idata=(memmindata[i]/100)*heightm
iplus=(memmindata[i+1]/100)*heightm
if iplus==0 or iplus==nil then cairo_set_source_rgba (cr,0,0,0,0) end
cairo_move_to (cr,across+(i*adjust),down-idata)
cairo_line_to (cr,across+((i+1)*adjust),down-iplus)
cairo_stroke (cr)
end--end for
font="Acknowledge TT BRK"
fontsize=14
cairo_select_font_face (cr, font, CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
cairo_set_font_size (cr, fontsize);
cairo_set_source_rgba (cr,0.5,0.5,0.5,1)
cairo_move_to (cr,across,down-((heightm/4)*0))
cairo_rel_line_to (cr,adjust*cpumindatal,0)
cairo_stroke (cr)
cairo_move_to (cr,across,down-((heightm/4)*1))
cairo_rel_line_to (cr,adjust*cpumindatal,0)
cairo_stroke (cr)
cairo_move_to (cr,across,down-((heightm/4)*2))
cairo_rel_line_to (cr,adjust*cpumindatal,0)
cairo_stroke (cr)
cairo_move_to (cr,across,down-((heightm/4)*3))
cairo_rel_line_to (cr,adjust*cpumindatal,0)
cairo_stroke (cr)
cairo_move_to (cr,across,down-((heightm/4)*4))
cairo_rel_line_to (cr,adjust*cpumindatal,0)
cairo_stroke (cr)
--x axis label
downm=down+10
cairo_move_to (cr,across,downm)
cairo_show_text (cr, "30")
cairo_stroke (cr)
add=adjust*14
cairo_move_to (cr,across+add,downm)
cairo_show_text (cr, "15")
cairo_stroke (cr)
add=add+adjust*15
cairo_move_to (cr,across+add,downm)
cairo_show_text (cr, "0")
cairo_stroke (cr)

--####################################################################################################
--title text color
tred,tgreen,tblue,talpha=1,1,1,1
--title text font
tfont="Acknowledge TT BRK"
--title text size
tfontsize=12
--###################################################
--main body text color
bred,bgreen,bblue,balpha=1,1,1,1
--main body text font
mfont="Acknowledge TT BRK"
--main body text size
mfontsize=12
--###################################################
--highlight text color
hred,hgreen,hblue,halpha=1,1,0,1
--highlight font
hfont="Acknowledge TT BRK"
--highlight size
hfontsize=12
--###################################################
--surrounding numbers (previous and next month) 1=on, 0=off
surround=1
--surrounding dates text color
sred,sgreen,sblue,salpha=0.6,0.6,0.6,1
--surrounding font
sfont="Acknowledge TT BRK"
--surounding size
sfontsize=12
--##################################################
--position
across=50
flx=5;fly=28;lw=11
down=fly+((30-1)*lw)
--###################################################
--horizontal gap between dates
gaph=25
--###################################################
--gap between day titles and first line
gapt=11
--###################################################
--gap between calendar line
gapl=11
--###################################################
--spacer -- this can help with alignment enter 0, 1 space or 2 spaces between the ""
spacer=""
--###################################################
--start day, enter 0 for sunday, 1 for monday
sday=0
--###################################################
--## END OF CALENDAR SETUP ##########################
--###################################################
--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-sday
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
for i=1,dlen do
if i<=start_day then dnum[i]="  " 
else dn=i-start_day
if dn=="nil" then dn=0 end
if dn<=9 then dn=(spacer .. dn) end
if i>x then dn="" end
dnum[i]=dn
dnumh[i]=dn
if dn==(spacer .. today) or dn==today then
dnum[i]=""
end 
if dn==(spacer .. today) or dn==today then
dnumh[i]=dn
place=i 
else dnumh[i]="  " 
end 
end
end--for
--###################################################
--print calendar titles
--###################################################
cairo_select_font_face (cr, tfont, CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
cairo_set_font_size (cr, tfontsize);
cairo_set_source_rgba (cr,tred,tgreen,tblue,talpha)
if sday==0 then
dys={"SU","MO","TU","WE","TH","FR","SA"}
else
dys={"MO","TU","WE","TH","FR","SA","SU"}
end
--------------------------------
for i=1,7 do
cairo_move_to (cr, across+(gaph*(i-1)), down)
cairo_show_text (cr, dys[i])
cairo_stroke (cr)
end
cairo_select_font_face (cr, mfont, CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
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)),down+gapt+(gapl*((fn-1)/7)))
cairo_show_text (cr, dnum[i])
cairo_stroke (cr)
end
end
cairo_select_font_face (cr, hfont, CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
cairo_set_font_size (cr, hfontsize);
cairo_set_source_rgba (cr,hred,hgreen,hblue,halpha)
for i=1,plen,7 do
fn=i
for i=fn,fn+6 do
cairo_move_to (cr, across+(gaph*(i-fn)),down+gapt+(gapl*((fn-1)/7)))
cairo_show_text (cr, dnumh[i])
cairo_stroke (cr)
end
end
--###############################################################################
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_NORMAL);
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)),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
end
end
--###################################################
--end of calendar
--###################################################

------------------------------------------------------
--network graphs
network=1
if network==1 then
timer1=(updates % 1800)+1
if timer1==1 or updates==8 then
local f = io.popen("vnstat -d | grep '|' | tail -n 31 | sed ':a;N;$!ba;s/\\n/ /g' | sed -e 's/estimated/| |/' -e 's/--//g' -e 's/ //g'") -- runs command
vnday=f:read("*a") -- read output of command
f:close()
print (vnday)
vnday=string.split(vnday, "|")

lvntab=#vnday-1
for i=1,lvntab do
if vnday[i]=="" then vnday[i]="1nodata" end
--print (vnday[i])
end
if dunit(vnday[6+4])=="KiB" then
end

vnday30rx={}
for i=0,(lvntab/9) do
if vnday[5+(i*4)]=="nil" then vnday[5+(i*4)]="1nodata" end
if dunit(vnday[5+(i*4)])=="GiB" then 
vnday30rx[i]=tonumber(dnumg(vnday[5+(i*4)]))*1024
end 
if dunit(vnday[5+(i*4)])=="KiB" then 
vnday30rx[i]=tonumber(dnumg(vnday[5+(i*4)]))/1024 
end
if dunit(vnday[5+(i*4)])=="MiB" then 
vnday30rx[i]=tonumber(dnumg(vnday[5+(i*4)]))
end--if
end--for

vnday30tx={}
for i=1,(lvntab/9) do
if vnday[6+(i*4)]=="nil" then vnday[6+(i*4)]="1nodata" end
if tostring(dunit(vnday[6+(i*4)]))=="GiB" then 
vnday30tx[i]=tonumber(dnumg(vnday[6+(i*4)]))*1024
end
if tostring(dunit(vnday[6+(i*4)]))=="KiB" then 
vnday30tx[i]=tonumber(dnumg(vnday[6+(i*4)]))/1024
end
if tostring(dunit(vnday[6+(i*4)]))=="MiB" then 
vnday30tx[i]=tonumber(dnumg(vnday[6+(i*4)]))
end--if
end--for
end--timer


--###############################################################################
--rx----------------------------------------------------
--graph position
acrossx=6.5
flx=5;fly=28;lw=11
downy=(fly+((59-1)*lw))+0.5
gheight=55
--calculate table height----------------------------
heightm,position=max(vnday30rx)
ht=string.split(heightm, "%p")
ht=string.gsub(ht[1],"^.","")
htl=string.len(ht)
add=10^(htl-1)
addn=add
while heightm>add do
add=add+addn
end--while
heightm=(add)
----------------------------------------------------
cairo_set_line_width (cr,1)
height=(gheight/(heightm/100))
across=acrossx
down=downy
for i=1,31 do
cairo_set_source_rgba (cr,1,1,1,1)
adjust=2.5
if vnday30rx[i]==nil then vnday30rx[i]=0 end
if vnday30rx[i+1]==nil then vnday30rx[i+1]=0 end
idata=(vnday30rx[i]/100)*height
iplus=(vnday30rx[i+1]/100)*height
--if iplus==0 then cairo_set_source_rgba (cr,1,1,1,0) end
cairo_move_to (cr,(across+(31*adjust))-(i*adjust),down-idata)
cairo_line_to (cr,(across+(31*adjust))-((i+1)*adjust),down-iplus)
cairo_stroke (cr)
heightrx=gheight
end--for
font="Acknowledge TT BRK"
fontsize=12
tadjrx=-30*adjust-5
cairo_select_font_face (cr, font, CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
cairo_set_font_size (cr, fontsize);
cairo_move_to (cr,across-tadjrx,down-((heightrx/4)*0))
cairo_show_text (cr, "0 M")
cairo_stroke (cr)
cairo_move_to (cr,across-tadjrx,down-((heightrx/4)*1))
cairo_show_text (cr, round((heightm/4)*1,2))
cairo_stroke (cr)
cairo_move_to (cr,across-tadjrx,down-((heightrx/4)*2))
cairo_show_text (cr, round((heightm/4)*2,2))
cairo_stroke (cr)
cairo_move_to (cr,across-tadjrx,down-((heightrx/4)*3))
cairo_show_text (cr, round((heightm/4)*3,2))
cairo_stroke (cr)
cairo_move_to (cr,across-tadjrx,down-((heightrx/4)*4))
cairo_show_text (cr, heightm)
cairo_stroke (cr)
--x axis label
across=across--6
downs=down+10
cairo_move_to (cr,across,downs)
cairo_show_text (cr, "30")
cairo_stroke (cr)
add=adjust*10
cairo_move_to (cr,across+add,downs)
cairo_show_text (cr, "20")
cairo_stroke (cr)
add=add+adjust*10
cairo_move_to (cr,across+add,downs)
cairo_show_text (cr, "10")
cairo_stroke (cr)
add=add+adjust*10
cairo_move_to (cr,across+add+2,downs)
cairo_show_text (cr, "0")
cairo_stroke (cr)
--tx-------------------------------------------------------------------------
--graph position
acrossx=115.5
flx=5;fly=28;lw=11
downy=(fly+((59-1)*lw))+0.5
gheight=55
--calculate table height----------------------------
heightm,position=max(vnday30tx)
ht=string.split(heightm, "%p")
ht=string.gsub(ht[1],"^.","")
htl=string.len(ht)
add=10^(htl-1)
addn=add
while heightm>add do
add=add+addn
end--while
heightm=(add)
----------------------------------------------------
height=(gheight/(heightm/100))
adjust=2.5
across=acrossx
down=downy
for i=1,31 do
cairo_set_source_rgba (cr,1,1,1,1)
if vnday30tx[i]==nil then vnday30tx[i]=0 end
if vnday30tx[i+1]==nil then vnday30tx[i+1]=0 end
idata=(vnday30tx[i]/100)*height
iplus=(vnday30tx[i+1]/100)*height
cairo_move_to (cr,(across+(31*adjust))-(i*adjust),down-idata)
cairo_line_to (cr,(across+(31*adjust))-((i+1)*adjust),down-iplus)
cairo_stroke (cr)
heighttx=gheight
end--for
font="Acknowledge TT BRK"
fontsize=12
tadjrx=-30*adjust-5
cairo_select_font_face (cr, font, CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
cairo_set_font_size (cr, fontsize);
cairo_move_to (cr,across-tadjrx,down-((heighttx/4)*0))
cairo_show_text (cr, "0 M")
cairo_stroke (cr)
cairo_move_to (cr,across-tadjrx,down-((heighttx/4)*1))
cairo_show_text (cr, round((heightm/4)*1,2))
cairo_stroke (cr)
cairo_move_to (cr,across-tadjrx,down-((heighttx/4)*2))
cairo_show_text (cr, round((heightm/4)*2,2))
cairo_stroke (cr)
cairo_move_to (cr,across-tadjrx,down-((heighttx/4)*3))
cairo_show_text (cr, round((heightm/4)*3,2))
cairo_stroke (cr)
cairo_move_to (cr,across-tadjrx,down-((heighttx/4)*4))
cairo_show_text (cr, heightm)
cairo_stroke (cr)
--x axis label
across=across--6
downs=down+10
cairo_move_to (cr,across,downs)
cairo_show_text (cr, "30")
cairo_stroke (cr)
add=adjust*10
cairo_move_to (cr,across+add,downs)
cairo_show_text (cr, "20")
cairo_stroke (cr)
add=add+adjust*10
cairo_move_to (cr,across+add,downs)
cairo_show_text (cr, "10")
cairo_stroke (cr)
add=add+adjust*10
cairo_move_to (cr,across+add+2,downs)
cairo_show_text (cr, "0")
cairo_stroke (cr)
end -- if network

ring=0
if ring==1 then
--###########################################################################
swacross=31.5
swdown=236.5
cairo_set_line_width (cr,12)
cairo_set_source_rgba (cr,0.5,0.5,0.5,1)
radius=16
cpu=tonumber(conky_parse("${cpu cpu0}"))
cairo_arc (cr,swacross,swdown,radius,-1*(90*(math.pi/180)),-1*(90*(math.pi/180))+((math.pi*2)/100)*cpu)
cairo_stroke (cr)
--dotty ring outer boundary
around=60
for i=1,around do
cairo_set_line_width (cr,1)
radius=22
arc=(2*math.pi/around)*i
cx1=0+radius*(math.sin(arc))
cy1=0-radius*(math.cos(arc))
radius=radius+1
arc=(2*math.pi/around)*i
cx2=0+radius*(math.sin(arc))
cy2=0-radius*(math.cos(arc))
cairo_set_source_rgba (cr,1,1,1,1)
cairo_move_to (cr,swacross+cx1, swdown+cy1)
cairo_line_to (cr,swacross+cx2, swdown+cy2)
cairo_stroke (cr)
end
around=30
for i=1,around do
radius=10
arc=(2*math.pi/around)*i
cx1=0+radius*(math.sin(arc))
cy1=0-radius*(math.cos(arc))
radius=radius+1
arc=(2*math.pi/around)*i
cx2=0+radius*(math.sin(arc))
cy2=0-radius*(math.cos(arc))
cairo_set_source_rgba (cr,1,1,1,1)
cairo_move_to (cr,swacross+cx1, swdown+cy1)
cairo_line_to (cr,swacross+cx2, swdown+cy2)
cairo_stroke (cr)
end
for i=1,10 do
n=i
around=10
for i=1,5 do
radius=10+i*2
arc=(2*math.pi/around)*n
cx1=0+radius*(math.sin(arc))
cy1=0-radius*(math.cos(arc))
radius=radius+1
arc=(2*math.pi/around)*n
cx2=0+radius*(math.sin(arc))
cy2=0-radius*(math.cos(arc))
cairo_set_source_rgba (cr,1,1,1,1)
cairo_move_to (cr,swacross+cx1, swdown+cy1)
cairo_line_to (cr,swacross+cx2, swdown+cy2)
cairo_stroke (cr)
end
end
end--if ring

--conkyrc text
flx=5;fly=28;lw=11
--add=fly+((line-1)*lw)
--settings
pass={line=0,hr=1};write(pass)
pass={line=1,text="S Y S T E M    I N F O",textx=flx,texty=fly};write(pass)
pass={line=2,hr=1};write(pass)
pass={line=3,text="UPTIME",textx=flx};write(pass)
uptime=": " .. conky_parse("${uptime}")
pass={line=3,text=uptime,textx=flx+88};write(pass)
pass={line=4,text="MEMORY",textx=flx};write(pass)
memory=": " .. conky_parse("${mem}") .. "/" .. conky_parse("${memmax}")
pass={line=4,text=memory,textx=flx+88};write(pass)
memperc=conky_parse("${memperc}") .. "%"
pass={line=5.5,text=memperc,textx=flx,fsize=18};write(pass)
pass={line=6,text="PROCESSES BY MEM:",textx=flx+40};write(pass)
pass={line=7,text="NAME",textx=flx+88};write(pass)
pass={line=7,text="MEM%",textx=flx+135};write(pass)
pass={line=7,text="PID",textx=flx+180};write(pass)
tmn1=conky_parse("${top_mem name 1}")
tmn2=conky_parse("${top_mem name 2}")
tmn3=conky_parse("${top_mem name 3}")
tmm1=conky_parse("${top_mem mem 1}")
tmm2=conky_parse("${top_mem mem 2}")
tmm3=conky_parse("${top_mem mem 3}")
tmp1=conky_parse("${top_mem pid 1}")
tmp2=conky_parse("${top_mem pid 2}")
tmp3=conky_parse("${top_mem pid 3}")
pass={line=8,text=tmn1,textx=flx+88};write(pass)
pass={line=8,text=tmm1,textx=flx+135};write(pass)
pass={line=8,text=tmp1,textx=flx+180};write(pass)
pass={line=9,text=tmn2,textx=flx+88};write(pass)
pass={line=9,text=tmm2,textx=flx+135};write(pass)
pass={line=9,text=tmp2,textx=flx+180};write(pass)
pass={line=10,text=tmn3,textx=flx+88};write(pass)
pass={line=10,text=tmm3,textx=flx+135};write(pass)
pass={line=10,text=tmp3,textx=flx+180};write(pass)
pass={line=11,text="VOLUMES:",textx=flx};write(pass)
pass={line=12,text="ROOT",textx=flx};write(pass)
root=": " .. conky_parse("${fs_used /}") .. "/" .. conky_parse("${fs_size /}")
pass={line=12,text=root,textx=flx+40};write(pass)
pass={line=14,text="HOME",textx=flx};write(pass)
home=": " .. conky_parse("${fs_used /home}") .. "/" .. conky_parse("${fs_size /home}")
pass={line=14,text=home,textx=flx+40};write(pass)
pass={line=16,text="CENTRAL PROCESSOR:",textx=flx};write(pass)
pass={line=17,text="CORE 1",textx=flx+40};write(pass)
core1=": " .. conky_parse("${cpu cpu1}")
pass={line=17,text=core1 .. "%",textx=flx+88};write(pass)
pass={line=18,text="CORE 2",textx=flx+40};write(pass)
core2=": " .. conky_parse("${cpu cpu2}")
pass={line=18,text=core2 .. "%",textx=flx+88};write(pass)
pass={line=19,text="CORE 3",textx=flx+40};write(pass)
core3=": " .. conky_parse("${cpu cpu3}")
pass={line=19,text=core3 .. "%",textx=flx+88};write(pass)
totcpu=conky_parse("${cpu cpu0}") .. "%"
pass={line=18.5,text=totcpu,textx=flx,fsize=18};write(pass)
pass={line=20,text="PROCESSES BY CPU:",textx=flx+40};write(pass)
pass={line=21,text="NAME",textx=flx+88};write(pass)
pass={line=21,text="CPU%",textx=flx+135};write(pass)
pass={line=21,text="PID",textx=flx+180};write(pass)
tcn1=conky_parse("${top name 1}")
tcn2=conky_parse("${top name 2}")
tcn3=conky_parse("${top name 3}")
tcc1=conky_parse("${top cpu 1}")
tcc2=conky_parse("${top cpu 2}")
tcc3=conky_parse("${top cpu 3}")
tcp1=conky_parse("${top pid 1}")
tcp2=conky_parse("${top pid 2}")
tcp3=conky_parse("${top pid 3}")
pass={line=22,text=tcn1,textx=flx+88};write(pass)
pass={line=22,text=tcc1,textx=flx+135};write(pass)
pass={line=22,text=tcp1,textx=flx+180};write(pass)
pass={line=23,text=tcn2,textx=flx+88};write(pass)
pass={line=23,text=tcc2,textx=flx+135};write(pass)
pass={line=23,text=tcp2,textx=flx+180};write(pass)
pass={line=24,text=tcn3,textx=flx+88};write(pass)
pass={line=24,text=tcc3,textx=flx+135};write(pass)
pass={line=24,text=tcp3,textx=flx+180};write(pass)
pass={line=25,hr=1};write(pass)
pass={line=26,text="D A T E    A N D    T I M E",textx=flx};write(pass)
pass={line=27,hr=1};write(pass)
pass={line=28,text="DATE",textx=flx};write(pass)
date=": " .. os.date("%m/%d/%Y")
pass={line=28,text=date,textx=flx+88};write(pass)
pass={line=29,text="TIME",textx=flx};write(pass)
time=": " .. os.date("%H:%M:%S")
pass={line=29,text=time,textx=flx+88};write(pass)
--calendar
pass={line=36,hr=1};write(pass)
pass={line=37,text="N E T W O R K",textx=flx};write(pass)
pass={line=38,hr=1};write(pass)
pass={line=39,text="CURRENT ACTIVITY:",textx=flx};write(pass)
pass={line=40,text="UPSPEED",textx=flx+40};write(pass)
upspeed=": " .. conky_parse("${upspeed eth1}")
pass={line=40,text=upspeed,textx=flx+125};write(pass)
pass={line=41,text="UPLOADED",textx=flx+40};write(pass)
uploaded=": " .. conky_parse("${totalup eth1}")
pass={line=41,text=uploaded,textx=flx+125};write(pass)
pass={line=44,text="DOWNSPEED",textx=flx+40};write(pass)
downspeed=": " .. conky_parse("${downspeed eth1}")
pass={line=44,text=downspeed,textx=flx+125};write(pass)
pass={line=45,text="DOWNLOADED",textx=flx+40};write(pass)
downloaded=": " .. conky_parse("${totaldown eth1}")
pass={line=45,text=downloaded,textx=flx+125};write(pass)
pass={line=47,text="NETWORK DATA:",textx=flx};write(pass)
nwtime=os.date("%a %D")
pass={line=48,text=nwtime,textx=flx};write(pass)
nwmnth=os.date("%B")
pass={line=48,text=nwmnth,textx=flx+115};write(pass)
--#################################################
--network info on 1800 timer
nwtimer=(updates %1800)+1
if nwtimer==1 or updates==10 then--update
--daily
lookup=os.date("%D")
local f = io.popen("vnstat -d |grep '" .. lookup .. "' | awk -F'" .. lookup .. "' '{print $2}' |awk -F'|' '{print $2}'| sed -e 's/^[ \t]*//'") -- runs command
rxd=f:read("*a") -- read output of command
rxd=string.gsub(rxd,"[\t\n\r]","")
f:close()
local f = io.popen("vnstat -d |grep '" .. lookup .. "' | awk -F'" .. lookup .. "' '{print $2}' |awk -F'|' '{print $3}'| sed -e 's/^[ \t]*//'") -- runs command
txd= f:read("*a") -- read output of command
txd=string.gsub(txd,"[\t\n\r]","")
f:close()
local f = io.popen("vnstat -d |grep '" .. lookup .. "' | awk -F'" .. lookup .. "' '{print $2}' |awk -F'|' '{print $4}'| sed -e 's/^[ \t]*//'") -- runs command
tld= f:read("*a") -- read output of command
tld=string.gsub(tld,"[\t\n\r]","")
f:close()
local f = io.popen("vnstat -d |grep '" .. lookup .. "' | awk -F'" .. lookup .. "' '{print $2}' |awk -F'|' '{print $5}'| sed -e 's/^[ \t]*//'") -- runs command
avd= f:read("*a") -- read output of command
avd=string.gsub(avd,"[\t\n\r]","")
f:close()
--monthly
lookup=os.date("%h")
local f = io.popen("vnstat -m |grep '" .. lookup .. "' | awk -F'" .. lookup .. "' '{print $2}' |awk -F'|' '{print $2}'| sed -e 's/^[ \t]*//'") -- runs command
rxm= f:read("*a") -- read output of command
rxm=string.gsub(rxm,"[\t\n\r]","")
f:close()
local f = io.popen("vnstat -m |grep '" .. lookup .. "' | awk -F'" .. lookup .. "' '{print $2}' |awk -F'|' '{print $3}'| sed -e 's/^[ \t]*//'") -- runs command
txm= f:read("*a") -- read output of command
txm=string.gsub(txm,"[\t\n\r]","")
f:close()
local f = io.popen("vnstat -m |grep '" .. lookup .. "' | awk -F'" .. lookup .. "' '{print $2}' |awk -F'|' '{print $4}'| sed -e 's/^[ \t]*//'") -- runs command
tlm= f:read("*a") -- read output of command
tlm=string.gsub(tlm,"[\t\n\r]","")
f:close()
local f = io.popen("vnstat -m |grep '" .. lookup .. "' | awk -F'" .. lookup .. "' '{print $2}' |awk -F'|' '{print $5}'| sed -e 's/^[ \t]*//'") -- runs command
avm= f:read("*a") -- read output of command
avm=string.gsub(avm,"[\t\n\r]","")
f:close()
end
--#################################################
pass={line=49,text="RX:",textx=flx};write(pass)
pass={line=49,text="RX:",textx=flx+115};write(pass)
pass={line=49,text=rxd,textx=flx+25};write(pass)
pass={line=49,text=rxm,textx=flx+140};write(pass)
pass={line=50,text="TX:",textx=flx};write(pass)
pass={line=50,text="TX:",textx=flx+115};write(pass)
pass={line=50,text=txd,textx=flx+25};write(pass)
pass={line=50,text=txm,textx=flx+140};write(pass)
pass={line=51,text="TL:",textx=flx};write(pass)
pass={line=51,text="TL:",textx=flx+115};write(pass)
pass={line=51,text=tld,textx=flx+25};write(pass)
pass={line=51,text=tlm,textx=flx+140};write(pass)
pass={line=52,text="AV:",textx=flx};write(pass)
pass={line=52,text="AV:",textx=flx+115};write(pass)
pass={line=52,text=avd,textx=flx+25};write(pass)
pass={line=52,text=avm,textx=flx+140};write(pass)
pass={line=61,hr=1};write(pass)
pass={line=62,text="W E A T H E R",textx=flx};write(pass)
pass={line=63,hr=1};write(pass)
--weather data
--reads KSDK website and extracts current weather conditions-------------------------------------------
timerw=(updates %1800)+1
if timerw==1 or updates==8 then
local f = io.popen("curl -L 'http://www.ksdk.com/weather/default.aspx' | grep -A37 '<h3>CURRENT CONDITIONS</h3>'")
data1= f:read("*a")
f:close()
local f = io.popen("echo '" .. data1 .. "' | gawk -F'>' -v RS='<' 'RT{print $NF}' | sed -e '/^[ \r]*$/d' -e 's/&deg;/°/g' -e 's/&#37;/%/g'")
data= f:read("*a")
data=string.split(data,"\n")
f:close()
end
pass={line=64,text=data[2],textx=flx};write(pass)
pass={line=65,text="CONDITIONS: " .. data[5],textx=flx};write(pass)
pass={line=66,text="TEMP: " .. data[3] .. data[4],textx=flx};write(pass)
pass={line=67,text=data[6] .. " " .. data[7],textx=flx};write(pass)
pass={line=68,text=data[8] .. " " .. data[9],textx=flx};write(pass)
pass={line=69,text=data[10] .. " " .. data[11],textx=flx};write(pass)
pass={line=71,text=data[12],textx=flx};write(pass)
pass={line=71,text=data[14],textx=flx+65};write(pass)
pass={line=71,text=data[16],textx=flx+125};write(pass)
pass={line=72,text=data[13],textx=flx};write(pass)
pass={line=72,text=data[15],textx=flx+65};write(pass)
pass={line=72,text=data[17],textx=flx+125};write(pass)
--#################################################################################
--bars -- bnum,barx,bary,bhigh,blong,bout
flx=5;fly=28;lw=11
---------------------
memperc=conky_parse("${memperc}");add=fly+((4)*lw)
pass={bnum=memperc,barx=flx+40,bary=add,bhigh=6,blong=174,bout=1};bar(pass)
rootbar=tonumber(conky_parse("${fs_used_perc /}"));add=fly+((12)*lw)
pass={bnum=rootbar,barx=flx,bary=add,bhigh=6,blong=150,bout=1};bar(pass)
homebar=tonumber(conky_parse("${fs_used_perc /home}"));add=fly+((14)*lw)
pass={bnum=rootbar,barx=flx,bary=add,bhigh=6,blong=150,bout=1};bar(pass)
core1=tonumber(conky_parse("${cpu cpu1}"));add=fly+((16)*lw)
pass={bnum=core1,barx=flx+130,bary=add,bhigh=6,blong=82,bout=1};bar(pass)
core2=tonumber(conky_parse("${cpu cpu2}"));add=fly+((17)*lw)
pass={bnum=core2,barx=flx+130,bary=add,bhigh=6,blong=82,bout=1};bar(pass)
core3=tonumber(conky_parse("${cpu cpu3}"));add=fly+((18)*lw)
pass={bnum=core3,barx=flx+130,bary=add,bhigh=6,blong=82,bout=1};bar(pass)
end--end if 5
end--end main function

function write(t)
flx=5;fly=28;lw=11
local line=t.line
add=fly+((line-1)*lw)
--set default font,fsize and face
if t.textx==nil then textx=flx else textx=t.textx end
if t.texty==nil then texty=add else texty=t.texty end
if t.hr==nil then hr=0 else hr=t.hr end
if t.font==nil then font="Acknowledge tt BRK" else font=t.font end
if t.fsize==nil then fsize=14 else fsize=t.fsize end
if t.face==nil then face=CAIRO_FONT_WEIGHT_NORMAL end
if t.face=="bold" then face=CAIRO_FONT_WEIGHT_BOLD end
if t.tred==nil then tred=1 else tred=t.tred end
if t.tgreen==nil then tgreen=1 else tgreen=t.tgreen end
if t.tblue==nil then tblue=1 else tblue=t.tblue end
if t.talpha==nil then talpha=1 else talpha=t.talpha end
if t.talpha==nil then talpha=1 else talpha=t.talpha end
if t.text~=nil then
local text=t.text
cairo_move_to(cr,textx,texty)
cairo_select_font_face (cr, font, CAIRO_FONT_SLANT_NORMAL, face)
cairo_set_font_size (cr, fsize);
cairo_set_source_rgba (cr,tred,tgreen,tblue,talpha)
cairo_show_text (cr,text)
cairo_stroke (cr)
end
if t.hrl==nil then hrl=250 else hrl=t.hrl end
if t.hr~=nil then
cairo_move_to (cr,textx,texty+0.5-3)
cairo_set_line_width (cr,1)
cairo_rel_line_to (cr,hrl,0)
cairo_stroke (cr)
end
end

function bar(t)
local bnum=t.bnum
if t.bmax==nil then bmax=100 else bmax=t.bmax end
local barx=t.barx+0.5
local bary=t.bary+0.5
local bhigh=t.bhigh
local blong=t.blong
local bout=t.bout
local length=((bnum/bmax)*blong)
cairo_rectangle (cr,barx,bary,length,-bhigh)
cairo_set_source_rgba (cr,1,1,1,1)
cairo_fill (cr)
if bout==1 then
cairo_rectangle (cr,barx,bary,blong,-bhigh)
cairo_set_source_rgba (cr,1,1,1,1)
cairo_set_line_width (cr,1)
cairo_stroke (cr)
end
end

Last edited by mrpeachy (2011-04-01 05:02:49)

Offline

#2073 2011-04-01 06:03:08

mobilediesel
#! Member
Registered: 2010-08-19
Posts: 73

Re: My Conky Config

This is totally off-topic but where the heck do I find the source code for the pastebin used on this site? I know I've seen references to it being open source but I can't find it anywhere.

A mod can move this post somewhere more appropriate if they need to.

Offline

#2074 2011-04-01 12:08:05

Sector11
77345 ¡#
From: SR11 Cockpit
Registered: 2010-05-05
Posts: 13,409
Website

Re: My Conky Config

mrpeachy wrote:

take a look at the cpu% usage for conky in this screenshot

Nice stuff ... I think when conky v2 comes out I'll be saying goodbye to conky.  There is no way I'll be able to wrap my head around all that stuff. {sigh}

I'll have top steal a conky to run it.

Offline

Help fund CrunchBang, donate to the project!

#2075 2011-04-01 16:15:44

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

Re: My Conky Config

Sector11 wrote:
mrpeachy wrote:

take a look at the cpu% usage for conky in this screenshot

Nice stuff ... I think when conky v2 comes out I'll be saying goodbye to conky.  There is no way I'll be able to wrap my head around all that stuff. {sigh}

I'll have top steal a conky to run it.

so what is going to happen with version 2?
is it going to be so significantly different so?

Offline

Board footer

Powered by FluxBB

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

Debian Logo