Conky Support, Codes and Screenshots

Sector11

#135
My new default - no internet conky!

     

~/.conkyrc
# killall conky && conky &

###  Begin Window Settings  ##################################################
# Create own window instead of using desktop (required in nautilus)
own_window yes
own_window_type normal
own_window_transparent yes
own_window_hints undecorated,below,skip_taskbar,skip_pager
own_window_colour gray
own_window_class Conky
own_window_title VSIDO Default Conky

# Use the Xdbe extension? (eliminates flicker)
# It is highly recommended to use own window with this one
# so double buffer won't be so big.
double_buffer yes

### ARGB can be used for real transparency
### NOTE that a composite manager is required for real transparency.
### This option will not work as desired (in most cases) in conjunction with
### own_window_type normal
# own_window_argb_visual yes

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

minimum_size 235 0     ## width, height
#maximum_width 160       ## width

gap_x 10 # left-right
gap_y 0 # up-down

alignment middle_right
###################################################  End Window Settings  ###
###  Font Settings  #########################################################
# Use Xft (anti-aliased font and stuff)
use_xft yes
#xftfont Liberation Sans:size=15
xftfont Monofur:bold:size=13

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

draw_shades no
default_shade_color black

draw_outline yes # amplifies text if yes
default_outline_color black

uppercase no
######################################################  End Font Settings  ###
###  Color Settings  #########################################################
default_shade_color gray
default_outline_color black

default_color DCDCDC #220 220 220 Gainsboro
color0 8FBC8F #143 188 143 DarkSeaGreen
color1 778899 #119 136 153 LightSlateGray
color2 FF8C00 #255 140   0 DarkOrange
color3 7FFF00 #127 255   0 Chartreuse
color4 FFA07A #255 160 122 LightSalmon
color5 FFDEAD #255 222 173 NavajoWhite
color6 00BFFF #  0 191 255 DeepSkyBlue
color7 00FFFF #  0 255 255 Cyan
color8 FFFF00 #255 255   0 Yellow
color9 FF0000 #255   0   0 Red
#####################################################  End Color Settings  ###
###  Borders Section  ########################################################
draw_borders no
# Stippled borders?
stippled_borders 0
# border margins
border_inner_margin 5
border_outer_margin 0
# border width
border_width 1
# graph borders
draw_graph_borders yes
#default_graph_size 15 40
#####################################################  End Borders Secton  ###
###  Miscellaneous Section  ##################################################
# Boolean value, if true, Conky will be forked to background when started.
background yes

# Adds spaces around certain objects to stop them from moving other things
# around, this only helps if you are using a mono font
# Options: right, left or none
use_spacer none
0
# Default and Minimum size is 256 - needs more for single commands that
# "call" a lot of text IE: bash scripts
text_buffer_size 1028

# Subtract (file system) buffers from used memory?
no_buffers yes

# change GiB to G and MiB to M
short_units yes

# Like it says, ot pads the decimals on % values
# doesn't seem to work since v1.7.1
pad_percents 2

#   Maximum size of user text buffer, i.e. layout below TEXT line in config file
#  (default is 16384 bytes)
# max_user_text 16384

# Desired output unit of all objects displaying a temperature. Parameters are
# either "fahrenheit" or "celsius". The default unit is degree Celsius.
# temperature_unit Fahrenheit

##############################################  End Miscellaneous Section  ###
### LUA ######################################################################
### draw-bg.lua ##############################################################
## Above and After TEXT - requires a composite manager or blinks.
##
# lua_load /media/5/Conky/LUA/draw-bg.lua
#TEXT
# ${lua conky_draw_bg 125 0 0 0 0 0x000000 0.3}
#
## ${lua conky_draw_bg corner_radius x_position y_position width height color alpha}
##
## OR Both above TEXT (No composite manager required - no blinking!)
#
#--------------------------------
lua_load /media/5/Conky/LUA/draw-bg.lua
#lua_draw_hook_pre draw_bg 20 0 0 0 0 0x000000 0.5
#lua_draw_hook_post draw_bg 20 0 0 0 0 0x000000 0.5
#
# TEXT
# ${lua conky_draw_bg 20 0 0 0 0 0x000000 0.3}
##
#
################################################################## End LUA ###


