Conky Showoff thread

Forum rules
Before you post please read how to get help
EthernetHub
Level 1
Level 1
Posts: 2
Joined: Wed Mar 02, 2011 8:06 am

Re: Conky Showoff thread

Post by EthernetHub » Thu Nov 05, 2015 4:56 am

achillies wrote:heres mine simple and neat and color coordinated ;)
Borrowed a few bits from here and there and modified
This is a really great theme, but I was wondering if you could provide the icons you've used: the clock at the top and all the icons along the side for the Kernel, Uptime, Temperature, etc.

Again, it's so gorgeous! It's just it looks kinda off without the icons :lol:

User avatar
mzsade
Level 5
Level 5
Posts: 777
Joined: Sun Jul 19, 2009 4:36 am

Re: Conky Showoff thread

Post by mzsade » Sun Nov 22, 2015 12:34 pm

2015-11-27-133033_scrot.png
Couldn't get my conky to work on LMDE, sorry. This is from my Debian partition. It's uhm..functional and the lua clock is the only adornment. :)

Conky;

Code: Select all

conky.config = {
    alignment = 'top_right',
    background = false,
    border_inner_margin = 3,
    border_width = 4,
    cpu_avg_samples = 2,
    top_cpu_separate = false,
    default_color = '#F7F5F5',
    draw_borders = true,
    draw_graph_borders = true,
    draw_outline = false,
    draw_shades = false,
    use_xft = true,
    font = 'DejaVu Sans Mono:bold:size=12',
    gap_x = 20,
    gap_y = 20,
    minimum_height = 5,
    minimum_width = 342,
    net_avg_samples = 2,
    no_buffers = true,
    double_buffer = true,
    out_to_console = false,
    out_to_stderr = false,
    extra_newline = false,
    own_window = true,
    own_window_transparent = true,
    own_window_argb_visual = true,
    own_window_class = 'Conky',
    own_window_hints = 'undecorated',
    override_utf8_locale = true,
    stippled_borders = 0,
    update_interval = 10.0,
    uppercase = false,
    use_spacer = 'none',
    show_graph_scale = false,
    show_graph_range = false,
    hddtemp_host,
    hddtemp_port,
    hddtemp_refresh,
    temperature_unit = celsius,
    lua_load = '~/scripts/clock.lua',
    lua_draw_hook_pre = 'draw_clock'
}
conky.text = [[
${color}${font LCDMono:bold:size=12} 
$alignc $distribution Sid
$alignc $sysname $kernel
$alignc${color}$font${time %a,%e %b,%Y}
$alignc$color$font${time %I:%M:%S %p}

 ${execi 1800 tail -n 2 /tmp/conky-daylight-inf.result}
${hr 3}
$alignc ${color}${font}Uptime:$color$uptime
${hr 3}
${color} RAM: $mem $memwithbuffers $memperc%
         ${memwithbuffersbar 3,200}        
${color} Swap:$swap  $alignc $swapperc%
${hr 3}
 Core1:$color${cpu cpu1}%      ${alignc}CPU$alignr${if_existing /sys/class/hwmon/hwmon1/temp2_input} Temp:${hwmon 1 temp 2}°C ${else} Temp:${hwmon 2 temp 2}°C ${endif}
 Core2:$color${cpu cpu2}%      $alignc ${cpu cpu0}%$alignr${if_existing /sys/class/hwmon/hwmon1/temp3_input} Temp:${hwmon 1 temp 3}°C ${else} Temp:${hwmon 2 temp 3}°C ${endif}
 Core3:$color${cpu cpu3}%     $alignc Freq$alignr${if_existing /sys/class/hwmon/hwmon1/temp4_input} Temp:${hwmon 1 temp 4}°C ${else} Temp:${hwmon 2 temp 4}°C ${endif}
 Core4:$color${cpu cpu4}%    $alignc ${freq}MHz $alignr${if_existing /sys/class/hwmon/hwmon1/temp5_input} Temp:${hwmon 1 temp 5}°C ${else} Temp:${hwmon 2 temp 5}°C ${endif}
${hr 3}
$alignc HDD Temp:$color${hddtemp /dev/sda}°C
 Root: ${fs_used /} $alignc Used:${fs_used_perc /}%
        ${fs_bar 3, 200 /}
 Home: ${fs_used /home} $alignc Used:${fs_used_perc /home}%
${hr 3}
$alignc${addr} eth0 
 Down Speed:${downspeed eth0}
 Up Speed:  ${upspeed eth0} 
${hr 3}
  Top Process       CPU    Memory
 ${top name 1} ${top cpu 1}% ${top mem 1}%
 ${top name 2} ${top cpu 2}% ${top mem 2}%
 ${top name 3} ${top cpu 3}% ${top mem 3}%
 ${top name 4} ${top cpu 4}% ${top mem 4}%
 ${top name 5} ${top cpu 5}% ${top mem 5}%
${hr 3}
${alignc}Battery
 ${battery BAT0} ${battery_percent BAT0}
]]
Lua Clock;

