SEARCH

Enter your search query in the box above ^, or use the forum search tool.

You are not logged in.

#1 2013-01-27 02:08:48

tatlisub
Member
Registered: 2013-01-26
Posts: 38
Website

working conkyweather script (single line)

i searched alot but i have found no working script to write directly in conky.rc.

i need very simple appear on my top of the wallpaper like "xx celcius".

what do i write in conky.rc

thanks

thank you for all for your help, so result is here:
https://twitter.com/homebrewtality/stat … 08/photo/1

conky -v by the way

ev@ev:~$ conky -v
Conky 1.9.0 compiled Fri May 11 18:26:45 UTC 2012 for Linux 2.6.32-5-686-bigmem (i686)

Compiled in features:

System config file: /etc/conky/conky.conf
Package library path: /usr/lib/conky

 X11:
  * Xdamage extension
  * XDBE (double buffer extension)
  * Xft
  * ARGB visual

 Music detection:
  * Audacious
  * MPD
  * MOC
  * XMMS2

 General:
  * math
  * hddtemp
  * portmon
  * Curl
  * RSS
  * Weather (METAR)
  * Weather (XOAP)
  * wireless
  * support for IBM/Lenovo notebooks
  * nvidia
  * eve-online
  * config-output
  * Imlib2
  * apcupsd
  * iostats
  * ncurses
  * Lua

  Lua bindings:
   * Cairo
   * Imlib2

Last edited by tatlisub (2013-01-27 16:33:26)


spender.me  - Join and share how much money you spent.

Offline

Be excellent to each other!

#2 2013-01-27 03:33:59

Bradi
#! CrunchBanger
From: Poland
Registered: 2013-01-21
Posts: 119

Re: working conkyweather script (single line)

I would guess that it depends on what website you want to use for weather data.
I recently made a simple one-line script to parse the temperature from an .xml file, but it will only work on websites that provide such a file.

Conky's inbuilt weather seems easy enough to set up, if you are in the US or don't mind getting airport weather tongue

Offline

#3 2013-01-27 08:54:08

Kino
#! CrunchBanger
Registered: 2010-07-29
Posts: 130

Re: working conkyweather script (single line)

Hi Tatlisub,

I can show you the simple "one-liner" I have in my conky script - it's this:

${execi 300 /home/kino/bin/weather.sh "EUR|UK|UK123|Stockport"}

but it is specific to my location and currently displays:  Partly Sunny: 7C

In order for this to work you need 3 things:

1. Install curl (use synaptic or command line - up to you)
2. Install the following script weather.sh, which is called from the single line in conky: (note this is in my /home/kino/bin folder containing my executable scripts.

#!/bin/sh
#== AccuWeather (r) RSS weather tool for conky
#
#USAGE: weather.sh <locationcode>
#
#(c) Michael Seiler 2007

METRIC=1 #Should be 0 or 1; 0 for F, 1 for C

if [ -z $1 ]; then
    echo
    echo "USAGE: weather.sh <locationcode>"
    echo
    exit 0;
fi
curl -s http://rss.accuweather.com/rss/liveweather_rss.asp\?metric\=${METRIC}\&locCode\=$1 | perl -ne 'if (/Currently/) {chomp;/\<title\>Currently: (.*)?\<\/title\>/; print "$1"; }'

and make it executable.

3. Determine your own location from the accuweather.com site.

That should do it.

Last edited by Kino (2013-01-27 08:56:13)

Offline

#4 2013-01-27 09:43:56

tatlisub
Member
Registered: 2013-01-26
Posts: 38
Website

Re: working conkyweather script (single line)

how can i find location code


spender.me  - Join and share how much money you spent.

Offline

#5 2013-01-27 10:38:21

Kino
#! CrunchBanger
Registered: 2010-07-29
Posts: 130

Re: working conkyweather script (single line)

It's been a while since I did this but a good place to start would be:

Location Codes

Offline

#6 2013-01-27 10:41:46

tatlisub
Member
Registered: 2013-01-26
Posts: 38
Website

Re: working conkyweather script (single line)

Thank you


spender.me  - Join and share how much money you spent.

Offline

#7 2013-01-27 16:22:22

observingly
#! Member
From: Manila, Philippines
Registered: 2013-01-13
Posts: 98
Website

Re: working conkyweather script (single line)

is this suppose to be like this?

echo "USAGE: weather.sh ASI|PH|RP073|MANILA"

or this one?

echo "USAGE: /home/observingly/bin/weather.sh ASI|PH|RP073|MANILA"

or do I have to put the values in here?
[code]
fi
curl -s http://rss.accuweather.com/rss/liveweather_rss.asp\?metric\=${METRIC}\&locCode\=$1 | perl -ne 'if (/Currently/) {chomp;/\<title\>Currently: (.*)?\<\/title\>/; print "$1"; }'
[/code]

"You see, but you do not observe." -Sherlock Holmes

Offline

#8 2013-01-27 16:26:12

tatlisub
Member
Registered: 2013-01-26
Posts: 38
Website

Re: working conkyweather script (single line)

its nice to see a monochrome weather icon near the xx C ... but still good

https://twitter.com/homebrewtality/stat … 08/photo/1

Last edited by tatlisub (2013-01-27 16:26:53)


spender.me  - Join and share how much money you spent.

Offline

#9 2013-01-27 16:33:58

observingly
#! Member
From: Manila, Philippines
Registered: 2013-01-13
Posts: 98
Website

Re: working conkyweather script (single line)

hey tatlisub. can i see your .conkyrc and the weather.sh? kindly post it here.


"You see, but you do not observe." -Sherlock Holmes

Offline

#10 2013-01-27 16:37:00

tatlisub
Member
Registered: 2013-01-26
Posts: 38
Website

Re: working conkyweather script (single line)

this is conky.rc

# conky configuration
#
# The list of variables has been removed from this file in favour
# of keeping the documentation more maintainable.
# Check http://conky.sf.net for an up-to-date-list.
#
# For ideas about how to modify conky, please see:
# http://crunchbanglinux.org/forums/topic/59/my-conky-config/
#
# For help with conky, please see:
# http://crunchbanglinux.org/forums/topic/2047/conky-help/
#
# Enjoy! :)
##############################################
# Settings
##############################################
background yes
use_xft yes
xftfont URW Gothic L:size=24
xftalpha 1
update_interval 1.0
total_run_times 0
own_window yes
own_window_transparent yes
own_window_type desktop
#own_window_argb_visual yes
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
double_buffer yes
minimum_size 480 200
maximum_width 700
draw_shades no
draw_outline no
draw_borders no
draw_graph_borders no
default_color fdfdfd
default_shade_color 000000
default_outline_color 828282
alignment top_left
gap_x 12
gap_y 56
no_buffers yes
uppercase no
cpu_avg_samples 2
override_utf8_locale no
color2 B8860B
##############################################
#  Output
##############################################
TEXT
# stuff after 'TEXT' will be formatted on screen
#$alignr${texeci 500 bash /home/ev/AccuW/acc_int_images}\
#$alignr${image /home/ev/AccuW/cc.png -p 50,-10 -s 450x450}

#${voffset 10}${font URW Gothic L:size=35}${time %A}${font}$alignr
#${voffset 10}${font URW Gothic L:size=35}${time %B} ${time %e}${font}${voffset -10}

${voffset 10}${font URW Gothic L:book:size=180}${time %I:%M }${font}${voffset -10}




Istanbul
${execi 300 /home/ev/bin/weather.sh "MEA|TR|TU040|ISTANBUL"}
#Hava:$alignr${font URW Gothic L:book:size=24}${execpi 600 sed -n '29p' /home/ev/AccuW/curr_cond}C - ${execpi 600 sed -n '30p' /home/ev/AccuW/curr_cond}C${font}
${hr}
AnaMakina:$alignr$nodename
Calisma Saati:$alignr$uptime
RAM:$alignr$mem/$memmax
Swap:$alignr$swap/$swapmax
Disk:$alignr${fs_used /}/${fs_size /}
CPU:$alignr${cpu cpu0}%
Download:$alignr${downspeed}
${hr}

and weather.sh

#!/bin/sh
#== AccuWeather (r) RSS weather tool for conky
#
#USAGE: weather.sh <locationcode>
#
#(c) Michael Seiler 2007

METRIC=1 #Should be 0 or 1; 0 for F, 1 for C

if [ -z $1 ]; then
    echo
    echo "USAGE: weather.sh <locationcode>"
    echo
    exit 0;
fi
curl -s http://rss.accuweather.com/rss/liveweather_rss.asp\?metric\=${METRIC}\&locCode\=$1 | perl -ne 'if (/Currently/) {chomp;/\<title\>Currently: (.*)?\<\/title\>/; print "$1"; }'

spender.me  - Join and share how much money you spent.

Offline

#11 2013-01-27 16:51:19

observingly
#! Member
From: Manila, Philippines
Registered: 2013-01-13
Posts: 98
Website

Re: working conkyweather script (single line)

What's wrong with this? Still not showing the weather on Conky

http://pastie.org/5882372

To install the script I use this command

sh weather.sh

Is it right?


"You see, but you do not observe." -Sherlock Holmes

Offline

#12 2013-01-27 16:54:50

tatlisub
Member
Registered: 2013-01-26
Posts: 38
Website

Re: working conkyweather script (single line)

1.if you added this;

${execi 300 /home/yourusername/bin/weather.sh "EUR|UK|UK123|Stockport"}

2.put sh. file in the directory and make it executable from properties.


spender.me  - Join and share how much money you spent.

Offline

#13 2013-01-27 17:17:18

observingly
#! Member
From: Manila, Philippines
Registered: 2013-01-13
Posts: 98
Website

Re: working conkyweather script (single line)

I have already done those things.


"You see, but you do not observe." -Sherlock Holmes

Offline

#14 2013-01-28 08:54:54

Kino
#! CrunchBanger
Registered: 2010-07-29
Posts: 130

Re: working conkyweather script (single line)

Hi Observingly,

I think you have not fully understood the directions.

1. Have you installed curl?
2. Place the single "one-liner" in your conky.rc - you can set the location code later when you have it working.
3. Place the script weather.sh in your bin folder. DO NOT alter the script - copy it exactly as given in post #3. Ensure that its properties are that of an executable file.

To repeat - Copy the "one-liner" to conky.rc. DO NOT alter weather.sh. Place weather.sh in your bin folder. Ensure it is executable.
Run conky - it should work.
Determine your location code and put that in conky.rc - NOWHERE ELSE - do not change weather.sh

Offline

#15 2013-01-28 09:20:14

observingly
#! Member
From: Manila, Philippines
Registered: 2013-01-13
Posts: 98
Website

Re: working conkyweather script (single line)

I have understood it very well. The first location code works but when I change it to my location code. Nothing appears.


"You see, but you do not observe." -Sherlock Holmes

Offline

#16 2013-01-28 09:50:48

Kino
#! CrunchBanger
Registered: 2010-07-29
Posts: 130

Re: working conkyweather script (single line)

It may help if you posted the location code you are using...

Offline

#17 2013-01-28 10:33:43

observingly
#! Member
From: Manila, Philippines
Registered: 2013-01-13
Posts: 98
Website

Re: working conkyweather script (single line)

This is the location code ASI|PH|RP073|MANILA


"You see, but you do not observe." -Sherlock Holmes

Offline

#18 2013-01-28 12:35:30

Kino
#! CrunchBanger
Registered: 2010-07-29
Posts: 130

Re: working conkyweather script (single line)

Well, your location code looks as if it should work. It even checks out if you fill in the details on this site:
NetWeather

but as you say - nothing appears.

This is obviously a problem with accuweather and not the instructions given above - I have no problems with my own location.

I can only suggest that you ask on the accuweather forum for further advice.

Offline

Board footer

Powered by FluxBB

Copyright © 2012 CrunchBang Linux.
Proudly powered by Debian. Hosted by Linode.
Debian is a registered trademark of Software in the Public Interest, Inc.

Debian Logo