update_interval 1

TEXT
${lua conky_draw_bg 20 0 0 0 0 0x000000 0.3}\
${image /media/5/Conky/images/orbwallpaperblack.png -s 60x60 -p 0,0}\
${image /media/5/Conky/images/S11_128.png -s 60x60 -p 0,100}\
${alignr 5}${time %T}
${alignr 5}${time %x}
${alignr 5}${uptime_short}${font Monofur:bold:size=11}

${alignc}${kernel}
${hr}${font}
${alignc}${nodename}

${alignr 5}%  Used  ↓  | Total
Root ${fs_used_perc /}${alignr 5}${fs_used /} | ${fs_size /}
Home ${fs_used_perc /home}${alignr 5}${fs_used /home} | ${fs_size /home}
  RAM ${memperc}${alignr 5}${mem} | ${memmax}
Swap ${swapperc}${alignr 5}${swap} | ${swapmax}

CPU % in use ${alignr 5}Avg ${if_match ${cpu cpu0}<10}00${cpu cpu0}\
${else}${if_match ${cpu cpu0}<100}0${cpu cpu0}\
${else}${cpu cpu0}${endif}${endif}
${alignc}1 ${if_match ${cpu cpu1}<10}00${cpu cpu1}\
${else}${if_match ${cpu cpu1}<100}0${cpu cpu1}\
${else}${cpu cpu1}${endif}${endif}\
  2 ${if_match ${cpu cpu2}<10}00${cpu cpu2}\
${else}${if_match ${cpu cpu2}<100}0${cpu cpu2}\
${else}${cpu cpu2}${endif}${endif}\
  3 ${if_match ${cpu cpu3}<10}00${cpu cpu3}\
${else}${if_match ${cpu cpu3}<100}0${cpu cpu3}\
${else}${cpu cpu3}${endif}${endif}

CPU Fan${alignr 5}${platform f71882fg.2560 fan 1} rpm

Temperatures ${hr}
${alignc}CPU ${if_match ${platform f71882fg.2560 temp 1}<100} ${platform f71882fg.2560 temp 1}\
${else}${platform f71882fg.2560 temp 1}${endif}°\
     MB ${if_match ${platform f71882fg.2560 temp 2}<100} ${platform f71882fg.2560 temp 2}\
${else}${platform f71882fg.2560 temp 2}${endif}°
${alignc}GPU ${if_match ${nvidia temp}<100} ${nvidia temp}\
${else}${nvidia temp}${endif}°\
     HD ${if_match ${execi 5 hddtemp -n /dev/sda}<100} ${execi 5 hddtemp -n /dev/sda}\
${else}${execi 5 hddtemp -n /dev/sda}${endif}°

DISK Activity ${hr}
R${goto 40}${diskiograph_read /dev/sda 14,130 00ffff ff0000 5 -lt}${alignr 5}${diskio_read /dev/sda}
W${goto 40}${diskiograph_write /dev/sda 14,130 ff0000 00ffff 5 -lt}${alignr 5}${diskio_write /dev/sda}

NETWORK ${hr}
Dn${goto 40}${downspeedgraph eth0 14,130 00ffff ff0000 5 -lt}${alignr 5}${downspeedf eth0}
Up${goto 40}${upspeedgraph eth0 14,130 ff0000 00ffff 5 -lt}${alignr 5}${upspeedf eth0}