Code: Select all

--[[
Air Clock by Alison Pitt (2009)
This clock is designed to look like KDE 4.3's "Air" clock, but from inside Conky.
You can adjust the clock's radius and placement, as well as the size and offset of the drop shadow. You can also choose whether to display the seconds hand. This clock updates every time Conky does, so if you want to show seconds, it is recommended that you set update_interval to no more than 0.5s. If you turn off seconds, you can set the update_interval to as long as 30s.  The settings are in the "Settings" section, starting at Line 21.
Call this script in Conky using the following before TEXT (assuming you save this script to ~/scripts/clock.lua):
	lua_load ~/scripts/clock.lua
	lua_draw_hook_pre draw_clock
]]

require 'cairo'
function conky_draw_clock()
	if conky_window==nil then return end
	local w=conky_window.width
	local h=conky_window.height
	local cs=cairo_xlib_surface_create(conky_window.display, conky_window.drawable, conky_window.visual, w, h)
	cr=cairo_create(cs)
			
	-- Settings
	
		-- What radius should the clock face (not including border) be, in pixels?
		
		local clock_r=36
	
		-- x and y coordinates, relative to the top left corner of Conky, in pixels
		
		local xc=315
		local yc=126
	
		-- Extent of the shadow, in pixels
		
		shadow_width=5
		
		-- x and y offsets of the drop shadow, relative to the centre of the clock face, in pixels. Can be positive (downward) or negative (upward)
		
		shadow_xoffset=0
		shadow_yoffset=2
		
		-- Do you want to show the second hand? Use this if you use a Conky update_interval > 1s. Can be true or false.
		
		show_seconds=true
	
	-- Grab time
	
	local hours=os.date("%I")
	local mins=os.date("%M")
	local secs=os.date("%S")
	
	secs_arc=(2*math.pi/60)*secs
	mins_arc=(2*math.pi/60)*mins
	hours_arc=(2*math.pi/12)*hours+mins_arc/12
	
	-- Drop shadow
	
	local ds_pat=cairo_pattern_create_radial(xc+shadow_xoffset,yc+shadow_yoffset,clock_r*1.25,xc+shadow_xoffset,yc+shadow_yoffset,clock_r*1.25+shadow_width)
	cairo_pattern_add_color_stop_rgba(ds_pat,0,0,0,0,0.2)
	cairo_pattern_add_color_stop_rgba(ds_pat,1,0,0,0,0)
	
	cairo_move_to(cr,0,0)
	cairo_line_to(cr,w,0)
	cairo_line_to(cr,w,h)
	cairo_line_to(cr,0,h)
	cairo_new_sub_path(cr)
	cairo_arc(cr,xc,yc,clock_r*1.25,0,2*math.pi)
	cairo_set_source(cr,ds_pat)
	cairo_set_fill_rule(cr,CAIRO_FILL_RULE_EVEN_ODD)
	cairo_fill(cr)
	
	-- Glassy border
	
	cairo_arc(cr,xc,yc,clock_r*1.25,0,2*math.pi)
	cairo_set_source_rgba(cr,0.5,0.5,0.5,0.2)
	cairo_set_line_width(cr,1)
	cairo_stroke(cr)
	
	local border_pat=cairo_pattern_create_linear(xc,yc-clock_r*1.25,xc,yc+clock_r*1.25)
	
	cairo_pattern_add_color_stop_rgba(border_pat,0,1,1,1,0.7)
	cairo_pattern_add_color_stop_rgba(border_pat,0.3,1,1,1,0)
	cairo_pattern_add_color_stop_rgba(border_pat,0.5,1,1,1,0)
	cairo_pattern_add_color_stop_rgba(border_pat,0.7,1,1,1,0)
	cairo_pattern_add_color_stop_rgba(border_pat,1,1,1,1,0.7)
	cairo_set_source(cr,border_pat)
	cairo_arc(cr,xc,yc,clock_r*1.125,0,2*math.pi)
	cairo_close_path(cr)
	cairo_set_line_width(cr,clock_r*0.25)
	cairo_stroke(cr)
	
	-- Set clock face
	
	cairo_arc(cr,xc,yc,clock_r,0,2*math.pi)
	cairo_close_path(cr)
	
	local face_pat=cairo_pattern_create_radial(xc,yc-clock_r*0.75,0,xc,yc,clock_r)
	
	cairo_pattern_add_color_stop_rgba(face_pat,0,1,1,1,0.9)
	cairo_pattern_add_color_stop_rgba(face_pat,0.5,1,1,1,0.9)
	cairo_pattern_add_color_stop_rgba(face_pat,1,0.9,0.9,0.9,0.9)
	cairo_set_source(cr,face_pat)
	cairo_fill_preserve(cr)
	cairo_set_source_rgba(cr,0.5,0.5,0.5,0.2)
	cairo_set_line_width(cr, 1)
	cairo_stroke (cr)
	
	-- Draw hour hand
	
	xh=xc+0.7*clock_r*math.sin(hours_arc)
	yh=yc-0.7*clock_r*math.cos(hours_arc)
	cairo_move_to(cr,xc,yc)
	cairo_line_to(cr,xh,yh)
	
	cairo_set_line_cap(cr,CAIRO_LINE_CAP_ROUND)
	cairo_set_line_width(cr,5)
	cairo_set_source_rgba(cr,0,0,0,0.5)
	cairo_stroke(cr)
	
	-- Draw minute hand
	
	xm=xc+0.9*clock_r*math.sin(mins_arc)
	ym=yc-0.9*clock_r*math.cos(mins_arc)
	cairo_move_to(cr,xc,yc)
	cairo_line_to(cr,xm,ym)
	
	cairo_set_line_width(cr,3)
	cairo_stroke(cr)
	
	-- Draw seconds hand
	
	if show_seconds then
		xs=xc+0.9*clock_r*math.sin(secs_arc)
		ys=yc-0.9*clock_r*math.cos(secs_arc)
		cairo_move_to(cr,xc,yc)
		cairo_line_to(cr,xs,ys)
	
		cairo_set_line_width(cr,1)
		cairo_stroke(cr)
                cairo_destroy(cr)
	        cairo_surface_destroy(c)
	end
        
