Conky - Weather Underground Script
Since weather.com is ending their free XOAP service conkyForecast will no longer work at the end of this month.
Therefore I wrote a small script to get the temperature and condition from Weather Underground
#!/usr/bin/python
# Fetches Weather info from Weather Underground
# Usage: ./wundergound.py zipcode
# International:
# * Go to http://www.wunderground.com/
# * Find your city
# * Click the RSS icon
# * Station ID is the number that follows /stations/ in the url
# Values are either True or False
metric=False
international=False
import sys
import feedparser
def usage():
print("Usage:")
if international:
print(" ./wunderground.py StationID")
else:
print(" ./weunderground.py zipcode")
sys.exit(1)
if not len(sys.argv) == 2:
usage()
location=sys.argv[1]
if international:
url="http://rss.wunderground.com/auto/rss_full/global/stations/"
else:
url="http://rss.wunderground.com/auto/rss_full/"
feed=feedparser.parse(url+location)
if not feed.feed:
# Assume Error
print("Error")
sys.exit(1)
current=feed['items'][0].title
if metric:
temp=current.split(",")[0].split(":")[1].split("/")[1].strip()
else:
temp=current.split(",")[0].split(":")[1].split("/")[0].strip()
condition=current.split(",")[1].split("-")[0].strip()
print(temp, "-", condition)
Example:
$ ./wunderground 11201
69.6F - Clear
Conky:
${execi 600 /home/pyther/scripts/wunderground 11201}
Enjoy!
Here is the documentation for feedparser: http://packages.python.org/feedparser/
What exactly are you trying to do? In the script feedparser is getting the first rss entry and parsing it.
If you want the afternoon, night, or next day entries...
afternoon=feed['items'][1].title # afternoon
tonight=feed['items'][2].title # Tonight
tomorrow=feed['items'][3].title # tomorrow
Similar Messages
-
Pywu: Simple python script for Weather Underground's API
This is a script I wrote several years ago for use with conky. I've cleaned it up some and released it for anyone else who may like to use it. It allows you to pull data from Weather Underground's API.
You need an API key from here to use it.
Github repo is here: https://github.com/dh4/pywu
An AUR package is here: https://aur.archlinux.org/packages/pywu/
Let me know if you find it useful or have any issues with it.dibblethewrecker wrote:i really want to learn python - when ever i think about it i always feel to tired to start!
just download diveintopython and the official documentation at python.org, that should keep you busy for a while, -
[SOLVED] (Perl) Help Modifying Conky Weather Script
I'm using buttons' excellent Conky weather script, but it has more information than I need. It displays both the current weather condition and the temperature:
[condition]:[temperature]F
so right now it's
Clear: 46F
All I need is for it to display the temperature, without the current condition, colon, and letter 'F' (for Fahrenheit).
the script:
METRIC=0 #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"; }'
In Conky:
{execi 300 /home/hex/.conky/weather.sh <zip code>}
I'm not familiar with Perl yet so any help is much appreciated
Last edited by Olson (2011-02-17 07:06:10)Try this
curl ... | perl -ne 'if (/Currently/) {chomp;/\<title\>.*: (\d*).\<\/title\>/; print "$1"; }' -
New Conky Weather Program with Weather Alerts - conkywx
Here is a new weather program written in Bash script
Please provide feedback - For users of other distros - kindly visit my Blog for latest releases and leave comments and feedback there - thanks
Screenshots
Program is now on the AUR
Support for :
- Multiple locations
- Multiple locations can be searched for using separate config files per location
- Templates
- Use templates to have very low CPU loads
- Direct elements
- Each element can be directly called. In fact if you add a config to each element - you can have multiple locations on the same conkyrc.
- Choose the kind of units you want - Imperial or Metric
- Choose the time format 12 hour AM/PM or 24 hour clock
- Choose Font based or Image based conkyrc
- Choose popup notifications each time conky updates
- Has it's own man page
- and more - see man conkywx man page file once you install it from the AUR.
- all weather elements used are also listed in the man pages.
Why Weather Underground
- Well IMO it has the best weather information on the web.
This program does not need the use of any Keys from the website only the URL or the location code for a supported location on the planet.
Weather has become a very important factor in our lives lately and hence this program.
You can design your own templates or conkyrc files looking at the examples.
Last edited by Paramvir (2013-05-09 15:24:54)Here is the conkywx AUR package https://aur.archlinux.org/packages.php?ID=59931]
Have had to make many changes here to get this done.
The config file is now in /etc/conkywx/conkywx.conf - this file can be used as is and is the default config
There is now a man page - man conkywx is what you look for.
The program is now accessed in path /usr/bin/conkywx installed in /usr/share/conkywx
This is my first AUR package
To figure out the AUR - a good tool that I use is Yaourt (Yet AnOther User Repository Tool) and it is very easy to install if you use the [archlinuxfr] as mentioned in that wiki. It is an excellent front end for pacman and it also allows you to search and install from AUR.
If you have tried something else and feel it is good - please do share that info
Last edited by Paramvir (2012-06-11 08:28:08) -
Can't subscribe to Weather Underground calendar
Hi Folks:
I've been trying to subscribe to the local Weather Underground report as a subscribed calendar on my iPod Touch but when I do there's no data. The link is here:
http://ical.wunderground.com/auto/ical/VA/Charlottesville.ics?units=english
and it works just fine in iCal on my computer but not on my iPod Touch. If I try to subscribe on my iPod Touch browser it replies "Download failed Safari cannot download this file." If I try to subscribe by adding it as an account, the subscription is accepted but no data is ever downloaded and the calendar remains blank. I have no problems subscribing to other .ics calendars, only this one.
I'm stumped!Jeff,
The example that you gave worked for me when I changed mac to me.
my wife's Mobile Me calendar.
Perhaps a matter of semantics, but I do not know how to subscribe to a MobileMe calendar, unless it is first published by the user. Is this calendar published by your wife?
;~) -
IPhone version of Weather Underground
Hopefully this isn't a repeat post, but I couldn't find anything. Anyway, I just found that Weather Underground has made a mobile site specifically for the iPhone. It is similar to their normal mobile site, m.wund.com, but the interface is set up just like the options interface internal to the phone. It loads quickly, gives a ton of information, and has a map that you can animate.
i.wund.com
By the way, it only looks good on the phone itself, not on your desktop. If you don't trust me, you can access it from the top-left of the main site, www.weatherunderground.com. Enjoy!Fabulous! Thanks!
-
Ideas for a conky weather script ...
Here are the 2 best sources for weather updates for me :
http://www.google.ca/search?sourceid=ch … chicoutimi (google)
or
http://www.meteomedia.com/weather/CAQC0107 (most known weather website/tv-channel of my country)
What would be the best grep ou curl ? Got ideas to build that script ?
Google seem limited but I could show pictures on my desktop directly maybe,
Meteomedia as less nice GUI for that ...Meskarune wrote:check out the conky forcast package in aur
If you install the package you'll find a conkyrc/template file example in /usr/share/conkyforecast/example
Also have a look at the conky hardcore website, it details quite a lot user setups for this script, a good example is here: http://conky.linux-hardcore.com/?page_id=2487
Cheers -
Help for a Conky weather script
Hi,
I was trying to write a Conky script to display weather forecast for the current day in my Conky, using <tempmin>, <tempmax> and <descr> on this page http://www.tv5.org/TV5Site/widget/meteo … lle_id=474.
I'm a complete newbie to bash/perl/whatever, and I couldn't manage to do much. Could anyone explain me how to proceed?
Please don't RTFM me :(You need xmlstarlet to run it.
It simply parses that xml file and extracts the info you want.
I wanted to add newlines, so I just wrapped it all in 'echo -e $(...)' and called it a day. There's probably a better way to do it.
Also, note that the index on 'descr' is one higher than on 'tempmin' and 'tempmax', because there's already a 'descr' earlier in the file:
<weather>
<data>
<ville>Paris</ville>
<pays>FRANCE</pays>
<date>Observation le vendredi 22 à 13:00 (heure locale)</date>
<temp>4°C</temp>
<descr>couvert </descr>
You don't want the value of this 'descr', but of the one a bit lower (the second one) -
<descr>très nuageux </descr>
thus '//descr[2]'. -
Ok, I have been using the conkyForecast script for a while now, and it's been nice, but, for some reason it decided not to show anything until today actually.
So, I started investigating the conky man page, and found that it has weather information available to it as well.
You have to use --enable-metar and/or --enable-xoap.
The xoap apparently enables metar as well.
Anyway, I used the conky-git package, but had to change the ccmake to cmake-gui in order to get it to build.
After all that, the weather works fine, except for when displaying the weather icon.
The icon argument returns a number, which apparently corresponds to pngs from weather.com (not that I've been able to find the kit), but the icons are provided with conkyForecast (for which I'm thankful). But how do I get conky to display the icon?
I'm starting to think that feature may just be broken at this time, but I'm just curious to see if I've done something odd with this and didn't intend to.
When I look in the weathericons, there is a 26.png that would correspond with the cloud_cover option, but the icon shows 26, rather than that png. Do I need to have the images placed in a certain place or what?
I've searched all over the place, but most things that pop up are for conkyForecast, rather than for any information on this within conky.
I looked at the weather portions of the code as well, but can't tell where it's looking for the icon, if it is at all.
Any suggestions as to where to look for more info? I don't do irc really, but I may have to break down and install an irc client and go ask on the #conky channel.There is no stock weather app on iPads. Use the App Store app to search for, download or purchase a weather app of your choosing.
-
Another Conky Weather Forecast Solution
Not the prettiest out there, but works for me. Haven't seen this one out there yet.
Dependencies: elinks, conky
What it does: Creates a file in ~/ with weather forecast from weather.com. Then displays pieces of text from that file in Conky.
Place this in your ~/.conkyrc:
${color #79f9ff}Weather Details High/low F Rain?
${color grey}${execi 3600 elinks "http://www.weather.com/weather/print/97302" > YOUR_FILE_NAME ; cat -n YOUR_FILE_NAME | grep "^ *11" | cut -c10-100}
${color grey}${execi 3600 cat -n YOUR_FILE_NAME | grep "^ *13" | cut -c10-100}
${color grey}${execi 3600 cat -n YOUR_FILE_NAME | grep "^ *15" | cut -c10-100}
${color grey}${execi 3600 cat -n YOUR_FILE_NAME | grep "^ *17" | cut -c10-100}
${color grey}${execi 3600 cat -n YOUR_FILE_NAME | grep "^ *19" | cut -c10-100}
${color grey}${execi 3600 cat -n YOUR_FILE_NAME | grep "^ *21" | cut -c10-100}
${color grey}${execi 3600 cat -n YOUR_FILE_NAME | grep "^ *23" | cut -c10-100}
${color grey}${execi 3600 cat -n YOUR_FILE_NAME | grep "^ *25" | cut -c10-100}
${color grey}${execi 3600 cat -n YOUR_FILE_NAME | grep "^ *27" | cut -c10-100}
${color grey}${execi 3600 cat -n YOUR_FILE_NAME | grep "^ *29" | cut -c10-100}
Replace the 97302 zip code in the address with your own. Change all the YOUR_FILE_NAMEs to whatever you want your weather file name to be. Make sure they are all the same though. Ctrl+S and there should be some weather output in Conky. You might have to fidget with the greps and cuts to make it look right for you (but probably not).Not the prettiest out there, but works for me. Haven't seen this one out there yet.
Dependencies: elinks, conky
What it does: Creates a file in ~/ with weather forecast from weather.com. Then displays pieces of text from that file in Conky.
Place this in your ~/.conkyrc:
${color #79f9ff}Weather Details High/low F Rain?
${color grey}${execi 3600 elinks "http://www.weather.com/weather/print/97302" > YOUR_FILE_NAME ; cat -n YOUR_FILE_NAME | grep "^ *11" | cut -c10-100}
${color grey}${execi 3600 cat -n YOUR_FILE_NAME | grep "^ *13" | cut -c10-100}
${color grey}${execi 3600 cat -n YOUR_FILE_NAME | grep "^ *15" | cut -c10-100}
${color grey}${execi 3600 cat -n YOUR_FILE_NAME | grep "^ *17" | cut -c10-100}
${color grey}${execi 3600 cat -n YOUR_FILE_NAME | grep "^ *19" | cut -c10-100}
${color grey}${execi 3600 cat -n YOUR_FILE_NAME | grep "^ *21" | cut -c10-100}
${color grey}${execi 3600 cat -n YOUR_FILE_NAME | grep "^ *23" | cut -c10-100}
${color grey}${execi 3600 cat -n YOUR_FILE_NAME | grep "^ *25" | cut -c10-100}
${color grey}${execi 3600 cat -n YOUR_FILE_NAME | grep "^ *27" | cut -c10-100}
${color grey}${execi 3600 cat -n YOUR_FILE_NAME | grep "^ *29" | cut -c10-100}
Replace the 97302 zip code in the address with your own. Change all the YOUR_FILE_NAMEs to whatever you want your weather file name to be. Make sure they are all the same though. Ctrl+S and there should be some weather output in Conky. You might have to fidget with the greps and cuts to make it look right for you (but probably not). -
[Solved] Conky stock ticker script?
Does anyone have a stock ticker script for Conky?
Orjanp
Last edited by orjanp (2009-01-29 22:07:24)Why not add an rss feed into conky, here's a link for that. http://howto.wikia.com/wiki/Howto_add_a … nky-rss.sh
I'm sure there are plenty of stock feeds in rss format around. -
I followed this guide:
http://www.linutop.com/news/2009/01/30/ … yforecast/
and got this result:
http://tinyurl.com/7b6qlps
As you can see no weather data is being displayed.According to this thread weather.com have discontinued their XOAP interface
-
[Solved] Weather in conky won't work
- I installed conkyforecast-bzr from AUR
- I set my weather conky to run at startup pointing to the correct conkyrc file (I know it's correct because when I change it it restarts)
- I pointed my conkyrc to the correct conkyForecast.template file
- The fonts are installed to ~/.icons, /usr/share/icons, and usr/share/fonts/truetype
- I found my XOAP location id and put it in the conkyrc file
conkyrc:
# conky weather config
# set to yes if you want Conky to be forked in the background
background yes
# X font when Xft is disabled, you can pick one with program xfontsel
#font 5x7
#font 6x10
#font 7x13
#font 8x13
#font 9x15
#font *mintsmild.se*
#font -*-*-*-*-*-*-34-*-*-*-*-*-*-*
# Use Xft?
use_xft yes
# Xft font when Xft is enabled
xftfont Bitstream Vera Sans Mono:size=9
# Text alpha when using Xft
xftalpha 0.8
# Update interval in seconds
update_interval 1.0
# This is the number of times Conky will update before quitting.
# Set to zero to run forever.
total_run_times 0
# Use double buffering (reduces flicker, may not work for everyone)
double_buffer yes
# Minimum size of text area
minimum_size 300 0
maximum_width 300
# Draw shades?
draw_shades yes
# Draw outlines?
draw_outline no
# Draw borders around text
draw_borders no
draw_graph_borders yes
# Stippled borders?
stippled_borders 8
# border margins
border_inner_margin 4
# border width
border_width 1
# Default colors and also border colors
default_color white
default_shade_color black
default_outline_color white
# own window options
own_window yes
own_window_type desktop
own_window_transparent no
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
# Text alignment, other possible values are commented
alignment top_left
#alignment top_right
#alignment bottom_left
#alignment bottom_right
# Gap between borders of screen and text
# same thing as passing -x at command line
gap_x 10
gap_y 50
# Subtract file system buffers from used memory?
no_buffers yes
# set to yes if you want all text to be in uppercase
uppercase no
# number of cpu samples to average
# set to 1 to disable averaging
cpu_avg_samples 2
# number of net samples to average
# set to 1 to disable averaging
net_avg_samples 2
# Force UTF8? note that UTF8 support required XFT
override_utf8_locale yes
# Add spaces to keep things from moving about? This only affects certain objects.
use_spacer right
# colours
color1 white
# light blue
color2 3465A4
# orange
#E77320
color3 FC8820
# green
color4 78BF39
# red
color5 CC0000
text_buffer_size 2048
# variable is given either in format $variable or in ${variable}. Latter
# allows characters right after the variable and must be used in network
# stuff because of an argument
# stuff after 'TEXT' will be formatted on screen
TEXT
${offset -5}${color 3465A4}${font StyleBats:style=CleanCut:size=12}q ${voffset -2}${color}${font Bitstream Vera Sans Mono:style=Bold:size=11}Weather${font} ${hr}${color1}
${color fffff0}${execpi 1800 conkyForecast --location=USNY0996 --template=/home/me/.conky/conkyForecast.template}${color}
conkyForecast.template:
${voffset 5}${goto 10}${font ConkyWeather:style=Bold:size=40}[--datatype=WF]${font}
${voffset 5}${goto 20}${color 3465A4}[--datatype=HT --hideunits --centeredwidth=3]$color/${color 3465A4}[--datatype=LT --hideunits --centeredwidth=3]$color
${voffset 10}${goto 10}${font ConkyWindNESW:size=40}[--datatype=BS]${font}
${voffset 5}${goto 10}${color 3465A4}[--datatype=WS --imperial] - [--datatype=WD]$color
${voffset -145}${goto 100}${color white}${font Bitstream Vera Sans Mono:style=Bold:size=14}[--datatype=CT]${font}
${voffset 10}${goto 100}${color 3465A4}Station: ${color white}[--datatype=OB]
${goto 100}${color 3465A4}Rain: ${color white}[--datatype=PC]
${goto 100}${color 3465A4}UV: ${color white}[--datatype=UI] - [--datatype=UT]
${goto 100}${color 3465A4}Humidity: ${color white}[--datatype=HM]
${goto 100}${color 3465A4}Dew Point: ${color white}[--datatype=DP]
${goto 100}${color 3465A4}Sunrise/Set: ${color white}[--datatype=SR] / [--datatype=SS]
${goto 100}${color 3465A4}Bar: ${color white}[--datatype=BR] - [--datatype=BD]
${goto 100}${color 3465A4}Moon: ${color white}[--datatype=MP]
${voffset 25}${goto 25}${color 3465A4}[--datatype=DW --startday=1 --shortweekday]${goto 100}[--datatype=DW --startday=2 --shortweekday]${goto 175}[--datatype=DW --startday=3 --shortweekday]${goto 250}[--datatype=DW --startday=4 --shortweekday]$color
${voffset 10}${goto 10}${font ConkyWeather:size=32}[--datatype=WF --startday=1 --endday=4 --spaces=3]${font}
${voffset 15}${goto 15}${color 3465A4}[--datatype=HT --startday=1 --hideunits --centeredwidth=3]$color/${color 3465A4}[--datatype=LT --startday=1 --hideunits --centeredwidth=3]${goto 90}[--datatype=HT --startday=2 --hideunits --centeredwidth=3]$color/${color 3465A4}[--datatype=LT --startday=2 --hideunits --centeredwidth=3]${goto 170}[--datatype=HT --startday=3 --hideunits --centeredwidth=3]$color/${color 3465A4}[--datatype=LT --startday=3 --hideunits --centeredwidth=3]${goto 245}[--datatype=HT --startday=4 --hideunits --centeredwidth=3]$color/${color 3465A4}[--datatype=LT --startday=4 --hideunits --centeredwidth=3]
${color 3465A4}${font Bitstream Vera Sans Mono:size=7}${alignr 20}Last Update: [--datatype=LU]${font}
All that shows up on my desktop for conky is "Weather -----------------------"
I've spent hours trying to figure this out, scoured the internet for info, and I can't find anything wrong with my files.
Last edited by herrvideman (2010-09-08 15:05:14)Please read /usr/share/conkyforecast/README, I'm assuming you need to register at http://www.weather.com/services/xmloap.html and fill in conkyForecast.config. The skel file is located at /usr/share/conkyforecast/conkyForecast.config just copy it into your home and fill it out.
-
Recommended pacman updates conky script?
Hi,
I have been trying some of the conky pacman updates scripts on the forum/wiki.
So far they either say my system is up to date when in fact pacman -Syu shows otherwise, or they fail to give any info at all.
Can anybody recommend a conky script that is working at this moment in time?:/
Last edited by ancleessen4 (2010-03-03 15:29:45)Sure-heavily plagiairized from either arch or ubuntu threads...a work in progress...;)
If I find it back I will honour the original author...
# Create own window instead of using desktop (required in nautilus)
own_window yes
own_window_hints undecorated,below,skip_taskbar
own_window_type override
own_window_colour brown
own_window_transparent yes
own_window_hints below
background no
maximum_width 200
# Use double buffering (reduces flicker, may not work for everyone)
double_buffer yes
# fiddle with window
use_spacer right
# Update interval in seconds
update_interval 1
# Minimum size of text area
minimum_size 350 5
# Draw shades?
draw_shades yes
draw_borders no
# Stippled borders?
# stippled_borders 8
# window.border_inner_margin 4
border_width 2
# Default colors and also border colors, grey90 == #e5e5e5
default_color white
default_shade_color black
default_outline_color white
# Text alignment, other possible values are commented
#alignment top_left
alignment top_right
#alignment bottom_left
#alignment bottom_right
# Gap between borders of screen and text
gap_x 10
gap_y 30
# Text stuff
draw_outline no # amplifies text if yes
uppercase no # set to yes if you want all text to be in uppercase
override_utf8_locale no
use_xft yes
xftfont Terminus:size=9
#xftfont Sans:size=8
xftalpha 0.8
text_buffer_size 768
# Force UTF8? note that UTF8 support required XFT
override_utf8_locale yes
color1 333333
color2 cccccc
color3 ddaa00
########## BEGIN FORMATTED DISPLAY ##########
TEXT
${font :size=15}${color red}${alignc}${execi 6000 hostname}${font}${color }
${font :size=8}${alignc}${color lightgrey}$kernel${font}${color }
${hr 1}
${color slate grey}UpTime: ${alignr}${color lightgrey}$uptime${color }
${font StyleBats:size=17}k${font Terminus:size=12} CPU ${font}${hr 2}
${color slate grey}CPU:${color } ${cpu cpu0}% ${cpu cpu1}% ${alignr}${color }$loadavg
${alignc}${cpugraph cpu0 20,90 000000 ffffff} ${cpugraph cpu1 20,90 000000 ffffff}
${color slate grey}cpu0: ${alignr}${color lightgrey}${execi 5 sensors | grep "Core 0" | cut -d "+" -f2 | cut -c1-2}C${color }
${color slate grey}cpu1: ${alignr}${color lightgrey}${execi 5 sensors | grep "Core 1" | cut -d "+" -f2 | cut -c1-2}C${color }
${color slate grey}sda: ${alignr}${color lightgrey}${execi 30 hddtemp /dev/sda | cut -c 31-33}C
${color slate grey}Processes: ${color }${alignr}$processes
${color slate grey}Running: ${color }${alignr}$running_processes
${color slate grey}Top CPU:
${color #ddaa00} ${top name 1}${alignr}${top_mem cpu 1}
${color lightgrey} ${top name 2}${alignr}${top cpu 2}
${color lightgrey} ${top name 3}${alignr}${top cpu 3}
${color lightgrey} ${top name 4}${alignr}${top cpu 4}
${color lightgrey} ${top name 5}${alignr}${top cpu 5}
${color lightgrey} ${top name 6}${alignr}${top cpu 6}
${font StyleBats:size=17}M${font Terminus:size=12} MEMORY ${font}${hr 2}
${color slate grey}RAM: ${alignr}${membar 5,100}
${color slate grey}SWAP: ${alignr}${swapbar 5,100}
${color slate grey}ROOT: ${alignr}${fs_bar 5,100 /}
${color slate grey}HOME: ${alignr}${fs_bar 5,100 /home}
${color slate grey}Top Memory:
${color #ddaa00} ${top_mem name 1}${alignr}${top_mem mem 1}
${color lightgrey} ${top_mem name 2}${alignr}${top_mem mem 2}
${color lightgrey} ${top_mem name 3}${alignr}${top_mem mem 3}
${font StyleBats:size=17}5${font Terminus:size=12} NETWORK ${font}${hr 2}
${color slate grey}Local IP: ${alignr}${color }${addr eth0}
${color slate grey}Public IP: ${alignr}${color }${execi 450 ~/.scripts/externip.sh}
${color}Up: ${color }${upspeed eth0} k/s
${alignc}${upspeedgraph eth0 20,170 000000 ffffff}
${color}Down: ${color }${downspeed eth0}k/s${color}
${alignc}${downspeedgraph eth0 20,170 000000 ffffff}
${font StyleBats:size=17}v${font Terminus:size=12} UPDATES ${font}${hr 2}
${execpi 60 /home/neil/.scripts/pacman-update}${color}
${execpi 3600 paconky /home/neil/.scripts/repos.paconky}
${execpi 3600 paconky /home/neil/.scripts/aur.paconky}
${voffset 900}
Current screen grab;
http://neilhoughton.com/wp-content/uplo … nshot3.png -
[SOLVED] Store the exit of a script in a variable, in conky
Hi!
Today i added to my conky this gmail_checker script
#!/bin/bash
wget -q -O - https://mail.google.com/a/gmail.com/feed/atom --http-user=${1}@gmail.com --http-password="${2}" --no-check-certificate | grep fullcount | sed 's/<[^0-9]*>//g'
I'd like to have a desktop notification when a new mail arrives, so i put together something like this:
${color4}Gmail:${goto 80}${color3}${execi 120 /home/federico/Script/gmail_checker.sh username pwd} new mails ${if_match ${execi 120 /home/federico/Script/gmail_checker.sh username pwd} > 0}${execi 120 notify-send -i /usr/share/icons/gnome/32x32/status/mail-unread.png "Gmail" "nuova mail"}${endif}
Well, it works. But I'd like to avoid the repetition of the "exec /path/to/script", may be storing "execi 120 /home/federico/Script/gmail_checker.sh username pwd" in a variable, and use that to be printed as number of mails, as well as to be compared with "0" to notify new mails.
Can it be done in conky? How?
Thank you very much!
Last edited by nierro (2013-04-06 11:07:01)You can't store variables in a conky config file as far as I know. It doesn't get parsed the same way a script might so can't link a variable and value.
Is it just for readablilty of script you want to use variables?
You can escape the end of a line with "\" (without quotes) as the last character and then continue on the next line if that helps?
You can also replace your user name with "~" which represents "/home/frederico", so
/home/frederico/Scripts/
becomes
~/Scripts
which cuts down the amount of stuff slightly.
Maybe you are looking for
-
Connecting my iphone to a HDTV...???
I just purchased the component AV cables for the iphone thinking that I could view on tv what I see on the iphone. I was wrong. I can only see videos from you tube, quicktime videos from the internet. I can see the pictures as a slideshow. The music
-
Can anyone recommend an error correction programme which I can download and use with itunes? I find itunes own error correction does not always work and downloaded tracks which were fine on the CD, skip once downloaded.
-
Please read this thread and vote. http://forums.verizon.com/t5/Share-Your-Ideas-with-Verizon/Publish-the-port-forwarding-rules-and-req...
-
What are the exported video extensions in Lr3?
I've got a bit of a mini-crisis: I re-coded a plugin which relies on Lr4 features, but needs to run in Lr3. As coded, I'm needing to know the extension that will be used upon export, before export actually commences, for the video files. (I'm present
-
How do I search my posts sorted by date?
Hi hussein, I am retrieving all my posts in this forum, and I got it sorted "alpha" , how can I sort it by date? Thanks MsK By the way, I saw that u have updated my last 2 posts, but when I clicked on them, I do not see your response yet, kinda weird