draw-bg.lua (with calendar)
--[[Background originally by londonali1010 (2009)
    ability to set any size for background mrpeachy 2011
    ability to set variables for bg in conkyrc dk75

  the change is that if you set width and/or height to 0
  then it assumes the width and/or height of the conky window

so:

Above and After TEXT  (requires a composite manager or it blinks!)

lua_load ~/wea_conky/draw_bg.lua
TEXT
${lua conky_draw_bg 10 0 0 0 0 0x000000 0.4}

OR Both above TEXT (no composite manager required - no blinking!)

lua_load ~/wea_conky/draw_bg.lua
lua_draw_hook_pre draw_bg 10 0 0 0 0 0x000000 0.5
TEXT

Note
${lua conky_draw_bg 20 0 0 0 0 0x000000 0.4}
  See below:        1  2 3 4 5 6        7

${lua conky_draw_bg corner_radius x_position y_position width height color alpha}

covers the whole window and will change if you change the minimum_size setting

1 = 20             corner_radius
2 = 0             x_position
3 = 0             y_position
3 = 0             width
5 = 0             height
6 = 0x000000      color
7 = 0.4           alpha

######### calendar function ##################################################

then to use it, you activate the calendar function BELOW TEXT like this

${lua luacal {settings}}

#${lua luacal {x=,y=,tf="",tfs=,tc=,ta=,bf="",bfs=,bc=,ba=,hf="",hfs=,hc=,ha=,sp="",gh=,gt=,gv=,sd=}}
#    x=x position top left
#    y=y position top left
#    tf=title font, eg "mono" must be in quotes
#    tfs=title font size
#    tc=title color
#    ta=title alpha
#    bf=body font, eg "mono" must be in quotes
#    bfs=body font size
#    bc=body color
#    ba=body alpha
#    hf=highlight font, eg "mono" must be in quotes
#    hfs=highlight font size
#    hc=highlight color
#    ha=highlight alpha
#    sp=spacer, eg " " or sp="0"... 0,1 or 2 spaces can help with positioning of non-monospaced fonts

#    gt=gap from title to body
#    gh=gap horizontal between columns
#    gv=gap vertical between rows
#    sd=start day, 0=Sun, 1=Mon

#    hstyle = heading style, 0=just days, 1=date insert
#    tdf=title date font, eg "mono" must be in quotes
#    tdfs=title date font size
#    tdc=title date color
#    tda=title date alpha

# test line
-- ${lua luacal {x=10,y=100,tf="Purisa",tfs=24,tc=0xf67e16,ta=1,bf="First Order",bfs=26,bc=0xecd32a,ba=1,hf="Purisa",hfs=18,hc=0xf67e16,ha=1,sp=" ",gh=40,gt=25,gv=20,sd=0,hstyle=1,tdf="First Order",tdfs=28,tdc=0xff0000,tda=1}}


]]