end
Linux User #481272 Reg: 15th Sept., 2008

User avatar
Sector11
Level 3
Level 3
Posts: 175
Joined: Mon Nov 22, 2010 10:33 am

Re: Conky Showoff thread

Post by Sector11 » Sun Jan 10, 2016 12:45 pm

EthernetHub wrote:Again, it's so gorgeous! It's just it looks kinda off without the icons :lol:
Look in the code: clock_rings.lua or the post directly above this.

Aand the 'icons':

Code: Select all

${font PizzaDude Bullets:size=12}
You need the font: PizzaDude Bullets
Using: BunsenLabs based on Debian Stable.
Conky PitStop

grzegorzdabrowka
Level 1
Level 1
Posts: 6
Joined: Mon Jan 11, 2016 2:10 pm

Re: Conky Showoff thread

Post by grzegorzdabrowka » Mon Jan 11, 2016 2:38 pm

Image
send me screen, corrections, comments or every interesting parts of code: GrzegorzDabrowka[at]gmail.com
code on the website http://htmelek.republika.pl/

User avatar
Sector11
Level 3
Level 3
Posts: 175
Joined: Mon Nov 22, 2010 10:33 am

Re: Conky Showoff thread

Post by Sector11 » Mon Jan 11, 2016 3:06 pm

grzegorzdabrowka wrote:Image
send me screen, corrections, comments or every interesting parts of code: GrzegorzDabrowka[at]gmail.com
code on the website http://htmelek.republika.pl/
In the screenshot it looks like you are not getting correct character rendering: Image
Do you have these set above TEXT:

Code: Select all

use_xft yes
xftfont Liberation Mono:bold:size=11
## Alpha of Xft font. Must be a value at or between 1 and 0
xftalpha 1.0
## Force UTF8? requires XFT
override_utf8_locale yes
You can use any font that supports the characters you require.
Using: BunsenLabs based on Debian Stable.
Conky PitStop

