I have a problem with bg.lua blinking at times. The rest of my conky stuff is fine. I'm sure it is caused by a simple setting and I can't see it. Here's my conky and lua
conkyrc
Code:
######################
# - Conky settings - #
######################
background yes
update_interval .5
cpu_avg_samples 2
override_utf8_locale yes
double_buffer yes
no_buffers yes
text_buffer_size 10240
#imlib_cache_size 0
gap_x 10
gap_y 5
minimum_size 250 900
#####################
# - Text settings - #
#####################
use_xft yes
xftfont Santana:size=9:style=bold
xftalpha 0.8
uppercase no
#############################
# - Window specifications - #
#############################
own_window yes
own_window_type override
own_window_transparent yes
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
border_inner_margin 0
border_outer_margin 0
#########################
# - Graphics settings - #
#########################
draw_shades no
draw_outline no
draw_borders no
draw_graph_borders no
temperature_unit fahrenheit
if_up_strictness address
default_color ffffff
# Text alignment, other possible values are commented
#alignment middle_left
#alignment middle_middle
#alignment middle_right
#alignment top_middle
#alignment top_left
alignment top_right
#alignment bottom_left
#alignment bottom_right
#alignment bottom_middle
####
## Load Lua for bargraphs (required)
## Set the path to your script here.
#
lua_load ~/.conky/new/new-bg.lua
#lua_draw_hook_pre draw_bg
lua_load ~/.conky/new/clock-dials.lua
lua_draw_hook_pre draw_fig
TEXT
#${lua conky_draw_bg}
${lua conky_draw_bg 10 0 0 290 735 0x000000 0.4}
#
#System info
#
${image ~/.conky/images/tux_graduate.png -p 5,0 -s 48x48}
${voffset -30}${goto 60} ${nodename}
${goto 60} ${sysname} ${kernel} on ${machine}
${goto 60} Uptime: ${uptime}
${goto 60} ${execi 300 lsb_release -d | cut -c 14-50}
#
#Processor info
#
${image ~/.conky/images/processor.png -p 5,190 -s 48x48}
${voffset 95}${goto 60}${freq}MHz Load: ${color #88ECE0}${loadavg}${color}
${goto 60}Core 1 Usage:${color} ${color #DFEC88}${cpu cpu1}% ${color} ${alignr 3}${cpubar cpu1 6,115}
${goto 60}Core 2 Usage:${color} ${color #DFEC88}${cpu cpu2}% ${color} ${alignr 3}${cpubar cpu2 6,115}
${goto 60}Core 3 Usage:${color} ${color #DFEC88}${cpu cpu3}% ${color} ${alignr 3}${cpubar cpu3 6,115}
${goto 60}Core 4 Usage:${color} ${color #DFEC88}${cpu cpu4}% ${color} ${alignr 3}${cpubar cpu4 6,115}
${goto 60}CPU Temp: ${color #88ECE0}${acpitemp}° F${color}
#
#Memory info
#
${image ~/.conky/images/memory.png -p 5,260 -s 48x48}
${voffset -10}${goto 60}RAM: ${memperc}% ${alignr 3}${membar 6,155}
${goto 60}Swap: ${swapperc}% ${alignr 3}${swapbar 6,155}
#
#Disk info
#
${image ~/.conky/images/hdd.png -p 5,330 -s 48x48}
${goto 60}Root: ${fs_size /} ${alignr 3}${fs_free /} free
${goto 60}Home: ${fs_size /home} ${alignr 3}${fs_free /home} free
${goto 60}${if_existing /media/Linux}Linux: ${fs_size /media/Linux} ${alignr 3}${fs_free /media/Linux} free${else}Linux: Not Mounted${endif}
${goto 60}${if_existing /media/Stuff}Stuff: ${fs_size /media/Stuff} ${alignr 3}${fs_free /media/Stuff} free${else}Stuff: Not mounted${endif}
${goto 60}Disk temp: ${color #88ECE0}${execi 300 hddtemp -u f /dev/sda | cut -c 35-40}${color}
#
#Network info
#
${if_up wlan0}${image ~/.conky/images/wireless.png -p 5,425 -s 48x48}
${goto 60}${font size=12}Wireless${font}
${goto 60}Internal IP: ${addr wlan0}
${goto 60}External IP: ${exec wget -q -O - checkip.dyndns.org | sed -e 's/.*Current IP Address: //' -e 's/<.*$//'}
${goto 60}${downspeedgraph wlan0 25,112 110000 520000 -t} ${upspeedgraph wlan0 25,112 001100 005200 -t}
${voffset -40}${goto 60}Down${goto 115}${downspeed wlan0}${goto 220}UP ${alignr 3}${upspeed wlan0}
${goto 60}Total Dn ${totaldown wlan0}${goto 190}Total UP ${alignr 3}${totalup wlan0}
#
#Weather info
#
${execpi 1800 conkyForecast -i --template=~/.conky/new/conkyForecast.template}
#
#If you're on ethernet
#
${else}${if_up eth0}${image ~/.conky/images/network.png -p 5,425 -s 48x48}${voffset -20}${goto 60}${font size=12}Ethernet${font}
${goto 60}Internal IP: ${addr eth0}
${goto 60}External IP: ${exec wget -q -O - checkip.dyndns.org | sed -e 's/.*Current IP Address: //' -e 's/<.*$//'}
${goto 60}${downspeedgraph eth0 25,112 110000 520000 -t} ${upspeedgraph eth0 25,112 001100 005200 -t}
${voffset -40}${goto 60}Down${goto 115}${downspeed eth0}${goto 220}UP ${alignr 3}${upspeed eth0}
${goto 60}Total Dn ${totaldown eth0}${goto 190}Total UP ${alignr 3}${totalup eth0}
#
#Weather info
#
${execpi 1800 conkyForecast -i --template=~/.conky/new/conkyForecast.template}
# This is if you have no network interace is up
${else}${voffset 20}${goto 35}${font size=12}No Network Connection${font}${endif}${endif}
new-bg.lua
Code:
--[[Background originally by londonali1010 (2009)
ability to set any size for background mrpeachy 2011
ability to set variables for bg in conkyrc dk75
the conky bits that matter (sample):
_ _ _ _ _ _ _ _ _ _
lua_load ~/lua/background.lua
TEXT
${lua conky_draw_bg 10 100 100 100 100 0x000000 0.2}
${lua conky_draw_bg 10 200 200 100 100 0x000000 0.2}
${lua conky_draw_bg 10 100 300 100 100 0x000000 0.2}
#${lua conky_draw_bg corner_radius x_position y_position width height color alpha}
${execpi 1800 conkyForecast --template=~/lua/test.template}
_ _ _ _ _ _ _ _ _ _
test template:
_ _ _ _ _ _ _ _ _ _
${image [--datatype=WI --startday=1] -p 100,100 -s 90x90}
${image [--datatype=WI --startday=2] -p 200,200 -s 90x90}
${image [--datatype=WI --startday=3] -p 100,300 -s 90x90}
${image [--datatype=WI --startday=4] -p 200,400 -s 90x90}
_ _ _ _ _ _ _ _ _ _
or you can have one background over the whole window
and others to highlight parts of the conky
_ _ _ _ _ _ _ _ _ _
TEXT
${lua conky_draw_bg 50 0 0 400 800 0x000000 0.2} # whole background
${lua conky_draw_bg 20 100 100 100 100 0x000000 0.2} # dark shade
${lua conky_draw_bg 0 200 200 100 100 0xffffff 0.2} # light square
${lua conky_draw_bg 50 100 300 100 100 0xff0000 0.2} # red circle
_ _ _ _ _ _ _ _ _ _
]]
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)
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
Bookmarks