Conky Showoff thread

Add functionality to your desktop
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
steveking

Re: Conky Showoff thread

Post by steveking »

I have nothing to show off conky wise as I have never used it. But I am very interested to know how you create some of these graphical marvels! I don't suppose anyone fancies or knows of a conky for complete idots tutorial? just the basics will do as I'm not a complete idot with Linux just conky!
The_Riskbreaker

Re: Conky Showoff thread

Post by The_Riskbreaker »

I second steveking's suggestion. When I saw @Sector11's Starfleet Terminal I was awestruck. And i'm not even a hardcore ST fan. (I like Voyager a little)
I have experience in coding languages like Basic/VB, RPG, HTML and i'm studying terminal... so this shouldn't be too hard. But a tutorial, perhaps a youtube vid would help.

If I was more knowledgable i'd do it.

Also, I think that the Starfleet Desktop is just a background of the colored bars, and use of Conky to place all the text. Can someone confirm that? I'd love to get that RC file just to study. The post is at (http://forums.linuxmint.com/viewtopic.p ... 80#p472035)
rakemup
Level 1
Level 1
Posts: 24
Joined: Wed Oct 20, 2010 6:08 pm

Re: Conky Showoff thread

Post by rakemup »

and here's my dual monitor desktop with conky on the right. I took a panarama picture of my backyard just as a storm approached.


Image
Screenshot%20from%202012-06-23%2017:52:22 by rakemup, on Flickr
and the .conkyrc file:

Code: Select all

# 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}
Last edited by Anonymous on Sat Jun 23, 2012 6:39 pm, edited 1 time in total.
Reason: on flickr, if you pick > share > BBCode and copy&paste the code here you get this clickable thumbnail
HughT

Re: Conky Showoff thread

Post by HughT »

To answer steveking and The Riskbreaker, I've started using Conky in the past few days and found the following sites useful.
http://conky.sourceforge.net/
http://manpages.ubuntu.com/manpages/luc ... nky.1.html
http://linux.die.net/man/1/conky
http://conky.pitstop.free.fr/wiki/index ... =Main_Page
http://crunchbanglinux.org/forums/topic ... -in-conky/
I'd assume the Star Trek theme uses an LCARS wallpaper and with one or more conkys. Here's mine, which is similar. It's a work in progress, so not yet perfect.
Sector11

Re: Conky Showoff thread

Post by Sector11 »

In case you are interested TeoBigusGeekus has moved his weather thread again. His new home is here: Conky weather scripts using Accuweather/WUnderground/NWS/Weather.com on the CrunchBang Forums.

Here's my latest set of conkys:
Image
Not taken today, but it hasn't changed.

The clock/calendar - mrpeachy LUA script
The weather - mrpeachy v9000 lua weather.
titetanium
Level 2
Level 2
Posts: 81
Joined: Mon Jun 18, 2012 4:26 pm

Re: Conky Showoff thread

Post by titetanium »

Image
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?
Sector11

Re: Conky Showoff thread

Post by Sector11 »

titetanium wrote:Image
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?
Would like to know what you have for the "windows" section. I use:

Code: Select all

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
Now if that gives you a transparent conky using "draw-bk.lua" will give you a semi-transparent background that you want:

draw.bk.lua

Code: Select all