grzegorzdabrowka
Level 1
Level 1
Posts: 6
Joined: Mon Jan 11, 2016 2:10 pm

Re: Conky Showoff thread

Post by grzegorzdabrowka » Fri Jan 15, 2016 8:26 pm

Sector11 wrote: In the screenshot it looks like you are not getting correct character rendering: Image
Do you have these set above TEXT:

Code: Select all

use_xft yes
xftfont Liberation Mono:bold:size=11
## Alpha of Xft font. Must be a value at or between 1 and 0
xftalpha 1.0
## Force UTF8? requires XFT
override_utf8_locale yes
You can use any font that supports the characters you require.
corrected

Image

send me screen, corrections, comments, ideas or every interesting parts of code: GrzegorzDabrowka[at]gmail.com
code on the website http://htmelek.republika.pl/

User avatar
Sector11
Level 3
Level 3
Posts: 175
Joined: Mon Nov 22, 2010 10:33 am

Re: Conky Showoff thread

Post by Sector11 » Sat Jan 16, 2016 10:44 am

grzegorzdabrowka wrote:corrected
How about three calendars where you have one?
Image <---> Image

Code: Select all

${hr}
${color1}${goto 10}${execpi 900 ncal -bh -m `date +%m` -A-1 -B1 | sed ':a;N;$!ba;s/\n/\n${goto 10}/g'}
${voffset -96}${goto 145}      ${color5}${time %b %Y}${color}
${goto 145}${if_match "${time %a}" == "Sun"}${color5}Su${color1} Mo Tu We Th Fr Sa${else}\
${if_match "${time %a}" == "Mon"}${color1}Su ${color5}Mo${color1} Tu We Th Fr Sa${else}\
${if_match "${time %a}" == "Tue"}${color1}Su Mo ${color5}Tu${color1} We Th Fr Sa${else}\
${if_match "${time %a}" == "Wed"}${color1}Su Mo Tu ${color5}We${color1} Th Fr Sa${else}\
${if_match "${time %a}" == "Thu"}${color1}Su Mo Tu We ${color5}Th${color1} Fr Sa${else}\
${if_match "${time %a}" == "Fri"}${color1}Su Mo Tu We Th ${color5}Fr${color1} Sa${else}\
${color1}Su Mo Tu We Th Fr ${color5}Sa${color1}${endif}${endif}${endif}${endif}${endif}${endif}
${goto 145}${execpi 900 LAR=`date +%-d`; ncal -bh | sed '2d' | sed -e '1d' -e 's/\<'$LAR'\>/${color5}&${color1}/' | sed ':a;N;$!ba;s/\n/\n${goto 145}/g'}${color}
${color1}${voffset -96}${goto 280}${execpi 900 ncal -bh -m `date +%m` -A1 -B-1 | sed ':a;N;$!ba;s/\n/\n${goto 280}/g'}
${color}${hr}
Using: BunsenLabs based on Debian Stable.
Conky PitStop

grzegorzdabrowka
Level 1
Level 1
Posts: 6
Joined: Mon Jan 11, 2016 2:10 pm

Re: Conky Showoff thread

Post by grzegorzdabrowka » Sun Jan 17, 2016 1:13 pm

Sector11 wrote: How about three calendars where you have one?
good idea

Code: Select all

