

background yes
use_xft yes
xftfont HandelGotD:size=8
xftalpha 0.1
update_interval 0.5
total_run_times 0
own_window yes
own_window_type normal
own_window_transparent no
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
double_buffer yes
minimum_size 200 5
maximum_width 200
draw_shades no
draw_outline no
draw_borders no
draw_graph_borders no
default_color white
default_shade_color red
default_outline_color green
alignment top_right
gap_x 18
gap_y 48
no_buffers yes
uppercase no
cpu_avg_samples 2
net_avg_samples 1
override_utf8_locale no
use_spacer yes
TEXT
${color FF0000}$hr${color}
${font size=8}${color ffffff}${shadecolor 202020}$nodename$shadecolor$color$font -
$sysname $kernel on $machine$font
${color FF0000}$hr${color}
${voffset -2}${color FF0000}${shadecolor 202020}STATUS :$shadecolor$color
${color FF0000}${voffset -6}$hr${color}
Uptime: $uptime - Load: $loadavg
${shadecolor 202020}CPU Temperature: $font $alignr ${acpitemp} C
${color FF0000}$hr${color}
${voffset -2}${color FF0000}${shadecolor 202020}PROCESSES: :$shadecolor$color
${color FF0000}${voffset -6}$hr${color}
Running: $processes
Active: $running_processes
Processes Detail: ${alignr}${offset -4}PID ${offset 4}CPU% MEM%
${color #00FFFF}${offset 17}${top name 1}${alignr}${offset -3}${top pid 1} ${top cpu
1} ${top mem 1}$color
${offset 17}${top name 2}${alignr}${top pid 2} ${top cpu 2} ${top mem 2}
${offset 17}${top name 3}${alignr}${top pid 3} ${top cpu 3} ${top mem 3}
${offset 17}${top name 4}${alignr}${top pid 4} ${top cpu 4} ${top mem 4}
${offset 17}${top name 5}${alignr}${top pid 5} ${top cpu 5} ${top mem 5}
${color FF0000}$hr${color}
${voffset -2}${color FF0000}${shadecolor 202020}PROCESSOR :$shadecolor$color
${color FF0000}${voffset -6}$hr${color}
${cpugraph cpu0 60,299 04578a 597DB2}
${voffset -68}Intel Core 2 Duo @5300
Core 1: ${freq 1} MHz
${cpu cpu1}% ${color #00FFFF}${cpubar cpu1}$color
Core 2: ${freq 2} MHz
${cpu cpu2}% ${color #00FFFF}${cpubar cpu2}$color
${voffset -12}${color FF0000}$hr${color}
${voffset -2}${color FF0000}${shadecolor 202020}MEMORY :$shadecolor$color
${color FF0000}${voffset -6}$hr${color}
Corsair Value Select:
$mem / $memmax
$memperc% ${color #00FFFF}${membar}$color
${color}Memory Detail: ${alignr}${offset -4}PID ${offset 4}CPU% MEM%
${offset 17}${color #00FFFF} ${top_mem name 1}${alignr} ${top_mem pid 1} ${top_mem cpu 1} ${top_mem mem 1}
${offset 17}${color white} ${top_mem name 2}${alignr} ${top_mem pid 2} ${top_mem cpu 2} ${top_mem mem 2}
${offset 17}${color white} ${top_mem name 3}${alignr} ${top_mem pid 3} ${top_mem cpu 3} ${top_mem mem 3}
${color FF0000}$hr${color}
${voffset -2}${color FF0000}${shadecolor 202020}STORAGE :$shadecolor$color
${color FF0000}${voffset -6}$hr${color}
File systems:
System: ${fs_used /} / ${fs_size /}
${color #00FFFF}${fs_bar /}${color}












# Conky configuration
background yes
use_xft yes
xftfont Bitstream Vera Sans Mono:size=10
xftalpha 0.1
update_interval 3.0
total_run_times 0
own_window yes
own_window_type normal
own_window_transparent yes
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
double_buffer yes
minimum_size 235 0
draw_shades no
draw_outline no
draw_borders no
draw_graph_borders no
# border_margin 2
border_width 1
default_color white
default_shade_color black
default_outline_color black
alignment top_right
gap_x 12
gap_y 12
no_buffers yes
uppercase no
cpu_avg_samples 2
net_avg_samples 2
override_utf8_locale no
use_spacer right
show_graph_scale no
show_graph_range no
text_buffer_size 1024
color1 white
color2 6892C6
color3 E77320
color4 78BF39
color5 3B3B3B
# stuff after 'TEXT' will be formatted on screen
TEXT
${voffset -4}${font Radio Space:size=34}${color red}TC's PC
${font Verana:style=Bold:size=24} ${color white} ${color }${time %H:%M:%S}
${font Verana:style=Bold:size=12} $nodename - $sysname $kernel on $machine
${font Verana:style=Bold:size=9} ${addr eth0} ${alignr}${color }Uptime:$color $uptime_short
${font Verana:style=Bold:size=12}${color white}CPU:${color } $cpu% TEMP:${color } ${hwmon 1 temp 1}
${color1}CPU1 $alignr ${cpu cpu1}%
${color yellow}${cpubar cpu1}
${color1}CPU2 $alignr ${cpu cpu2}%
${color yellow}${cpubar cpu2}
${color1}CPU3 $alignr ${cpu cpu3}%
${color yellow}${cpubar cpu3}
${color1}CPU4 $alignr ${cpu cpu4}%
${color yellow}${cpubar cpu4}
${font Verana:style=Bold:size=9}${color white}Load: ${color }$loadavg
${font Verana:style=Bold:size=9}${color white}Processes: ${color }$processes
${font Verana:style=Bold:size=9}${color white}Running: ${color }$running_processes
${font Verana:style=Bold:size=10}${color white}Highest CPU:
${font Verana:style=Bold:size=10}${color white} ${top name 1}${top_mem cpu 1}
${font Verana:style=Bold:size=10}${color white} ${top name 2}${top cpu 2}
${font Verana:style=Bold:size=10}${color white} ${top name 3}${top cpu 3}
${font Verana:style=Bold:size=10}${color white}Highest MEM:
${font Verana:style=Bold:size=10}${color white} ${top_mem name 1}${top_mem mem 1}
${font Verana:style=Bold:size=10}${color white} ${top_mem name 2}${top_mem mem 2}
${font Verana:style=Bold:size=10}${color white} ${top_mem name 3}${top_mem mem 3}
MEM $alignc $mem / $memmax $alignr $memperc%
${color yellow}$membar
${color1}SWAP $alignc $swap / $swapmax $alignr $swapperc%
${color yellow}${swapbar}
${color1}/ $alignc ${fs_used /} / ${fs_size /} $alignr ${fs_free_perc /}%
${color yellow}${fs_bar /}
${color1}/home $alignc ${fs_used /home} / ${fs_size /home} $alignr ${fs_free_perc /home}%
${color yellow}${fs_bar /home}
${color1}${font Verana:style=Bold:size=9}Total Download: ${font Verana:size=8}${totaldown eth0}
${color1}
${font Verana:style=Bold:size=9}Total Upload: ${font Verana:size=8}${totalup eth0}
${color yellow}Inbound $alignr ${downspeed eth0} kb/s
${color yellow}${downspeedgraph eth0}
${color yellow}Outbound $alignr ${upspeed eth0} kb/s
${color yellow}${upspeedgraph eth0}






titetanium wrote:
My conky shot....still tweaking it..trying to figure out how to get translucency on the background instead of solid colors. It seems you can enable transparency or use solid colors. I wanted it semi-transparent, but I don't have compiz enabled. (Machine can run compiz, just don't want to use it.) Any way this can be done?
own_window yes
own_window_type normal
own_window_transparent yes
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
own_window_class Conky
### 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 0--[[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 ~/path_to/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 ~/path_to/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
]]
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
lua_load ~/path_to/draw_bg.lua
lua_draw_hook_pre draw_bg 10 0 0 0 0 0x000000 0.5
TEXT

background no
alignment top_right
use_xft yes
xftfont Smooth:size=10
xftalpha 0.5
out_to_console no
out_to_stderr no
extra_newline no
update_interval 1.0
format_human_readable yes
total_run_times 0
own_window yes
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
own_window_type normal
own_window_transparent yes
double_buffer yes
minimum_size 170 5
maximum_width 220
draw_shades no
draw_outline no
draw_borders no
draw_graph_borders yes
uppercase no
gap_x 5
gap_y 30
no_buffers yes
cpu_avg_samples 2
net_avg_samples 1
diskio_avg_samples 1
use_spacer none
show_graph_scale no
show_graph_range no
override_utf8_locale no
color1 FB9845
color2 E86D27
color3 7CDB32
color4 80808D
color5 red
TEXT
${image ~/.conky/Backsys.png 230x300 -p -1,-1}
${image ~/.conky/Backpro.png 230x153 -p -1,302}
${image ~/.conky/Backnet.png 230x160 -p -1,458}
${image ~/.conky/Backweather.png 230x110 -p -1,612}











luke@asus-desktop ~ $ ~/Conky/conky_start.sh
luke@asus-desktop ~ $ Conky: /home/luke/Conky/conky_weather: 1: no such configuration: ''
Conky: desktop window (e00022) is subwindow of root window (15d)
Conky: window type - normal
Conky: drawing to created window (0x1c00002)
Conky: drawing to double buffer
Conky: desktop window (e00022) is subwindow of root window (15d)
Conky: window type - normal
Conky: drawing to created window (0x1800002)
Conky: drawing to double buffer
wget: no process found
--2012-09-05 15:21:34-- http://www.accuweather.com/en/us/monrovia-ca/91016/current-weather/91016us?day=1
Resolving www.accuweather.com (www.accuweather.com)... 63.80.242.26, 63.80.242.40
Connecting to www.accuweather.com (www.accuweather.com)|63.80.242.26|:80... connected.
HTTP request sent, awaiting response... 301 Moved Permanently
Location: /en/us/monrovia-ca/91016/current-weather/2168292 [following]
--2012-09-05 15:21:40-- http://www.accuweather.com/en/us/monrovia-ca/91016/current-weather/2168292
Reusing existing connection to www.accuweather.com:80.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [text/html]
Saving to: `/home/luke/Accuweather_Conky_USA_Images/curr_cond_raw'
[ <=> ] 85,511 312K/s in 0.3s
2012-09-05 15:21:40 (312 KB/s) - `/home/luke/Accuweather_Conky_USA_Images/curr_cond_raw' saved [85511]
--2012-09-05 15:21:40-- http://www.accuweather.com/en/us/monrovia-ca/91016/daily-weather-forecast/2168292
Resolving www.accuweather.com (www.accuweather.com)... 63.80.242.40, 63.80.242.26
Connecting to www.accuweather.com (www.accuweather.com)|63.80.242.40|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [text/html]
Saving to: `/home/luke/Accuweather_Conky_USA_Images/tod_ton_raw'
[ <=> ] 87,188 330K/s in 0.3s
2012-09-05 15:21:46 (330 KB/s) - `/home/luke/Accuweather_Conky_USA_Images/tod_ton_raw' saved [87188]
--2012-09-05 15:21:46-- http://www.accuweather.com/en/us/monrovia-ca/91016/daily-weather-forecast/2168292?day=6
Resolving www.accuweather.com (www.accuweather.com)... 63.80.242.40, 63.80.242.26
Connecting to www.accuweather.com (www.accuweather.com)|63.80.242.40|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [text/html]
Saving to: `/home/luke/Accuweather_Conky_USA_Images/last_days_raw'
[ <=> ] 87,200 331K/s in 0.3s
2012-09-05 15:21:52 (331 KB/s) - `/home/luke/Accuweather_Conky_USA_Images/last_days_raw' saved [87200]
wget: no process found
--2012-09-05 15:21:52-- http://www.accuweather.com/en/us/monrovia-ca/91016/current-weather/91016us?day=1
Resolving www.accuweather.com (www.accuweather.com)... 63.80.242.26, 63.80.242.40
Connecting to www.accuweather.com (www.accuweather.com)|63.80.242.26|:80... connected.
HTTP request sent, awaiting response... 301 Moved Permanently
Location: /en/us/monrovia-ca/91016/current-weather/2168292 [following]
--2012-09-05 15:21:57-- http://www.accuweather.com/en/us/monrovia-ca/91016/current-weather/2168292
Reusing existing connection to www.accuweather.com:80.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [text/html]
Saving to: `/home/luke/Accuweather_Conky_USA_Images/curr_cond_raw'
#!/bin/sh
#sleep 5s
conky -c ~/Conky/conky_system &
conky -c ~/Conky/conky_weather &
#conky -c ~/Conky/conkyrc_memory &
#conky -c ~/Conky/conkyrc_network &
#conky -c ~/Conky/conkyrc_storage &
#conky -c ~/Conky/conkyrc_clock &
##############################################
# Settings
##############################################
max_specials 10000
max_user_text 15000
background no
use_xft yes
xftfont sans:size=9
xftalpha 1
total_run_times 0
own_window yes
own_window_argb_visual yes
own_window_transparent yes
own_window_type normal
own_window_title conky
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
double_buffer yes
minimum_size 250
maximum_width 250
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_left
gap_x 10
gap_y 15
no_buffers yes
uppercase no
cpu_avg_samples 2
override_utf8_locale yes
text_buffer_size 100000
top_name_width 5
update_interval 1
default_color FFFFFF
temperature_unit fahrenheit
## Set the path to your script here.
lua_load ~/Conky/allcombined.lua
## lua funcions
## background ##################################################################
#${lua draw_bg {corner_radius,x_position,y_position,width,height,color,alpha}}
#note for background: set width=0 - width will be conky window width, set height=0 - height will be conky window height
## gradient bars ###############################################################
#${lua gradbar {x_position,y_position,"conky_object",object_max_value,number_of_divisions,division_width,division_height,division_gap,bg_color,bg_alpha,start_color,start_alpha,mid_color,mid_alpha,end_color,end_alpha}}
## calendar ###############################################################
#${lua luacal {x_position,y_position,"title_font",title_fontsize,title_color,title_alpha,"dates_font",dates_fontsize,dates_color,dates_alpha,"highlight_font",highlight_fontsize,highlight_color,highlight_alpha,"spacer",colum_gap,title_gap,row_gap,start_day}
#note for calendar: start day... 0=sunday, 1=monday ... "spacer" can help align calendar with non fix width fonts
## textured background ###############################################################
#${lua tex_bg {corner_radius,x_position,y_position,width,height,"/path/to/texture.png"}}
## lua draw images ###############################################################
#${lua luaimage {x_position,y_position,width,height,"/path/to/image"}}
#note for images: set width=0 - width will be image width, set height=0 - height will be image height
## lua draw text ###############################################################
#${lua luatext {x_position,y_position,color,alpha,"font",fontsize,"justify"}}
# not for text: justify can be "r" = right, "c" = center, "l" = left
#${lua draw_bg {10,0,0,0,0,0x000000,0.3}}
TEXT
${lua draw_bg {15,0,0,0,0,0x000000,0.5}}
${texeci 500 bash $HOME/Accuweather_Conky_USA_Images/acc_usa_images}${image $HOME/Accuweather_Conky_USA_Images/cc.png -p -30,30 -s 180x108}
${goto 125}${font Ubuntu:size=10}TEMP:${alignr 3}${execpi 600 sed -n '4p' $HOME/Accuweather_Conky_USA_Images/curr_cond}°F (${execpi 600 sed -n '5p' $HOME/Accuweather_Conky_USA_Images/curr_cond}°F)
${goto 125}WIND:${alignr 3}${execpi 600 sed -n '6p' $HOME/Accuweather_Conky_USA_Images/curr_cond} ${execpi 600 sed -n '14p' $HOME/Accuweather_Conky_USA_Images/curr_cond}
${goto 125}HUM:${alignr 3}${execpi 600 sed -n '7p' $HOME/Accuweather_Conky_USA_Images/curr_cond}
#${goto 125}PRESS:${alignr 3}${execpi 600 sed -n '8p' $HOME/Accuweather_Conky_USA_Images/curr_cond}
${goto 125}CLOUDY:${alignr 3}${execpi 600 sed -n '9p' $HOME/Accuweather_Conky_USA_Images/curr_cond}
#${goto 125}UV INDEX:${alignr 10}${execpi 600 sed -n '10p' $HOME/Accuweather_Conky_USA_Images/curr_cond}
#${goto 125}DEW POINT:${alignr 3}${execpi 600 sed -n '11p' $HOME/Accuweather_Conky_USA_Images/curr_cond}
${goto 125}PERCIP:${alignr 3}${execpi 600 sed -n '12p' $HOME/Accuweather_Conky_USA_Images/curr_cond}
${goto 125}VISIB.:${alignr 3}${execpi 600 sed -n '13p' $HOME/Accuweather_Conky_USA_Images/curr_cond}
${goto 125}SUNRISE:${alignr 3}${execpi 600 sed -n '15p' $HOME/Accuweather_Conky_USA_Images/curr_cond}
${goto 125}SUNSET:${alignr 3}${execpi 600 sed -n '16p' $HOME/Accuweather_Conky_USA_Images/curr_cond}
${voffset 12}
--[[ by mrpeachy -
combines background bar and calendar functions
]]
require 'cairo'
require 'imlib2'
function rgb_to_r_g_b(col_a)
return ((col_a[1] / 0x10000) % 0x100) / 255., ((col_a[1] / 0x100) % 0x100) / 255., (col_a[1] % 0x100) / 255., col_a[2]
end
function conky_gradbar(bartab)
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)
local updates=tonumber(conky_parse('${updates}'))
if updates>5 then
--#########################################################################################################
--convert to table
local bartab=loadstring("return" .. bartab)()
local bar_startx=bartab[1]
local bar_starty=bartab[2]
local number=bartab[3]
local number=conky_parse(number)
local number_max=bartab[4]
local divisions=bartab[5]
local div_width=bartab[6]
local div_height=bartab[7]
local div_gap=bartab[8]
local bg_col=bartab[9]
local bg_alpha=bartab[10]
local st_col=bartab[11]
local st_alpha=bartab[12]
local mid_col=bartab[13]
local mid_alpha=bartab[14]
local end_col=bartab[15]
local end_alpha=bartab[16]
--color conversion
local br,bg,bb,ba=rgb_to_r_g_b({bg_col,bg_alpha})
local sr,sg,sb,sa=rgb_to_r_g_b({st_col,st_alpha})
local mr,mg,mb,ma=rgb_to_r_g_b({mid_col,mid_alpha})
local er,eg,eb,ea=rgb_to_r_g_b({end_col,end_alpha})
if number==nil then number=0 end
local number_divs=(number/number_max)*divisions
cairo_set_line_width (cr,div_width)
--gradient calculations
for i=1,divisions do
if i<(divisions/2) and i<=number_divs then
colr=((mr-sr)*(i/(divisions/2)))+sr
colg=((mg-sg)*(i/(divisions/2)))+sg
colb=((mb-sb)*(i/(divisions/2)))+sb
cola=((ma-sa)*(i/(divisions/2)))+sa
elseif i>=(divisions/2) and i<=number_divs then
colr=((er-mr)*((i-(divisions/2))/(divisions/2)))+mr
colg=((eg-mg)*((i-(divisions/2))/(divisions/2)))+mg
colb=((eb-mb)*((i-(divisions/2))/(divisions/2)))+mb
cola=((ea-ma)*((i-(divisions/2))/(divisions/2)))+ma
else
colr=br
colg=bg
colb=bb
cola=ba
end
cairo_set_source_rgba (cr,colr,colg,colb,cola)
cairo_move_to (cr,bar_startx+((div_width+div_gap)*i-1),bar_starty)
cairo_rel_line_to (cr,0,div_height)
cairo_stroke (cr)
end
--#########################################################################################################
end-- if updates>5
bartab=nil
colr=nil
colg=nil
colb=nil
cola=nil
cairo_destroy(cr)
cairo_surface_destroy(cs)
cr=nil
return ""
end-- end main function
function conky_draw_bg(bgtab)
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)
--#########################################################################################################
--convert to table
local bgtab=loadstring("return" .. bgtab)()
local r=bgtab[1]
local x=bgtab[2]
local y=bgtab[3]
local w=bgtab[4]
local h=bgtab[5]
local color=bgtab[6]
local alpha=bgtab[7]
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))
--the drawing part---------------------------
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)
--#########################################################################################################
bgtab=nil
w=nil
h=nil
cairo_destroy(cr)
cairo_surface_destroy(cs)
cr=nil
return ""
end-- end main function
function conky_luacal(caltab)
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)
--####################################################################################################
local caltab=loadstring("return" .. caltab)()
local cal_x=caltab[1]
local cal_y=caltab[2]
local tfont=caltab[3]
local tfontsize=caltab[4]
local tc=caltab[5]
local ta=caltab[6]
local bfont=caltab[7]
local bfontsize=caltab[8]
local bc=caltab[9]
local ba=caltab[10]
local hfont=caltab[11]
local hfontsize=caltab[12]
local hc=caltab[13]
local ha=caltab[14]
local spacer=caltab[15]
local gaph=caltab[16]
local gapt=caltab[17]
local gapl=caltab[18]
local sday=caltab[19]
--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)
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
for i=1,7 do
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
function conky_luaimage(imtab)
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)
--#########################################################################################################
local imtab=loadstring("return" .. imtab)()
local im_x=imtab[1]
local im_y=imtab[2]
local im_w=imtab[3]
local im_h=imtab[4]
local file=imtab[5]
local show = imlib_load_image(file)
if show == nil then return end
imlib_context_set_image(show)
if tonumber(im_w)==0 then
width=imlib_image_get_width()
else
width=tonumber(im_w)
end
if tonumber(im_h)==0 then
height=imlib_image_get_height()
else
height=tonumber(im_h)
end
imlib_context_set_image(show)
local scaled=imlib_create_cropped_scaled_image(0, 0, imlib_image_get_width(), imlib_image_get_height(), width, height)
imlib_free_image()
imlib_context_set_image(scaled)
imlib_render_image_on_drawable(im_x, im_y)
imlib_free_image()
show=nil
--#########################################################################################################
imtab=nil
height=nil
width=nil
cairo_destroy(cr)
cairo_surface_destroy(cs)
cr=nil
return ""
end-- end main function
function conky_tex_bg(textab)
local textab=loadstring("return" .. textab)()
local tex_file=textab[6]
local surface = cairo_image_surface_create_from_png(tostring(tex_file))
local cw,ch = conky_window.width, conky_window.height
local cs=cairo_xlib_surface_create(conky_window.display, conky_window.drawable, conky_window.visual, cw,ch)
local cr=cairo_create(cs)
--#########################################################################################################
--convert to table
local r=textab[1]
local x=textab[2]
local y=textab[3]
local w=textab[4]
local h=textab[5]
if w=="0" then
w=cw
end
if h=="0" then
h=ch
end
--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))
--the drawing part---------------------------
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_clip (cr)
cairo_new_path (cr);
--image part
cairo_set_source_surface (cr, surface, 0, 0)
cairo_paint (cr)
--#########################################################################################################
textab=nil
w=nil
h=nil
cairo_destroy(cr)
cairo_surface_destroy (cs)
cairo_surface_destroy (surface)
cr=nil
return ""
end-- end main function
function conky_luatext(txttab)--x,y,c,a,f,fs,txt,j ##################################################
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)
--#########################################################################################################
--convert to table
local txttab=loadstring("return" .. txttab)()
local x=txttab[1]
local y=txttab[2]
local c=txttab[3]
local a=txttab[4]
local f=txttab[5]
local fs=txttab[6]
local j=txttab[7]
local txt=txttab[8]
cairo_select_font_face (cr, f, CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
cairo_set_font_size (cr, fs)
local extents=cairo_text_extents_t:create()
cairo_text_extents(cr,txt,extents)
local wx=extents.x_advance
cairo_set_source_rgba (cr,rgb_to_r_g_b({c,a}))
if j=="l" then
cairo_move_to (cr,x,y)
elseif j=="c" then
cairo_move_to (cr,x-(wx/2),y)
elseif j=="r" then
cairo_move_to (cr,x-wx,y)
end
cairo_show_text (cr,txt)
cairo_stroke (cr)
--#########################################################################################################
txttab=nil
cairo_destroy(cr)
cairo_surface_destroy (cs)
cr=nil
return ""
end-- end main function
#!/bin/bash
#function: test_image_day
test_image_day () {
case $1 in
su)
echo 1su
;;
msu)
echo 2msu
;;
psu)
echo 3psu
;;
ic)
echo 4ic
;;
h)
echo 5h
;;
mc)
echo 6mc
;;
c)
echo 7c
;;
d)
echo 8d
;;
f)
echo 9f
;;
s)
echo 10s
;;
mcs)
echo 11mcs
;;
psus)
echo 12psus
;;
t)
echo 13t
;;
mct)
echo 14mct
;;
psut)
echo 15psut
;;
r)
echo 16r
;;
fl)
echo 17fl
;;
mcfl)
echo 18mcfl
;;
psfl)
echo 19psfl
;;
sn)
echo 20sn
;;
mcsn)
echo 21mcsn
;;
i)
echo 22i
;;
sl)
echo 23sl
;;
fr)
echo 24fr
;;
rsn)
echo 25rsn
;;
w)
echo 26w
;;
ho)
echo 27ho
;;
co)
echo 28co
;;
cl)
echo 29cl
;;
mcl)
echo 31mcl
;;
pc)
echo 32pc
;;
pcs)
echo 36pcs
;;
pct)
echo 38pct
;;
esac
}
#function: test_image_night
test_image_night () {
case $1 in
su)
echo 1su
;;
msu)
echo 2msu
;;
psu)
echo 3psu
;;
c)
echo 7c
;;
d)
echo 8d
;;
f)
echo 9f
;;
s)
echo 10s
;;
psus)
echo 12psus
;;
t)
echo 13t
;;
psut)
echo 15psut
;;
r)
echo 16r
;;
fl)
echo 17fl
;;
psfl)
echo 19psfl
;;
sn)
echo 20sn
;;
i)
echo 22i
;;
sl)
echo 23sl
;;
fr)
echo 24fr
;;
rsn)
echo 25rsn
;;
ho)
echo 27ho
;;
co)
echo 28co
;;
cl)
echo 29cl
;;
w)
echo 30w
;;
mcl)
echo 31mcl
;;
pc)
echo 32pc
;;
ic)
echo 33ic
;;
h)
echo 34h
;;
mc)
echo 35mc
;;
pcs)
echo 36pcs
;;
mcs)
echo 37mcs
;;
pct)
echo 38pct
;;
mct)
echo 39mct
;;
mcfl)
echo 40mcfl
;;
mcsn)
echo 41mcsn
;;
esac
}
#put your Accuweather address here
address="http://www.accuweather.com/en/us/monrovia-ca/91016/weather-forecast/2168292"
#http://www.accuweather.com/en/us/midway-oh/43151/weather-forecast/2214620"
loc_id=$(echo $address|sed 's/\/weather-forecast.*$//'|sed 's/^.*\///')
last_number=$(echo $address|sed 's/^.*\///')
kill -STOP $(pidof conky)
killall wget
curr_addr="$(echo $address|sed 's/weather-forecast.*$//')"current-weather/"$loc_id"us?day=1
wget -O $HOME/Accuweather_Conky_USA_Images/curr_cond_raw "$curr_addr"
addr1="$(echo $address|sed 's/weather-forecast.*$//')"daily-weather-forecast/"$last_number"
wget -O $HOME/Accuweather_Conky_USA_Images/tod_ton_raw "$addr1"
addr2="$addr1"?day=6
wget -O $HOME/Accuweather_Conky_USA_Images/last_days_raw "$addr2"
if [[ -s $HOME/Accuweather_Conky_USA_Images/curr_cond_raw ]]; then
#current conditions
sed -i '/detail-now/,/Moonrise/!d' $HOME/Accuweather_Conky_USA_Images/curr_cond_raw
egrep -i '"cond"|Humidity|Pressure|Cloud Cover|UV Index|Dew Point|Amount of Precipitation|Visibility|AM|PM|mph|icons-wind|detail-tab-panel|icon i-' $HOME/Accuweather_Conky_USA_Images/curr_cond_raw > $HOME/Accuweather_Conky_USA_Images/curr_cond
sed -i -e 's/^.*icon i-//g' -e 's/^.*tab-panel //g' -e 's/^.*start">//g' -e 's/^.*finish">//g' $HOME/Accuweather_Conky_USA_Images/curr_cond
sed -i 's/^.*<li>//g' $HOME/Accuweather_Conky_USA_Images/curr_cond
sed -i -e 's/<strong>//g' -e 's/<\/strong>//g' -e 's/<\/li>//g' $HOME/Accuweather_Conky_USA_Images/curr_cond
sed -i -e '1d' -e 's/^.*center;">//g' -e 's/^.*icons-wind\///g' -e 's/\.gif.*$//g' $HOME/Accuweather_Conky_USA_Images/curr_cond
sed -i -e 's/^.*"cond">//g' -e 's/temp">/\n/g' -e 's/realfeel">/\n/g' $HOME/Accuweather_Conky_USA_Images/curr_cond
sed -i -e 's/">.*$//g' -e 's/<\/span>.*$//g' -e 's/<span>.*$//g' $HOME/Accuweather_Conky_USA_Images/curr_cond
sed -i -e 's/°//g' -e 's/ //g' -e 's/RealFeel® //g' -e 's/<\/div>.*$//g' -e '15d' $HOME/Accuweather_Conky_USA_Images/curr_cond
sed -i -e 's/Humidity: //g' -e 's/Pressure: //g' -e 's/Cloud Cover: //g' -e 's/UV Index: //g' $HOME/Accuweather_Conky_USA_Images/curr_cond
sed -i -e 's/Dew Point: //g' -e 's/Amount of Precipitation(1 Hr): //g' -e 's/Visibility: //g' $HOME/Accuweather_Conky_USA_Images/curr_cond
sed -i 's/ i-alarm.*$//g' $HOME/Accuweather_Conky_USA_Images/curr_cond
time=$(sed -n 1p $HOME/Accuweather_Conky_USA_Images/curr_cond)
image=$(sed -n 2p $HOME/Accuweather_Conky_USA_Images/curr_cond)
if [[ $time == day ]]; then
sed -i 2s/$image/$(test_image_day $image)/ $HOME/Accuweather_Conky_USA_Images/curr_cond
elif [[ $time == night ]]; then
sed -i 2s/$image/$(test_image_night $image)/ $HOME/Accuweather_Conky_USA_Images/curr_cond
fi
cp $HOME/Accuweather_Conky_USA_Images/Forecast_Images/$(sed -n 2p $HOME/Accuweather_Conky_USA_Images/curr_cond).png $HOME/Accuweather_Conky_USA_Images/cc.png
fi
if [[ -s $HOME/Accuweather_Conky_USA_Images/tod_ton_raw ]]; then
#today - tonight - first 4 days
sed -i '/current first/,/<h4>Night<\/h4>/!d' $HOME/Accuweather_Conky_USA_Images/tod_ton_raw
egrep -i 'h3|"cond"|temp|icon i-|RealFeel' $HOME/Accuweather_Conky_USA_Images/tod_ton_raw > $HOME/Accuweather_Conky_USA_Images/tod_ton
sed -i -e 's/^.*"#">//' -e 's/<\/a>.*$//' $HOME/Accuweather_Conky_USA_Images/tod_ton
now=$(sed -n 1p $HOME/Accuweather_Conky_USA_Images/tod_ton)
if [[ $now == Tonight || $now == Overnight ]]; then
sed -i '1s/night/night\n/' $HOME/Accuweather_Conky_USA_Images/tod_ton
fi
sed -i -e 's/^.*icon i-//g' -e 's/^.*"cond">//g' $HOME/Accuweather_Conky_USA_Images/tod_ton
sed -i -e '1,21s/^.*"temp">//g' -e 's/^.*"">//g' -e 's/Lo<\/span> /\n/' $HOME/Accuweather_Conky_USA_Images/tod_ton
sed -i -e '27s/<span>°/\n/' -e 's/<\/a>.*$//g' -e 's/"><.*$//g' -e 's/<\/span><\/span> <span class="realfeel">RealFeel® //g' -e 's/^[ ,\t]*//g' $HOME/Accuweather_Conky_USA_Images/tod_ton
sed -i -e 's/^ *//g' -e '22s/<span>°/\n/' -e 's/<span>.*$//g' -e 's/<\/span>.*"temp">/\n/' $HOME/Accuweather_Conky_USA_Images/tod_ton
sed -i -e 's/<\/span>.*$//g' -e 's/°.*$//g' $HOME/Accuweather_Conky_USA_Images/tod_ton
sed -i -e 's/Tomorrow/TOMORROW/' -e 's/Monday/MONDAY/' -e 's/Tuesday/TUESDAY/' -e 's/Wednesday/WEDNESDAY/' -e 's/Thursday/THURSDAY/' -e 's/Friday/FRIDAY/' -e 's/Saturday/SATURDAY/' -e 's/Sunday/SUNDAY/' $HOME/Accuweather_Conky_USA_Images/tod_ton
sed -i 's/ i-alarm.*$//g' $HOME/Accuweather_Conky_USA_Images/tod_ton
for (( i=7; i<=22; i+=5 ))
do
image_raw=$(sed -n "${i}"p $HOME/Accuweather_Conky_USA_Images/tod_ton)
sed -i ${i}s/$image_raw/$(test_image_day $image_raw)/ $HOME/Accuweather_Conky_USA_Images/tod_ton
cp $HOME/Accuweather_Conky_USA_Images/Forecast_Images/$(sed -n ${i}p $HOME/Accuweather_Conky_USA_Images/tod_ton).png $HOME/Accuweather_Conky_USA_Images/$i.png
done
image_raw=$(sed -n 26p $HOME/Accuweather_Conky_USA_Images/tod_ton)
sed -i 26s/$image_raw/$(test_image_day $image_raw)/ $HOME/Accuweather_Conky_USA_Images/tod_ton
cp $HOME/Accuweather_Conky_USA_Images/Forecast_Images/$(sed -n 26p $HOME/Accuweather_Conky_USA_Images/tod_ton).png $HOME/Accuweather_Conky_USA_Images/today.png
image_raw=$(sed -n 30p $HOME/Accuweather_Conky_USA_Images/tod_ton)
sed -i 30s/$image_raw/$(test_image_night $image_raw)/ $HOME/Accuweather_Conky_USA_Images/tod_ton
cp $HOME/Accuweather_Conky_USA_Images/Forecast_Images/$(sed -n 30p $HOME/Accuweather_Conky_USA_Images/tod_ton).png $HOME/Accuweather_Conky_USA_Images/tonight.png
fi
if [[ -s $HOME/Accuweather_Conky_USA_Images/last_days_raw ]]; then
#last days
sed -i '/day=6/,/<h4>Night<\/h4>/!d' $HOME/Accuweather_Conky_USA_Images/last_days_raw
egrep -i 'h3|"cond"|temp|icon i-|RealFeel' $HOME/Accuweather_Conky_USA_Images/last_days_raw > $HOME/Accuweather_Conky_USA_Images/last_days
sed -i -e 's/^.*icon i-//g' -e 's/^.*"cond">//g' $HOME/Accuweather_Conky_USA_Images/last_days
sed -i -e '1,21s/^.*"temp">//g' -e 's/^.*"#">//g' -e 's/Lo<\/span> /\n/' $HOME/Accuweather_Conky_USA_Images/last_days
sed -i -e '27s/<span>°/\n/' -e 's/<\/a>.*$//g' -e 's/"><.*$//g' -e 's/<\/span><\/span> <span class="realfeel">RealFeel® //g' $HOME/Accuweather_Conky_USA_Images/last_days
sed -i -e 's/^ *//g' -e '22s/<span>°/\n/' -e 's/<span>.*$//g' -e 's/<\/span>.*"temp">/\n/' $HOME/Accuweather_Conky_USA_Images/last_days
sed -i -e 's/<\/span>.*$//g' -e 's/°.*$//g' -e 's/^[ ,\t]*//g' $HOME/Accuweather_Conky_USA_Images/last_days
sed -i -e 's/Monday/MONDAY/' -e 's/Tuesday/TUESDAY/' -e 's/Wednesday/WEDNESDAY/' -e 's/Thursday/THURSDAY/' -e 's/Friday/FRIDAY/' -e 's/Saturday/SATURDAY/' -e 's/Sunday/SUNDAY/' $HOME/Accuweather_Conky_USA_Images/last_days
sed -i 's/ i-alarm.*$//g' $HOME/Accuweather_Conky_USA_Images/last_days
for (( i=2; i<=22; i+=5 ))
do
image_raw=$(sed -n "${i}"p $HOME/Accuweather_Conky_USA_Images/last_days)
sed -i ${i}s/$image_raw/$(test_image_day $image_raw)/ $HOME/Accuweather_Conky_USA_Images/last_days
cp $HOME/Accuweather_Conky_USA_Images/Forecast_Images/$(sed -n ${i}p $HOME/Accuweather_Conky_USA_Images/last_days).png $HOME/Accuweather_Conky_USA_Images/N$i.png
done
fi
if [[ -s $HOME/Accuweather_Conky_USA_Images/tod_ton_raw && -s $HOME/Accuweather_Conky_USA_Images/last_days_raw ]]; then
#messages - messages_curr
sed -n 27p $HOME/Accuweather_Conky_USA_Images/tod_ton > $HOME/Accuweather_Conky_USA_Images/messages_curr
sed -n 31p $HOME/Accuweather_Conky_USA_Images/tod_ton >> $HOME/Accuweather_Conky_USA_Images/messages_curr
sed -n 8p $HOME/Accuweather_Conky_USA_Images/tod_ton > $HOME/Accuweather_Conky_USA_Images/messages_raw
sed -n 13p $HOME/Accuweather_Conky_USA_Images/tod_ton >> $HOME/Accuweather_Conky_USA_Images/messages_raw
sed -n 18p $HOME/Accuweather_Conky_USA_Images/tod_ton >> $HOME/Accuweather_Conky_USA_Images/messages_raw
sed -n 23p $HOME/Accuweather_Conky_USA_Images/tod_ton >> $HOME/Accuweather_Conky_USA_Images/messages_raw
sed -n 3p $HOME/Accuweather_Conky_USA_Images/last_days >> $HOME/Accuweather_Conky_USA_Images/messages_raw
sed -n 8p $HOME/Accuweather_Conky_USA_Images/last_days >> $HOME/Accuweather_Conky_USA_Images/messages_raw
sed -n 13p $HOME/Accuweather_Conky_USA_Images/last_days >> $HOME/Accuweather_Conky_USA_Images/messages_raw
sed -n 18p $HOME/Accuweather_Conky_USA_Images/last_days >> $HOME/Accuweather_Conky_USA_Images/messages_raw
sed -n 23p $HOME/Accuweather_Conky_USA_Images/last_days >> $HOME/Accuweather_Conky_USA_Images/messages_raw
for (( i=1; i<=4; i++))
do
no=$(sed -n ${i}p $HOME/Accuweather_Conky_USA_Images/messages_curr|wc -c)
if (( no<=31 )); then
sed -i $i"s/$/\n/" $HOME/Accuweather_Conky_USA_Images/messages_curr
i=$((i+1))
elif (( no>31 )); then
sed -i $i"s/^\(.\{31\}\)/\1\n/" $HOME/Accuweather_Conky_USA_Images/messages_curr
i=$((i+1))
fi
done
cat $HOME/Accuweather_Conky_USA_Images/messages_raw| cut -c -40 > $HOME/Accuweather_Conky_USA_Images/messages
for (( i=1; i<=18; i++))
do
no=$(sed -n ${i}p $HOME/Accuweather_Conky_USA_Images/messages|wc -c)
if (( no<=21 )); then
sed -i $i"s/$/\n/" $HOME/Accuweather_Conky_USA_Images/messages
i=$((i+1))
elif (( no>21 )); then
sed -i $i"s/^\(.\{21\}\)/\1\n/" $HOME/Accuweather_Conky_USA_Images/messages
i=$((i+1))
fi
done
fi
kill -CONT $(pidof conky)
luke@asus-desktop ~ $ ~/Conky/conky_start.sh
luke@asus-desktop ~ $ Conky: /home/luke/Conky/conky_weather: 1: no such configuration: ''
Conky: desktop window (e00022) is subwindow of root window (15d)
Conky: window type - normal
Conky: drawing to created window (0x2200002)
Conky: drawing to double buffer
Conky: desktop window (e00022) is subwindow of root window (15d)
Conky: window type - normal
Conky: drawing to created window (0x1c00002)
Conky: drawing to double buffer
${goto 125}${font Ubuntu:size=10}TEMP:${alignr 3}${execpi 600 sed -n '4p' /home/luke/Accuweather_Conky_USA_Images/curr_cond}°F (${execpi 600 sed -n '5p' /home/luke/Accuweather_Conky_USA_Images/curr_cond}°F)
${goto 125}WIND:${alignr 3}${execpi 600 sed -n '6p' /home/luke/Accuweather_Conky_USA_Images/curr_cond} ${execpi 600 sed -n '14p'/home/luke/Accuweather_Conky_USA_Images/curr_cond}
${goto 125}HUM:${alignr 3}${execpi 600 sed -n '7p' /home/luke/Accuweather_Conky_USA_Images/curr_cond}
${goto 125}CLOUDY:${alignr 3}${execpi 600 sed -n '9p' /home/luke/Accuweather_Conky_USA_Images/curr_cond}
${goto 125}PERCIP:${alignr 3}${execpi 600 sed -n '12p' /home/luke/Accuweather_Conky_USA_Images/curr_cond}
${goto 125}VISIB.:${alignr 3}${execpi 600 sed -n '13p' /home/luke/Accuweather_Conky_USA_Images/curr_cond}
${goto 125}SUNRISE:${alignr 3}${execpi 600 sed -n '15p' /home/luke/Accuweather_Conky_USA_Images/curr_cond}
${goto 125}SUNSET:${alignr 3}${execpi 600 sed -n '16p' /home/luke/Accuweather_Conky_USA_Images/curr_cond}


Users browsing this forum: rodez99 and 0 guests