--[[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
Without a composite manager you'll need to use both elements above TEXT

Code: Select all

lua_load ~/path_to/draw_bg.lua
lua_draw_hook_pre draw_bg 10 0 0 0 0 0x000000 0.5
TEXT
Hope that helps. See my conkys above that use "draw-bk.lua"

If this doesn't work post code for one of your conkys and I'll check it.
titetanium
Level 2
Level 2
Posts: 81
Joined: Mon Jun 18, 2012 4:26 pm

Re: Conky Showoff thread

Post by titetanium »

Code: Select all

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}
If I take out the images that I used in this conky, I get a transparent conky but it doesn't look as good to me. Here's a screenshot of what I'm talking about:
Image


I've tried using ARGB_visuals, but as I've noted, one would need a compositing manager to get that to work. I haven't played with conky.lua as I don't quite understand it yet.
mmesantos1

Re: Conky Showoff thread

Post by mmesantos1 »

Ok so I did some basic modding to this conkyrc file. Changed the font to Antipasto and fixed the offsets to work with the new font. Also edited CPU usage for dual core CPU's and lastley added arch info as well. Also colors have been changed as well. :D

Original conkyrc Gotham - Conky config by psyjunta: http://psyjunta.deviantart.com/art/Goth ... -205465419


Conky Download Link: http://mmesantos1.deviantart.com/art/Go ... -321918251
Image
Ginsu543

Re: Conky Showoff thread

Post by Ginsu543 »

You can better control the spacing if you use the {goto ###} command instead of the {offset ###} command in your .conkyrc.

Image
Aquix

Re: Conky Showoff thread

Post by Aquix »

Sorry. Posted in the wrong thread.. :roll:
lwfitz

Re: Conky Showoff thread

Post by lwfitz »

I posted this over on the #! forums where I usually hang out but I think everyone there went on vacation or something so hopefully you guys can help me out.
Im running LMDE Cinnamon and have conky starting from a startup script but my weather conky wont startup automatically. In fact when I run the script from a terminal it says its not a valid configuration file and then out of nowhere when I try to run it it will start up just fine. Heres what I get when I run the startup script from a terminal:

Code: Select all

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'
You can see it says Conky: /home/luke/Conky/conky_weather: 1: no such configuration: '' but this time it opened up. I tried like 30 times to get the weather conky to startup and it wouldnt do it. Now if I reboot I will have the same issue. Any ideas?

Heres the files:

conky_start.sh

Code: Select all

#!/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 &
conky_weather

Code: Select all

 
##############################################
#  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}

allcombined.lua

Code: Select all

--[[ 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
acc_usa_images

Code: Select all

#!/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/&deg;//g' -e 's/&nbsp;//g' -e 's/RealFeel&reg; //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>&deg;/\n/' -e 's/<\/a>.*$//g' -e 's/"><.*$//g' -e 's/<\/span><\/span> <span class="realfeel">RealFeel&reg; //g' -e 's/^[ ,\t]*//g' $HOME/Accuweather_Conky_USA_Images/tod_ton
    sed -i -e 's/^ *//g' -e '22s/<span>&deg;/\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/&deg;.*$//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>&deg;/\n/' -e 's/<\/a>.*$//g' -e 's/"><.*$//g' -e 's/<\/span><\/span> <span class="realfeel">RealFeel&reg; //g' $HOME/Accuweather_Conky_USA_Images/last_days
    sed -i -e 's/^ *//g' -e '22s/<span>&deg;/\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/&deg;.*$//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)





Thanks in advance for the help


After some trouble shooting and many reboots these lines in the weather conky seem to be the culprits but Im not sure how to fix it

Code: Select all

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
It seems to be something in these lines from the weather conky that are causing my problems

Code: Select all

${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}
Without them both conkys start up just fine


Image
mmesantos1

Re: Conky Showoff thread

Post by mmesantos1 »

Ok new conky mod. :D

Download Link: http://mmesantos1.deviantart.com/#/d5f1xyq
Image
RichTUK

Re: Conky Showoff thread

Post by RichTUK »

Image
werkman2
Level 1
Level 1
Posts: 43
Joined: Sun May 01, 2011 10:57 am
Location: curacao

Re: Conky Showoff thread

Post by werkman2 »

heres mine
homerscousin

Re: Conky Showoff thread

Post by homerscousin »

I just happened to be checking the conkies here and saw titetanium asking how to get translucency on the background instead of a solid color. I did manage that although I have not figured how to change the background color from the default black. If this is what you are trying to do here is my code and a screenshot. I'm still playing with this. I just want it fairly simple with the info I need and the colors to blend with the wallpaper. I still need to change some of the black text to a lighter color. It's a pain if I change wallpaper. I'll have to make a copy with a different color scheme to associate with each wallpaper I guess.
own_window yes
own_window_color e9967a
#own_window_transparent no
own_window_argb_visual yes
own_window_argb_value 25
#own_window_type override
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
conkypic2.png
werkman2
Level 1
Level 1
Posts: 43
Joined: Sun May 01, 2011 10:57 am
Location: curacao

Re: Conky Showoff thread

Post by werkman2 »

here a new one
Sector11

Re: Conky Showoff thread

Post by Sector11 »

Image
Doggie:
OH! OH! Pick me! Pick me!
Shamelessly borrowed, with modifications, from Voyager Linux while found on the ARCH forums.
Imagine that no shame anywhere. ;)

The Oneliner:

Code: Select all

#=== borrowed from: === Voyager Linux === http://voyager.legtux.org/ =========
###  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 black
own_window_class Conky
own_window_title OneLiner

# 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 override
own_window_argb_visual yes

### When ARGB visuals are enabled, this use this to modify the alpha value
### Valid range is 0-255, where 0 is 0% opacity, and 255 is 100% opacity.
#own_window_argb_value 200

#minimum_size 500 500 ## width, height
#maximum_width 500  ## width, usually a good idea to be '=' or '>' minimum width

gap_x -40 # left-right
gap_y 5 # up-down

alignment top_middle
###################################################  End Window Settings  ###
###  Font Settings  #########################################################
# Use Xft (anti-aliased font and stuff)
use_xft yes
xftfont DejaVu Sans Mono:size=9

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

draw_shades no
default_shade_color black

draw_outline no # amplifies text if yes
default_outline_color black

uppercase no
######################################################  End Font Settings  ###
###  Color Settings  #########################################################
default_shade_color grey
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 B22222 #178  34  34    FireBrick
#####################################################  End Color Settings  ###
###  Borders Section  ########################################################
draw_borders no
# Stippled borders?
stippled_borders 0
# border margins
border_inner_margin 0
border_outer_margin 0
# border width
border_width 0
# graph borders
draw_graph_borders no #yes
default_graph_size 15 40
#####################################################  End Borders Secton  ###
###  Miscellaneous Section  ##################################################

# Boolean value, if true, Conky will be forked to background when started.
background no

# 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

# Default and Minimum size is 256 - needs more for single commands that
# "call" a lot of text IE: bash scripts
text_buffer_size 256

# 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

##############################################  End Miscellaneous Section  ###
###  LUA Settings  ###########################################################
## Above and After TEXT - requires a composite manager or blinks.
##
# lua_load ~/Conky/LUA/draw-bg.lua
#TEXT
#${lua conky_draw_bg 10 0 0 0 0 0x000000 0.6}
#
## ${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 ~/Conky/LUA/draw-bg.lua
lua_draw_hook_pre draw_bg 5 0 0 0 0 0x000000 0.3
#
#######################################################  End LUA Settings  ###
# The all important - How often conky refreshes.
# If you have a "Crey" try: 0.2 - smokin' - but watch the CPU useage go UP!
update_interval 1


TEXT
 ${color6}HHD${color8} ${execi 15 hddtemp -n /dev/sda}°${color3} / ${color}${fs_free /} | ${fs_size /} ${color3}/home ${color}${fs_free /home} | ${fs_size /home}  ${color6}RAM${color} ${color3}${if_match ${memperc} < 10}00${memperc}\
${else}${if_match ${memperc} < 100}0${memperc}\
${else}${memperc}\
${endif}${endif} %${color} ${mem} | ${memmax}  ${color6}CPU ${color8}${platform f71882fg.2560 temp 1}°${color} ${color3}1|${color}${if_match ${cpu cpu1} < 10}00${cpu cpu1}\
${else}${if_match ${cpu cpu1} < 100}0${cpu cpu1}\
${else}${cpu cpu1}\
${endif}${endif}·${color3}2|${color}${if_match ${cpu cpu2} < 10}00${cpu cpu2}\
${else}${if_match ${cpu cpu2} < 100}0${cpu cpu2}\
${else}${cpu cpu2}\
${endif}${endif}·${color3}3|${color}${if_match ${cpu cpu3} < 10}00${cpu cpu3}\
${else}${if_match ${cpu cpu3} < 100}0${cpu cpu3}\
${else}${cpu cpu3}\
${endif}${endif}·${color3}A|${color}${color3}${if_match ${cpu cpu0} < 10}00${cpu cpu0}\
${else}${if_match ${cpu cpu0} < 100}0${cpu cpu0}\
${else}${cpu cpu0}\
${endif}${endif} % ${color6}GPU ${color8}${nvidia temp}° ${color3}Vid ${color}${nvidia gpufreq} Mhz${color3} MEM ${color}${nvidia memfreq} Mhz ${color6}MOBO${color8} ${platform f71882fg.2560 temp 2}°${color}
The Clock:

Code: Select all

#=== borrowed from: === Voyager Linux === http://voyager.legtux.org/ =========
#                               conkyrc_orange
#
#  author  : SLK
#  version : v2011011601
#  license : Distributed under the terms of GNU GPL version 2 or later
#
#=== Modified by: Sector11 09 Oct 12 =========================================
###  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 black
own_window_class Conky
own_window_title Clock

### 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 override
own_window_argb_visual yes

### When ARGB visuals are enabled, this use this to modify the alpha value
### Valid range is 0-255, where 0 is 0% opacity, and 255 is 100% opacity.
#own_window_argb_value 200

# 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

minimum_size 156 0 ## width, height
maximum_width 156  ## width

gap_x 5 # left-right
gap_y 5 # up-down

alignment top_left
###################################################  End Window Settings  ###
###  Font Settings  #########################################################
# Use Xft (anti-aliased font and stuff)
use_xft yes
xftfont WenQuanYi Micro Hei Mono:size=8

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

draw_shades no
default_shade_color black

draw_outline no # amplifies text if yes
default_outline_color black

uppercase no
######################################################  End Font Settings  ###
###  Color Settings  #########################################################
default_shade_color grey
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 B22222 #178  34  34    FireBrick
#####################################################  End Color Settings  ###
###  Borders Section  ########################################################
draw_borders no
# Stippled borders?
stippled_borders 0
# border margins
border_inner_margin 0
border_outer_margin 0
# border width
border_width 0
# graph borders
draw_graph_borders no #yes
default_graph_size 15 40
#####################################################  End Borders Secton  ###
###  Miscellaneous Section  ##################################################

# Boolean value, if true, Conky will be forked to background when started.
background no

# 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

# Default and Minimum size is 256 - needs more for single commands that
# "call" a lot of text IE: bash scripts
text_buffer_size 256

# 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

##############################################  End Miscellaneous Section  ###
###  LUA Settings  ###########################################################
## Above and After TEXT - requires a composite manager or blinks.
##
# lua_load ~/Conky/LUA/draw-bg.lua
#TEXT
#${lua conky_draw_bg 10 0 0 0 0 0x000000 0.6}
#
## ${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 ~/Conky/LUA/draw-bg.lua
lua_draw_hook_pre draw_bg 10 0 0 0 0 0x000000 0.3
#
lua_load ~/.conky/conky5/clock_conky.lua
lua_draw_hook_post main
#
#######################################################  End LUA Settings  ###
# The all important - How often conky refreshes.
# If you have a "Crey" try: 0.2 - smokin' - but watch the CPU useage go UP!
update_interval 1


TEXT
${voffset 55}${goto 55}${color7}${font White Rabbit:size=22}${time %e}${color1}${goto 45}${font WenQuanYi Micro Hei Mono:size=10}${time %a}
${goto 55}${color2}${font WenQuanYi Micro Hei Mono:size=9}${time %b}${color3} ${font WenQuanYi Micro Hei Mono:size=12}${time %y}${font}






NOTE: 6 blank lines at the end.

clock_conky.lua

Code: Select all

--==============================================================================
--  Modifired from: conky_orange.lua
--  author  : SLK
--  version : v2011011601
--  license : Distributed under the terms of GNU GPL version 2 or later
--
--  Sector11: 09 Oct 12 - clock_conky.lua
--==============================================================================

require 'cairo'

--------------------------------------------------------------------------------
--                                                                    clock DATA
-- HOURS
clock_h = {
    {
    name='time',                   arg='%H',                    max_value=12,
    x=78,                          y=80,
    graph_radius=53,
    graph_thickness=3,
    graph_unit_angle=30,           graph_unit_thickness=30,
    graph_bg_colour=0xffffff,      graph_bg_alpha=0.0,
    graph_fg_colour=0xFFFFFF,      graph_fg_alpha=0.3,
    txt_radius=34,
    txt_weight=1,                  txt_size=10.0,
    txt_fg_colour=0xFFFFFF,        txt_fg_alpha=0.6,
    graduation_radius=53,
    graduation_thickness=6,        graduation_mark_thickness=2,
    graduation_unit_angle=30,
    graduation_fg_colour=0xFFFFFF, graduation_fg_alpha=0.3,
    },
}
-- MINUTES
clock_m = {
    {
    name='time',                   arg='%M',                    max_value=60,
    x=78,                          y=80,
    graph_radius=57,
    graph_thickness=2,
    graph_unit_angle=6,            graph_unit_thickness=6,
    graph_bg_colour=0xffffff,      graph_bg_alpha=0.1,
    graph_fg_colour=0xFFFFFF,      graph_fg_alpha=0.3,
    txt_radius=70,
    txt_weight=0,                  txt_size=9.0,
    txt_fg_colour=0xFFFFFF,        txt_fg_alpha=0.6,
    graduation_radius=57,
    graduation_thickness=0,        graduation_mark_thickness=2,
    graduation_unit_angle=30,
    graduation_fg_colour=0xFFFFFF, graduation_fg_alpha=0.3,
    },
}
-- SECONDS
clock_s = {
    {
    name='time',                   arg='%S',                    max_value=60,
    x=78,                          y=80,
    graph_radius=50,
    graph_thickness=2,
    graph_unit_angle=6,            graph_unit_thickness=2,
    graph_bg_colour=0xffffff,      graph_bg_alpha=0.0,
    graph_fg_colour=0xFFFFFF,      graph_fg_alpha=0.2,
    txt_radius=40,
    txt_weight=0,                  txt_size=12.0,
    txt_fg_colour=0xFFFFFF,        txt_fg_alpha=0.3,
    graduation_radius=0,
    graduation_thickness=0,        graduation_mark_thickness=0,
    graduation_unit_angle=0,
    graduation_fg_colour=0xFFFFFF, graduation_fg_alpha=0.0,
    },
}

--------------------------------------------------------------------------------
--                                                                 rgb_to_r_g_b
-- converts color in hexa to decimal
--
function rgb_to_r_g_b(colour, alpha)
    return ((colour / 0x10000) % 0x100) / 255., ((colour / 0x100) % 0x100) / 255., (colour % 0x100) / 255., alpha
end

-------------------------------------------------------------------------------
--                                                            angle_to_position
-- convert degree to rad and rotate (0 degree is top/north)
--
function angle_to_position(start_angle, current_angle)
    local pos = current_angle + start_angle
    return ( ( pos * (2 * math.pi / 360) ) - (math.pi / 2) )
end

-------------------------------------------------------------------------------
--                                                              draw_clock_ring
-- displays clock
--
function draw_clock_ring(display, data, value)
    local max_value = data['max_value']
    local x, y = data['x'], data['y']
    local graph_radius = data['graph_radius']
    local graph_thickness, graph_unit_thickness = data['graph_thickness'], data['graph_unit_thickness']
    local graph_unit_angle = data['graph_unit_angle']
    local graph_bg_colour, graph_bg_alpha = data['graph_bg_colour'], data['graph_bg_alpha']
    local graph_fg_colour, graph_fg_alpha = data['graph_fg_colour'], data['graph_fg_alpha']

    -- background ring
    cairo_arc(display, x, y, graph_radius, 0, 2 * math.pi)
    cairo_set_source_rgba(display, rgb_to_r_g_b(graph_bg_colour, graph_bg_alpha))
    cairo_set_line_width(display, graph_thickness)
    cairo_stroke(display)

    -- arc of value
    local val = (value % max_value)
    local i = 1
    while i <= val do
        cairo_arc(display, x, y, graph_radius,(  ((graph_unit_angle * i) - graph_unit_thickness)*(2*math.pi/360)  )-(math.pi/2),((graph_unit_angle * i) * (2*math.pi/360))-(math.pi/2))
        cairo_set_source_rgba(display,rgb_to_r_g_b(graph_fg_colour,graph_fg_alpha))
        cairo_stroke(display)
        i = i + 1
    end
    local angle = (graph_unit_angle * i) - graph_unit_thickness

    -- graduations marks
    local graduation_radius = data['graduation_radius']
    local graduation_thickness, graduation_mark_thickness = data['graduation_thickness'], data['graduation_mark_thickness']
    local graduation_unit_angle = data['graduation_unit_angle']
    local graduation_fg_colour, graduation_fg_alpha = data['graduation_fg_colour'], data['graduation_fg_alpha']
    if graduation_radius > 0 and graduation_thickness > 0 and graduation_unit_angle > 0 then
        local nb_graduation = 360 / graduation_unit_angle
        local i = 1
        while i <= nb_graduation do
            cairo_set_line_width(display, graduation_thickness)
            cairo_arc(display, x, y, graduation_radius, (((graduation_unit_angle * i)-(graduation_mark_thickness/2))*(2*math.pi/360))-(math.pi/2),(((graduation_unit_angle * i)+(graduation_mark_thickness/2))*(2*math.pi/360))-(math.pi/2))
            cairo_set_source_rgba(display,rgb_to_r_g_b(graduation_fg_colour,graduation_fg_alpha))
            cairo_stroke(display)
            cairo_set_line_width(display, graph_thickness)
            i = i + 1
        end
    end

    -- text
    local txt_radius = data['txt_radius']
    local txt_weight, txt_size = data['txt_weight'], data['txt_size']
    local txt_fg_colour, txt_fg_alpha = data['txt_fg_colour'], data['txt_fg_alpha']
    local movex = txt_radius * (math.cos((angle * 2 * math.pi / 360)-(math.pi/2)))
    local movey = txt_radius * (math.sin((angle * 2 * math.pi / 360)-(math.pi/2)))
    cairo_select_font_face (display, "ubuntu", CAIRO_FONT_SLANT_NORMAL, txt_weight);
    cairo_set_font_size (display, txt_size);
    cairo_set_source_rgba (display, rgb_to_r_g_b(txt_fg_colour, txt_fg_alpha));
    cairo_move_to (display, x + movex - (txt_size / 2), y + movey + 3);
    cairo_show_text (display, value);
    cairo_stroke (display);
end

-------------------------------------------------------------------------------
--                                                               go_clock_rings
-- loads data and displays clock
--
function go_clock_rings(display)
    local function load_clock_rings(display, data)
        local str, value = '', 0
        str = string.format('${%s %s}',data['name'], data['arg'])
        str = conky_parse(str)
        value = tonumber(str)
        draw_clock_ring(display, data, value)
    end

    for i in pairs(clock_h) do
        load_clock_rings(display, clock_h[i])
    end
    for i in pairs(clock_m) do
        load_clock_rings(display, clock_m[i])
    end
    for i in pairs(clock_s) do
        load_clock_rings(display, clock_s[i])
    end
end

-------------------------------------------------------------------------------
--                                                                         MAIN
function conky_main()
    if conky_window == nil then
        return
    end

    local cs = cairo_xlib_surface_create(conky_window.display, conky_window.drawable, conky_window.visual, conky_window.width, conky_window.height)
    local display = cairo_create(cs)

--[[    local updates = conky_parse('${updates}')
    update_num = tonumber(updates)

    if update_num > 5 then ]]
        go_clock_rings(display)
        go_gauge_rings(display)
    --end

end
Sector11

Re: Conky Showoff thread

Post by Sector11 »

steveking wrote:I have nothing to show off conky wise as I have never used it. But I am very interested to know how you create some of these graphical marvels! I don't suppose anyone fancies or knows of a conky for complete idots tutorial? just the basics will do as I'm not a complete idot with Linux just conky!
Did you get any help? How about this (old but still good): HOW TO: A Beginners Guide to Setting up Conky
User avatar
xxmlud
Level 3
Level 3
Posts: 108
Joined: Tue Apr 03, 2012 5:57 pm
Location: Made in user

Re: Conky Showoff thread

Post by xxmlud »

RichTUK wrote:Image

Code?

Thx
ImageImage
¡Made for YOU!
Locked

Return to “Compiz, Conky, Docks & Widgets”