${color2}Calendar: ${color1}${time  %a %d %b}${alignr}${time %G-%m-%d %H}:${time %M}${blink :}${time %S }\
${if_match ${time %H}<=12}p.m.${else}${if_match ${time %H}>12}a.m.${endif}${endif} ${time %Z %z}
# month back
${color3}${execpi 900 ncal -bh -m `date +%m` -A-1 -B1 | sed ':a;N;$!ba;s/\n/\${color3}\n${goto 0}/g'}
#
# month actual
${goto 150}${voffset -91}${color2}${time %B %Y}
\
${goto 123}${voffset 0}\
${color3}\
${if_match "${time %u}" == "1"}${color2}Mo ${color1}${else}Mo ${endif}\
${if_match "${time %u}" == "2"}${color2}Tu ${color1}${else}Tu ${endif}\
${if_match "${time %u}" == "3"}${color2}We ${color1}${else}We ${endif}\
${if_match "${time %u}" == "4"}${color2}Tr ${color1}${else}Tr ${endif}\
${if_match "${time %u}" == "5"}${color2}Fr ${color1}${else}Fr ${endif}\
${if_match "${time %u}" == "6"}${color2}Sa ${color1}${else}Sa ${endif}\
${if_match "${time %u}" == "7"}${color2}Su ${color1}${else}Su ${endif}
\
${color3}${goto 124}${color3}${execpi 900 LAR=`date +%-d`; ncal -bh -A  -B0  | sed '2d' | sed -e '1d' -e 's/\<'$LAR'\>/${color2}&${color1}/' | sed ':a;N;$!ba;s/\n/\n${goto 124}/g'}
#
# month next
${voffset -104}${goto 250}${color1}\
${execpi 900 ncal -bh -m `date +%m` -A1 -B-1 | sed ':a;N;$!ba;s/\n/\n${goto 249}/g'}
#
${voffset -20}${color3}${stippled_hr}
#
#
#
#
#
#${time %a a   %A A}
#${time %b b   %B B}
#${time %c c   %C C}
#${time %d d   %D D}
#${time %e e}
#${time %F F}
#${time %g g   %G G}
#${time %h h   %H H}
#${time %I I}
#${time %j j}
#${time %l l}
#${time %m m   %M M}
#${time %n n}
#${time %p p   %P P}
#${time %r r   %R R}
#${time %S S}
#${time %t t   %T T}
#${time %u u   %U U}
#${time %V V}
#${time %w w   %W W}
#${time %x x   %X X}
#${time %y y   %Y Y}
#${time %z z   %Z Z}
#${tztime} tz ${utime} u
#
#${color3}\
${if_match "${time %u}" == "1"}${color2}Mo ${color1}${else}Mo ${endif}\
${if_match "${time %u}" == "2"}${color2}Tu ${color1}${else}Tu ${endif}\
${if_match "${time %u}" == "3"}${color2}We ${color1}${else}We ${endif}\
${if_match "${time %u}" == "4"}${color2}Tr ${color1}${else}Tr ${endif}\
${if_match "${time %u}" == "5"}${color2}Fr ${color1}${else}Fr ${endif}\
${if_match "${time %u}" == "6"}${color2}Sa ${color1}${else}Sa ${endif}\
${if_match "${time %u}" == "7"}${color2}Su ${color1}${else}Su ${endif}
I have too long code, and no display
Image

but it working
Image

Image

Image

send me screen, corrections, comments, ideas or every interesting parts of code: GrzegorzDabrowka[at]gmail.com
code on the website http://htmelek.republika.pl/

User avatar
Sector11
Level 3
Level 3
Posts: 175
Joined: Mon Nov 22, 2010 10:33 am

Re: Conky Showoff thread

Post by Sector11 » Sun Jan 17, 2016 4:50 pm

grzegorzdabrowka wrote:I have too long code, and no display
Increase: text buffer size a little maybe 1024

Code: Select all

## Maximum size of user text buffer,
## i.e. layout below TEXT
## default is 16384 bytes
max_user_text 17408
TEXT
Nice tweaks ... saved! 8)

I think the commented line are a part of the text buffer size as well. Eliminate some comment lines below TEXT might also help.
Using: BunsenLabs based on Debian Stable.
Conky PitStop

grzegorzdabrowka
Level 1
Level 1
Posts: 6
Joined: Mon Jan 11, 2016 2:10 pm

Re: Conky Showoff thread

Post by grzegorzdabrowka » Sun Jan 24, 2016 1:10 pm

Sector11 wrote: max_user_text 16384 #default is bytes
TEXT
thx "Sector11"

"Last" version in one file.
DOWNLOAD Universal ConfConky v.003 2016.01.24 password "conky"

Image_Image

send me screen, corrections, comments, ideas or every interesting parts of code: GrzegorzDabrowka[at]gmail.com
code on the website http://htmelek.republika.pl/

User avatar
Sector11
Level 3
Level 3
Posts: 175
Joined: Mon Nov 22, 2010 10:33 am

Re: Conky Showoff thread

Post by Sector11 » Sun Jan 24, 2016 1:34 pm

^ Glad to help.
Using: BunsenLabs based on Debian Stable.
Conky PitStop

Frankula
Level 1
Level 1
Posts: 10
Joined: Sat Jan 31, 2015 10:43 pm

Re: Conky Showoff thread

Post by Frankula » Wed Jan 27, 2016 12:33 am