require 'cairo'
local    cs, cr = nil
function rgb_to_r_g_b(colour,alpha)
return ((colour / 0x10000) % 0x100) / 255., ((colour / 0x100) % 0x100) / 255., (colour % 0x100) / 255., alpha
end
function conky_draw_bg(r,x,y,w,h,color,alpha)
if conky_window == nil then return end
if cs == nil then cairo_surface_destroy(cs) end
if cr == nil then cairo_destroy(cr) end
local cs = cairo_xlib_surface_create(conky_window.display, conky_window.drawable, conky_window.visual, conky_window.width, conky_window.height)
local cr = cairo_create(cs)
w=w
h=h
if w=="0" then w=tonumber(conky_window.width) end
if h=="0" then h=tonumber(conky_window.height) end
cairo_set_source_rgba (cr,rgb_to_r_g_b(color,alpha))
--top left mid circle
local xtl=x+r
local ytl=y+r
--top right mid circle
local xtr=(x+r)+((w)-(2*r))
local ytr=y+r
--bottom right mid circle
local xbr=(x+r)+((w)-(2*r))
local ybr=(y+r)+((h)-(2*r))
--bottom right mid circle
local xbl=(x+r)
local ybl=(y+r)+((h)-(2*r))
-----------------------------
cairo_move_to (cr,xtl,ytl-r)
cairo_line_to (cr,xtr,ytr-r)
cairo_arc(cr,xtr,ytr,r,((2*math.pi/4)*3),((2*math.pi/4)*4))
cairo_line_to (cr,xbr+r,ybr)
cairo_arc(cr,xbr,ybr,r,((2*math.pi/4)*4),((2*math.pi/4)*1))
cairo_line_to (cr,xbl,ybl+r)
cairo_arc(cr,xbl,ybl,r,((2*math.pi/4)*1),((2*math.pi/4)*2))
cairo_line_to (cr,xtl-r,ytl)
cairo_arc(cr,xtl,ytl,r,((2*math.pi/4)*2),((2*math.pi/4)*3))
cairo_close_path(cr)
cairo_fill (cr)
------------------------------------------------------------
cairo_surface_destroy(cs)
cairo_destroy(cr)
return ""
end
-- ###### calendar function ##################################################
function conky_luacal(caltab) -- {x=,y=,tf="",tfs=,tc=,ta=,bf="",bfs=,bc=,ba=,hf="",hfs=,hc=,ha=,sp="",gt=,gh=,gv=,sd=,hstyle=,tdf=,tdfs=,tdc=,tda=}
if conky_window == nil then return end
local cs = cairo_xlib_surface_create(conky_window.display, conky_window.drawable, conky_window.visual, conky_window.width, conky_window.height)
local cr = cairo_create(cs)
--############################################################################
if caltab.x==nil then
caltab=loadstring("return" .. caltab)()
end
local cal_x=caltab.x
local cal_y=caltab.y
local tfont=caltab.tf or "mono"
local tfontsize=caltab.tfs or 12
local tc=caltab.tc or 0xffffff
local ta=caltab.ta or 1
local bfont=caltab.bf or "mono"
local bfontsize=caltab.bfs or 12
local bc=caltab.bc or 0xffffff
local ba=caltab.ba or 1
local hfont=caltab.hf or "mono"
local hfontsize=caltab.hfs or 12
local hc=caltab.hc or 0xff0000
local ha=caltab.ha or 1
local spacer=caltab.sp or " "
local gaph=caltab.gh or 20
local gapt=caltab.gt or 15
local gapl=caltab.gv or 15
local sday=caltab.sd or 0
local hstyle=caltab.hstyle or 0
--convert colors
--local font=string.gsub(font,"_"," ")
local tred,tgreen,tblue,talpha=rgb_to_r_g_b(tc,ta)
--main body text color
local bred,bgreen,bblue,balpha=rgb_to_r_g_b(bc,ba)
--highlight text color
local hred,hgreen,hblue,halpha=rgb_to_r_g_b(hc,ha)
--############################################################################
--calendar calcs
local year=os.date("%G")
local today=tonumber(os.date("%d"))
local t1 = os.time( {    year=year,month=03,day=01,hour=00,min=0,sec=0} );
local t2 = os.time( {    year=year,month=02,day=01,hour=00,min=0,sec=0} );
local feb=(os.difftime(t1,t2))/(24*60*60)
local monthdays={ 31, feb, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }
local day=tonumber(os.date("%w"))+1-sday
local day_num = today
local remainder=day_num % 7
local start_day=day-(day_num % 7)
if start_day<0 then start_day=7+start_day end
local month=os.date("%m")
local mdays=monthdays[tonumber(month)]
local x=mdays+start_day
local dnum={}
local dnumh={}
if mdays+start_day<36 then
dlen=35
plen=29
else
dlen=42
plen=36
end
for i=1,dlen do
    if i<=start_day then
    dnum[i]="  "
    else
    dn=i-start_day
        if dn=="nil" then dn=0 end
        if dn<=9 then dn=(spacer .. dn) end
        if i>x then dn="" end
        dnum[i]=dn
        dnumh[i]=dn
        if dn==(spacer .. today) or dn==today then
        dnum[i]=""
        end
        if dn==(spacer .. today) or dn==today then
        dnumh[i]=dn
        place=i
        else dnumh[i]="  "
        end
    end