Attachments
Frankula Conky
Frankula Conky
Entropy ain't what it used to be...

User avatar
Sector11
Level 3
Level 3
Posts: 175
Joined: Mon Nov 22, 2010 10:33 am

Re: Conky Showoff thread

Post by Sector11 » Wed Jan 27, 2016 8:36 am

Frankula wrote:This Conky can be downloaded here: https://www.dropbox.com/s/etdjnu1aqbjpt ... ar.gz?dl=0
Interesting stuff. One OOPS!

Code: Select all

${font QuickType Pi:size=10}
In my version of your README I made a change (for future reference):

Code: Select all

	You can use any font you wish, however you will need the Xirod and
	QuickType Pi fonts to make the conky display as intended.
	If you do not have these fonts, they are available at:

	http://www.dafont.com/xirod.font
	http://ufonts.com/fonts/quicktype-pi.html
Other than the RED, which is my least favourite colour, some really nice stuff in your conky. :)

Weather isn't working for me. It's saying 17°C - not quite, it 24°C must check that too.
Using: BunsenLabs based on Debian Stable.
Conky PitStop

Frankula
Level 1
Level 1
Posts: 10
Joined: Sat Jan 31, 2015 10:43 pm

Re: Conky Showoff thread

Post by Frankula » Thu Jan 28, 2016 1:28 am

Maybe green is more to your liking :

https://www.dropbox.com/s/j0ygqyrg0is5s ... ar.gz?dl=0
Attachments
Spider Void Screenshot.png
Entropy ain't what it used to be...

User avatar
Sector11
Level 3
Level 3
Posts: 175
Joined: Mon Nov 22, 2010 10:33 am

Re: Conky Showoff thread

Post by Sector11 » Thu Jan 28, 2016 6:50 am

Frankula wrote:Maybe green is more to your liking :

https://www.dropbox.com/s/j0ygqyrg0is5s ... ar.gz?dl=0
That's NICE! Thank you. And easier for these old eyes to see. :)
Using: BunsenLabs based on Debian Stable.
Conky PitStop

User avatar
mzsade
Level 5
Level 5
Posts: 777
Joined: Sun Jul 19, 2009 4:36 am

Re: Conky Showoff thread

Post by mzsade » Sat Feb 06, 2016 2:33 am

Scrounged the web and put together a "minimalist" :lol: weather conky

Code: Select all

${execi 20 weather -m VABB | tail -n 5}
${alignc}Sunrise ${execi 30 l=29220026;curl -s http://weather.yahooapis.com/forecastrss?w=$l|grep astronomy| awk -F\" '{print $2}'}
${alignc}Sunset  ${execi 40 l=29220026;curl -s http://weather.yahooapis.com/forecastrss?w=$l|grep astronomy| awk -F\" '{print $4}'}
${execi 50 curl -s http://www.timeanddate.com/moon/india/mumbai|grep Moon| awk -F\" '{print $64}' | tail -n 1}
${execi 60 curl -s http://www.timeanddate.com/moon/india/mumbai|grep Moon| awk -F\" '{print $72}' | tail -n 1}
Edit: Nope, that Moon data was all wrong, i don't know didleysquat about using awk. This is correct even if clumsy.

Code: Select all

${execi 20 weather -m VABB | tail -n 4}
${execi 50 echo 'http://www.timeanddate.com/astronomy/india/mumbai'| wget -O- -i- | hxnormalize -x | lynx -stdin -dump > Moonrise && cat Moonrise | head -n 131 | tail -n 7}
Weather.png
Linux User #481272 Reg: 15th Sept., 2008

User avatar
Sector11
Level 3
Level 3
Posts: 175
Joined: Mon Nov 22, 2010 10:33 am

Re: Conky Showoff thread

Post by Sector11 » Sat Feb 06, 2016 8:29 am

@ mzsade

Interesting - a couple of questions;
1. What is the first line: ${execi 20 weather -m VABB | tail -n 5} I get nothing with that.
See: weather

2. Where does one find: l=29220026 <-- that number for different locations?

I trimmed back the Moon rise set limes a little so they are not so wide (for my location)

Code: Select all

${execi 20 weather -m SABE | tail -n 5}
${alignc}Sunrise ${execi 30 l=29220026;curl -s http://weather.yahooapis.com/forecastrss?w=$l|grep astronomy| awk -F\" '{print $2}'}
${alignc}Sunset  ${execi 40 l=29220026;curl -s http://weather.yahooapis.com/forecastrss?w=$l|grep astronomy| awk -F\" '{print $4}'}
 Moonrise ${execi 50 curl -s http://www.timeanddate.com/moon/argentina/buenos-aires|grep Moon| awk -F\" '{print $64}' | tail -n 1 |cut -c23-}
 Moonset  ${execi 60 curl -s http://www.timeanddate.com/moon/argentina/buenos-aires|grep Moon| awk -F\" '{print $72}' | tail -n 1 |cut -c22-}

Temp: ${weather http://weather.noaa.gov/pub/data/observations/metar/stations/ SABE temperature}°
Pressure: ${weather http://weather.noaa.gov/pub/data/observations/metar/stations/ SABE pressure} hPa
Humidity: ${weather http://weather.noaa.gov/pub/data/observations/metar/stations/ SABE humidity}%
Wind: ${weather http://weather.noaa.gov/pub/data/observations/metar/stations/ SABE wind_dir} (${weather http://weather.noaa.gov/pub/data/observations/metar/stations/ SABE wind_dir_DEG}°) @ ${weather http://weather.noaa.gov/pub/data/observations/metar/stations/ SABE wind_speed} k/h
Cloud cover: ${weather http://weather.noaa.gov/pub/data/observations/metar/stations/ SABE cloud_cover}
Last Update: ${weather http://weather.noaa.gov/pub/data/observations/metar/stations/ SABE last_update}
Image

I have always thought timeanddate.com would be a great place for conky. But I am CLI challenged.
Using: BunsenLabs based on Debian Stable.
Conky PitStop

User avatar
mzsade
Level 5
Level 5
Posts: 777
Joined: Sun Jul 19, 2009 4:36 am

Re: Conky Showoff thread

Post by mzsade » Sat Feb 06, 2016 8:50 am

Hi, I am using weather-util for the first line. VABB is the station code for Mumbai Santacruz airport. Alternatively, you can use FIPS code for your area.
About that number; you visit weather.yahoo.com and enter your zip code or city name. The url displayed in the address bar after pressing Enter will have that number.

Btw, are you sure you have the correct moon data for your area because i arrived at "print$64" and "print$72" quite randomly. That's why i dumped curl and awk and used wget instead.
Reference: http://www.joyofdata.de/blog/using-linu ... mment-1100
Now if only i could adapt hxselect correctly..

Edit: There, now i am getting everything from timeanddate.com;

Code: Select all

conky.text = [[
$alignc${font LCDMono:bold:size=12}${time %a,%e %b,%Y}
$alignc${time %I:%M:%S %p}
${execi 20 echo 'http://www.timeanddate.com/weather/india/mumbai'| wget -O- -i- | hxnormalize -x | lynx -stdin -dump > Weather && grep . ~/Weather > weather &&sed -i '113,115d' weather && cat weather | head -n 116 | tail -n 9}
${execi 50 echo 'http://www.timeanddate.com/astronomy/india/mumbai'| wget -O- -i- | hxnormalize -x | lynx -stdin -dump > Moonrise && grep . Moonrise > moonrise && sed -i '110d' moonrise && cat moonrise | head -n 114 | tail -n 7}
]]
Weather.png
Linux User #481272 Reg: 15th Sept., 2008

User avatar
Sector11
Level 3
Level 3
Posts: 175
Joined: Mon Nov 22, 2010 10:33 am

Re: Conky Showoff thread

Post by Sector11 » Sat Feb 06, 2016 12:30 pm

mzsade wrote:Hi, I am using weather-util for the first line. VABB is the station code for Mumbai Santacruz airport.
Yea, I still can't get that to work ... see you are tweaking on the fly too.

I had no idea the moon data was wrong for my location, I was just plugging in Buenos Aires into your code to see if things worked.

I am sed/awk/grep challenged so I test & tweak things; that's I'm OK at ... until I get them right. I use Teo's weather scripts for weather. One bash script to collect the data and format text files for the users use - makes formatting better. So I grabbed the sun-moon data from his '2b)WUnderground API - All users - 2b_21-12-15' script and popped it into my text conky, I didn't bother running the script line:

Code: Select all

${execi 600 bash /media/5/Conky/2b_Wunderground_API/2b}\
as it's running in another conky here:
Image

So this:
Image
just uses the data that was collected and sitting here in a text file, no need to go on the net

Code: Select all

TEXT
${time %T}${alignr}${utime %T}
${uptime}${alignr}${time %x}
${alignc}CPU Avg ${if_match ${cpu cpu0}<10}${color1}00${color5}${cpu cpu0}\
${else}${if_match ${cpu cpu0}<100}${color1}0${color5}${cpu cpu0}\
${else}${color9}${cpu cpu0}${endif}${endif}${color5}%${color}
${alignc}Conky v${conky_version}
${alignc}${color9}${membar 0,25}${color} ↓ test code ↓ ${color9}${membar 0,25}${color}
${color9}${membar 0}${color}
${image /media/5/Conky/images/bk_30.png -p 90,90 -s 90x90}${image /media/5/Conky/2b_Wunderground_API/Moon_phase.png -p 90,90}\
Sunrise:${alignr}Sunset
${if_match ${pre_exec  sed -n '16p' /media/5/Conky/2b_Wunderground_API/Moon_Sun}<10}\
0${pre_exec  sed -n '16p' /media/5/Conky/2b_Wunderground_API/Moon_Sun}\
${else}${pre_exec  sed -n '16p' /media/5/Conky/2b_Wunderground_API/Moon_Sun}\
${endif}:${pre_exec  sed -n '18p' /media/5/Conky/2b_Wunderground_API/Moon_Sun}\
${alignr}${pre_exec  sed -n '21p' /media/5/Conky/2b_Wunderground_API/Moon_Sun}\
:${pre_exec  sed -n '23p' /media/5/Conky/2b_Wunderground_API/Moon_Sun}


Moonrise${alignr}Moonset
${if_match ${pre_exec  sed -n '26p' /media/5/Conky/2b_Wunderground_API/Moon_Sun}<10}\
0${pre_exec  sed -n '26p' /media/5/Conky/2b_Wunderground_API/Moon_Sun}\
${else}${pre_exec  sed -n '26p' /media/5/Conky/2b_Wunderground_API/Moon_Sun}\
${endif}:${pre_exec  sed -n '28p' /media/5/Conky/2b_Wunderground_API/Moon_Sun}\
${alignr}${if_match ${pre_exec  sed -n '31p' /media/5/Conky/2b_Wunderground_API/Moon_Sun}<10}\
0${pre_exec  sed -n '31p' /media/5/Conky/2b_Wunderground_API/Moon_Sun}\
${else}${pre_exec  sed -n '31p' /media/5/Conky/2b_Wunderground_API/Moon_Sun}\
${endif}:${pre_exec  sed -n '33p' /media/5/Conky/2b_Wunderground_API/Moon_Sun}
Illuminated: ${pre_exec  sed -n '2p' /media/5/Conky/2b_Wunderground_API/Moon_Sun}%\
${alignr}Age: ${pre_exec  sed -n '4p' /media/5/Conky/2b_Wunderground_API/Moon_Sun} days.
${alignc}Moon Phase: ${pre_exec  sed -n '6p' /media/5/Conky/2b_Wunderground_API/Moon_Sun}
${alignc}Hemisphere: ${pre_exec  sed -n '8p' /media/5/Conky/2b_Wunderground_API/Moon_Sun}
${color9}${membar 0}${color}
${alignc}${color9}${membar 0,25}${color} ↑ between lines ↑ ${color9}${membar 0,25}${color}
I will check out your new updated code thought :)
Thank you.

PS: I collect code and snippets :)

EDIT: Your latest code yields date and time only. :(
Image
Last edited by Sector11 on Sat Feb 06, 2016 1:13 pm, edited 1 time in total.
Using: BunsenLabs based on Debian Stable.
Conky PitStop

User avatar
mzsade
Level 5
Level 5
Posts: 777
Joined: Sun Jul 19, 2009 4:36 am

Re: Conky Showoff thread

Post by mzsade » Sat Feb 06, 2016 1:12 pm

You have always been my inspiration when it comes to all things Conky, this tilt towards minimalism is something i've acquired from @HOAS of Crunchbang forums fame, and even though i have none of his grasp of Linux i've had a fair amount of success in aping him. :lol:
A sed related site i recently exploited for my conky; http://www.folkstalk.com/2013/03/sed-re ... mples.html
Linux User #481272 Reg: 15th Sept., 2008

Post Reply

Return to “Compiz, Conky, Docks, & Widgets”