end--for
cairo_select_font_face (cr, tfont, CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
cairo_set_font_size (cr, tfontsize);
cairo_set_source_rgba (cr,tred,tgreen,tblue,talpha)
local extents=cairo_text_extents_t:create()
tolua.takeownership(extents)
if hstyle==0 then
    if tonumber(sday)==0 then
    dys={"SU","MO","TU","WE","TH","FR","SA"}
    else
    dys={"MO","TU","WE","TH","FR","SA","SU"}
    end
    --draw calendar titles
elseif hstyle==1 then
    if tonumber(sday)==0 then
    dys={"SU","MO"," ","  ","  ","FR","SA"}
    cairo_text_extents(cr,"MO",extents)
    local s=extents.x_advance+gaph
    local f=gaph*5
    local tdfont=caltab.tdf        or "mono"
    local tdfontsize=caltab.tdfs    or 12
    local tdc=caltab.tdc        or 0xffffff
    local tda=caltab.tda        or 1
    cairo_select_font_face (cr, tdfont, CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
    cairo_set_font_size (cr, tdfontsize);
    local tdred,tdgreen,tdblue,tdalpha=rgb_to_r_g_b(tdc,tda)
    cairo_set_source_rgba (cr,tdred,tdgreen,tdblue,tdalpha)
    local insert=os.date("%b %y")
    cairo_text_extents(cr,insert,extents)
    local w=extents.x_advance
    cairo_move_to (cr, cal_x+((s+f)/2)-(w/2), cal_y)
    cairo_show_text (cr,insert)
    cairo_stroke (cr)
    else
    dys={"MO","TU"," ","  ","  ","SA","SU"}
    cairo_text_extents(cr,"TU",extents)
    local s=extents.x_advance+gaph
    local f=gaph*5
    local tdfont=caltab.tdf        or "mono"
    local tdfontsize=caltab.tdfs    or 12
    local tdc=caltab.tdc        or 0xffffff
    local tda=caltab.tda        or 1
    cairo_select_font_face (cr, tdfont, CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
    cairo_set_font_size (cr, tdfontsize);
    local tdred,tdgreen,tdblue,tdalpha=rgb_to_r_g_b(tdc,tda)
    cairo_set_source_rgba (cr,tdred,tdgreen,tdblue,tdalpha)
    local insert=os.date("%b %y")
    cairo_text_extents(cr,insert,extents)
    local w=extents.x_advance
    cairo_move_to (cr, cal_x+((s+f)/2)-(w/2), cal_y)
    cairo_show_text (cr,insert)
    cairo_stroke (cr)
    end
end
--draw calendar titles
for i=1,7 do
cairo_select_font_face (cr, tfont, CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
cairo_set_font_size (cr, tfontsize);
cairo_set_source_rgba (cr,tred,tgreen,tblue,talpha)
cairo_move_to (cr, cal_x+(gaph*(i-1)), cal_y)
cairo_show_text (cr, dys[i])
cairo_stroke (cr)
end
--draw calendar body
cairo_select_font_face (cr, bfont, CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
cairo_set_font_size (cr, bfontsize);
cairo_set_source_rgba (cr,bred,bgreen,bblue,balpha)
for i=1,plen,7 do
local fn=i
    for i=fn,fn+6 do
    cairo_move_to (cr, cal_x+(gaph*(i-fn)),cal_y+gapt+(gapl*((fn-1)/7)))
    cairo_show_text (cr, dnum[i])
    cairo_stroke (cr)
    end
end
--highlight
cairo_select_font_face (cr, hfont, CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
cairo_set_font_size (cr, hfontsize);
cairo_set_source_rgba (cr,hred,hgreen,hblue,halpha)
for i=1,plen,7 do
local fn=i
    for i=fn,fn+6 do
    cairo_move_to (cr, cal_x+(gaph*(i-fn)),cal_y+gapt+(gapl*((fn-1)/7)))
    cairo_show_text (cr, dnumh[i])
    cairo_stroke (cr)
    end
end
--############################################################################
caltab=nil
dlen=nil
plen=nil
cairo_destroy(cr)
cairo_surface_destroy(cs)
cr=nil
return ""
end
-- end main function #########################################################

Stay Home

Sector11

#136
I had some time to kill today - I could not connect to the internet  :'(

So I played with a conky that needs no internet - yea, I see Network too!  My cable modem is still connected and I get little 'blips' from it on occasion.

This is what I did with my "default" ~/.conkyrc - the one that runs if I start a conky that doesn't exist, my fingers are terrible at spelling.  And now, if there is no internet.

     

Notice how VastOne is getting to me - the font is bigger!  To him I say:  :P

{can ya hear it?}   :D
Stay Home

dizzie

I like the lighthouse wallpaper :) Reminds me of home in my childhood :)
Reclaim your culture, it's within your reach!

My Blog | Facebook | Twitter | G+ | VSIDO |

VastOne

Excellent work Sector11!  It fits you well!   ;D
VSIDO      VSIDO Change Blog    

    I dev VSIDO

Sector11

@ dizzie - if you liked that one:

@ VastOne - it's growing on me, see above.
Stay Home

jedi

Wow Sector11, reminds me of being in Bar Harbor down on the coast of Maine...  Very nice!
Forum Netiquette

"No matter how smart you are you can never convince someone stupid that they are stupid."  Anonymous

Sector11

^ Yea, except today you could probably skate across the Bay of Fundy to Yarmouth.

Imagine stepping outside to that?  That's gotta be one very well built lighthouse!

Lost Internet again ... so I tweaked it a tad.

     

     

I think I like the black text white shadow more.  Probably because it is different!
Stay Home

lwfitz

@ Sector11

HAHAHA! Hit him again!  :D :D

And those arent plain at all! Looks great!
Don't Be A Dick!

BoredOOMM

I don't remember the commands to hide the network if you are not connected.....  ::)

I was actually going to use this abandoned Russiky island lamp for my background with arched Dock at bottom and Conky in white on the right side....

http://media.englishrussia.com/112012/shkota2/shkota002-49.jpg

Don't you also miss the #! "Where in the World Thread" also?

Sector11

Yea, they look nice, but other than the draw-bg.lua, just good old fashioned plain jane conky commands with some spacing tweaks.
Stay Home

dizzie

*Could you go to the lighthouse and get some things for me?*


Oh hell fucking no! Get your own shit, and bring a raincoat too (not that it will do much good)  ;D
Reclaim your culture, it's within your reach!

My Blog | Facebook | Twitter | G+ | VSIDO |

Sector11

Hi BoredOOMM, long time...

You mean this one:


if_up    (interface)
   if INTERFACE exists and is up, display everything between $if_up and the matching $endif



As long as my cable modem is plugged in, internet or not, it's considered "up".

Not sure what you are referring to with the Russiky island link. I see no lamp.  But that bottom link looks like an OLD lamp!

I don't recall the "Where in the World Thread", but Carmen Santiago lives next door.  :D
Stay Home

Xtreme

Well this is my first attempt at getting conky going on VSIDO. (most of the code taken from examples on xfce look - just modified to my system)  Think it looks ok, just have to figure how to add music integration now :P


VastOne

Xtreme, welcome to the Conky Masters Club!

That is EPIC... well done sir!   8)

BTW, I have a How To somewhere around here called 18 Music Apps for Conky...

I am sure you might spot it in the How To's
VSIDO      VSIDO Change Blog    

    I dev VSIDO

Sector11

Xtreme, you have my first conky beat 3 ways to Sunday.

Oh wait, first on VSIDO.  Still ... nice one!

VastOne is shy: 18 Music Apps for Conky
Stay Home