That seems to work, but it does have alot of white space in it, you can take that out with another sed. Also there is one extra 'Ubuntu Forms - Community Cafe, In the code below It has no spaces beforehand, or the extra title.Code:${execi 600 curl -s 'http://ubuntuforums.org/external.php?type=RSS2&forumids=11' | grep title | sed 's/<\/title>/ /' | sed 's/<title>/ /' | sed 10q}
Doing this is truely not that hard, To modify any of this please look at - sed commandsCode:${execi 600curl -s 'http://ubuntuforums.org/external.php?type=RSS2&forumids=11' | grep title | sed 's/<\/title>/ /' | sed 's/<title>/ /' | sed 10q | sed 's/^[ \t]*//' | sed '2,12!d'}
I am not really sure, I do not think that conky supports links...Thank you, that's great, just what I was hoping for.
Anyway to make the headlines actual links?
also i have just finished another script, this one gets your active torrents on torrentflux and gives you the percent done and the ETA.
This is a pretty well commented script so for someone with some knowledge of sed and shell script should be able to modify and probably improve it.Code:#torrentflux.sh 0.0.1 #by shinynew #Generates the names of all your current torrents in torrent flux, and the percent complete & the ETA below #the name # #Where are you .stat files saved? DIR=/var/www/torrentflux/downloads/.torrents #cd $DIR I=`ls $DIR | grep .stat | sed -n '/.stat.pid/!p' | sed -n '/.stat.pid/!p' | sed -n '$='` while [ 1 -le $I ] do #get the full file name, going one at a time V=$DIR/`ls $DIR | grep .stat | sed -n '/.stat.pid/!p' | sed -n '/.stat.pid/!p' | sed "$I !d"` #echo file name & turn '_' into ' ' and '.stat' into ' ' echo `ls $DIR | grep .stat | sed -n '/.stat.pid/!p' | sed -n '/.stat.pid/!p' | sed "$I !d" | sed 's/$ #get file......display lines 2&3....remove the newline and up "% ETA:" there instead cat `echo $V` | sed -n '2,3p' | sed '$!N;s/\n/% ETA: /' # I = I - 1 I=`expr $I - 1` done
Does anyone know how to access pidgin from the command line to show if you have any new messages?
Or the system tray.
hey guys I am trying to get conky working on one line and for some reason it just refuses to do so? Here is an example of what I want to do with conky. I have even copied and pasted his conkyrc but it still isn't as one line.
http://ubuntuforums.org/attachment.p...6&d=1185478216
Any help is much appreciated.
Rich
sorry for my stupidity when saving my conkyrc file i never put .conkyrc
Last edited by chm0d; July 27th, 2007 at 10:34 PM.
I have added the calendar to my conky as a separate config (conky-cal) and it works fine, but is there a way to have it highlight the current day? Here's my conky-cal showing only the current month:
Code:double_buffer yes update_interval 1 background yes own_window yes own_window_transparent yes own_window_type override #own_window_type root own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager use_xft yes override_utf8_locale no xftfont Dejavu Sans:size=9 xftalpha 0.8 draw_shades no draw_outline no draw_borders no uppercase no use_spacer no border_margin 0 border_width 0 default_color white default_outline_color black alignment top_right gap_x 0 gap_y 0 TEXT ${font Monospace:bold:size=19}${color #ffffff}${execi 1000 cal -3 | cut -c23-43}
"For those who believe, no explanation is necessary. For those who do not, none will suffice." - Joseph Dunninger
Hi All
I thought I'd post these here as it seems far and away the most active Conky community.
Anyway I've been working on this for some time and while I think Conky is a great utility it has a couple of things that I wanted......
Specifically I wanted the colour of the sensors to change if they got out of acceptable ranges and I wanted to have graphics for the weather.....
Attached are three conky screenshots together with the conkyrc and the other supporting scripts.
The sensors get checked everything 30 seconds and therefore with having the conky on the desktop means I can see if there's a problem immediately, the weather grid was created by hacking an existing weather font and installing it.
It's still a work in progress but is getting close to finished now.
All feedback gratefully received. And don't shoot me for using Fed rather then Ubuntu!!
Your screenshots showed up but your scripts didnt. Can you just copy and paste your code on this page for us to look over? To make the cool "code" blocks just open your coded section with [ code ] and end it with [ /code ], but put the brackets together...
I'd love to see what your scripts look like, particularly the weather and how you did the color change, but all of it is appreciated if you are willing to share!
Hi
Sorry I did a clean build installation of 2.6.22.1-33 last night and it's blown some of the features (not sure why yet) so I've posted the scripts now and will again at the back end of the week when I've got them working properly again if that's OK.
By the way, the weather script only works in the UK and AUS (the source is metcheck.com) as they are the only weather data source I can find that supplies 7 days of data. I'm sure the model can be used for other data sources though.
---------------------------------------------------------------------------------
.conkyrc
assortedconky.shCode:#Conkyrc - Conky configuration file # set to yes if you want tormo to be forked in the background background no use_xft yes # X font used, you can pick one with program xfontsel # xftfont Bitstream Vera Sans Mono-7 font 5x7 #font 6x10 #font 7x13 #font 8x13 #font -*-clean-medium-r-*-*-12-*-*-*-*-*-*-* #font -artwiz-kates-medium-*-*-*-14-*-*-*-*-*-*-* #font -artwiz-kates-medium-*-normal-*-17-120-*-*-*-*-*-* #font -*-webby caps-*-*-*-*-7-*-*-*-*-*-*-* #font -xos4-terminus-medium-r-normal--14-140-72-72-c-80-iso8859-1 #font -*-terminus-*-*-*-*-*-*-*-*-*-*-*-* #font -*-bitstream vera sans mono-medium-r-*-*-12-*-*-*-*-*-*-* font courier xftfont DejaVu LGC Sans Mono xftfont Weather:size=9 # xftfont Arial:size=4 # Text alpha when using Xft # xftalpha 1 # mail spool # mail_spool $MAIL # Update interval in seconds update_interval 5.0 # Create own window instead of using desktop (required in nautilus) own_window no # to get transparency working properly own_window_hints undecorated,below,skip_taskbar # You want the window transparent? own_window_transparent yes # Use Double Buffering - Reduces flickering (May not work) double_buffer yes # Minimum size of text area minimum_size 400 4 maximum_width 400 # Draw shades? draw_shades no # Draw outlines? draw_outline no # Draw borders naround text draw_borders no # Stippled borders? stippled_borders 0 # border margins border_margin 4 # border width border_width 6 # Default colors and also border colors #default_color spring green default_color yellow default_shade_color black default_outline_color black # 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 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 # Possible variables to be used: # # Variable Arguments Description # acpiacadapter ACPI ac adapter state. # acpifan ACPI fan state # acpitemp ACPI temperature. # battery (name) Remaining capasity in ACPI or APM # battery. ACPI battery name can be # given as argument (default is BAT0). # buffers Amount of memory buffered # cached Amount of memory cached # color (color) Change drawing color to color # cpu CPU usage in percents # cpubar (height) Bar that shows CPU usage, height is # bar's height in pixels # downspeed net Download speed in kilobytes # downspeedf net Download speed in kilobytes with one # decimal # exec shell command Executes a shell command and displays # the output in torsmo. warning: this # takes a lot more resources than other # variables. I'd recommend coding wanted # behaviour in C and posting a patch :-). # execi interval, shell Same as exec but with specific interval. # command Interval can't be less than # update_interval in configuration. # fs_bar (height), (fs) Bar that shows how much space is used on # a file system. height is the height in # pixels. fs is any file on that file # system. # fs_free (fs) Free space on a file system available # for users. # fs_free_perc (fs) Free percentage of space on a file # system available for users. # fs_size (fs) File system size # fs_used (fs) File system used space # hr (height) Horizontal line, height is the height in # pixels # i2c (dev), type, n I2C sensor from sysfs (Linux 2.6). dev # may be omitted if you have only one I2C # device. type is either in (or vol) # meaning voltage, fan meaning fan or temp # meaning temperature. n is number of the # sensor. See /sys/bus/i2c/devices/ on # your local computer. # kernel Kernel version # loadavg (1), (2), (3) System load average, 1 is for past 1 # minute, 2 for past 5 minutes and 3 for # past 15 minutes. # machine Machine, i686 for example # mails Mail count in mail spool. You can use # program like fetchmail to get mails from # some server using your favourite # protocol. See also new_mails. # mem Amount of memory in use # membar (height) Bar that shows amount of memory in use # memmax Total amount of memory # memperc Percentage of memory in use # new_mails Unread mail count in mail spool. # nodename Hostname # outlinecolor (color) Change outline color # pre_exec shell command Executes a shell command one time before # torsmo displays anything and puts output # as text. # processes Total processes (sleeping and running) # running_processes Running processes (not sleeping), # requires Linux 2.6 # shadecolor (color) Change shading color # stippled_hr (space), Stippled (dashed) horizontal line # (height) # swapbar (height) Bar that shows amount of swap in use # swap Amount of swap in use # swapmax Total amount of swap # swapperc Percentage of swap in use # sysname System name, Linux for example # temp1 Temperature #1 from i2c-sensors, same as # ${i2c temp 1} # temp2 Temperature #2 from i2c-sensors, same as # ${i2c temp 2} # time (format) Local time, see man strftime to get more # information about format # totaldown net Total download, overflows at 4 GB on # Linux with 32-bit arch and there doesn't # seem to be a way to know how many times # it has already done that before torsmo # has started. # totalup net Total upload, this one too, may overflow # updates Number of updates (for debugging) # upspeed net Upload speed in kilobytes # upspeedf net Upload speed in kilobytes with one # decimal # uptime Uptime # uptime_short Uptime in a shorter format # 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 # ${color}$hr # ${color}Mails: ${color slategrey}$mails${color} New: ${color slategrey}$new_mails${color} | ${color}Battery:${color slategrey} ${battery} % #to be inserted #------------------------------------- # ${execi 40000 cal} #${color yellow}RAM :${color yellow} $memperc% $mem/$memmax $membar #${color yellow}SWAP:${color yellow} $swapperc% $swap/$swapmax $swapbar #${color yellow}ROOT:${color yellow} ${fs_free_perc /}% ${fs_free /}/${fs_size /} ${fs_bar /} #$hr #------------------------------------- # These are the characters and corresponding graphic for the weather font # copy these into the text area and remove the # to see the match #${color yellow} #${font courier:size=20}ABCDEFGHIJ #${font Weather:size=30}ABCDEFGHIJ #${font courier:size=20}KLMNOP #${font Weather:size=30}KLMNOP #${font courier:size=20}abcdefghijk #${font Weather:size=30}abcdefghijk #${font courier:size=20}lmnopqrstu #${font Weather:size=30}lmnopqrstu #${font courier:size=20}vwxyz #${font Weather:size=30}vwxyz TEXT ${exec assortedconky.sh} ${font DejaVu LGC Sans Mono:Bold:size=8}${color white}$nodename${alignr}$sysname $kernel $machine ${color white}${time %a, }${time %b %e %l:%M %P} ${alignr}UpTime: $uptime $hr Current CPU Freq. ${freq}Mhz (${cpu}%) ${cpugraph 40 ffff00 00ff00} Stats ${offset 12}CPU: ${offset 12}Mob: ${offset 12}hda: ${offset 12}GPU: ${offset 12}RAM: ${offset 11}Swap: ${offset 11}HDFree: ${offset 11}Load: ${color green}${offset 49}${if_existing /tmp/.hardwaretemp/CPU.WARM}${color orange}$endif${if_existing /tmp/.hardwaretemp/CPU.HOT}${color red}$endif${exec cat /tmp/thinkpadtemps.txt|cut -f1}${offset -5}C${color green}${offset 15}${if_existing /tmp/.hardwaretemp/PCI.WARM}${color orange}$endif${if_existing /tmp/.hardwaretemp/PCI.HOT}${color red}$endif${exec cat /tmp/thinkpadtemps.txt|cut -f2}${offset -5}C${color green}${if_existing /tmp/.hardwaretemp/HDD.WARM}${color orange}$endif${if_existing /tmp/.hardwaretemp/HDD.HOT}${color red}$endif${offset 17}${exec cat /tmp/thinkpadtemps.txt|cut -f3}${offset -5}C${color green}${if_existing /tmp/.hardwaretemp/GPU.WARM}${color orange}$endif${if_existing /tmp/.hardwaretemp/GPU.HOT}${color red}$endif${offset 17}${exec cat /tmp/thinkpadtemps.txt|cut -f4}${offset -5}C${color green}${offset 24}$memperc% ${offset 19}$swapperc% ${offset 25}${exec cat /tmp/harddiskspace.txt}${offset 30}${loadavg 1} ${color white} NetUp: ${upspeed eth0} k/s ${alignc}IP Address ${addr eth0} ${alignr}NetDown: ${downspeed eth0} k/s ${upspeedgraph eth0 32,180 ffff00 00ff00} $alignr${downspeedgraph eth0 32,180 00ff00 ffff00} ${color #ffcb48}Hosts Status${color white} ${color #98c2c7}${texeci 150 silentping.sh xxx.xxx.xxx.xxx "up" "down"}${if_existing /tmp/.status/xxx.xxx.xxx.xxx.up}${color green}Prims UP$else${color red}Prims Down$endif ${color #98c2c7}${texeci 150 silentping.sh xxx.xxx.xxx.xxx "up" "down"}${if_existing /tmp/.status/xxx.xxx.xxx.xxx.up}${color green}Dual UP$else${color red}Dual Down$endif ${color #98c2c7}${texeci 150 silentping.sh xxx.xxx.xxx.xxx "up" "down"}${if_existing /tmp/.status/xxx.xxx.xxx.xxx.up}${color green}station UP$else${color red}station Down$endif ${color white} Last 6 log entries --------------------- ${color white}${exec cat /tmp/shorttail.txt} ${font DejaVu LGC Sans Mono:Bold:size=8}${color white}${offset 10}Latest BBC News Headlines: ${color white}${execi 300 conky-rss.sh http://newsrss.bbc.co.uk/rss/newsplayer_uk_edition/front_page/rss.xml 5 2} ${offset 10}Latest Reg Headlines: ${execi 300 conky-rss.sh http://www.theregister.co.uk/headlines.rss 5 2} ${font DejaVu LGC Sans Mono:Bold:size=8}${color white}Weather for London City (EGLC) ${execi 1800 tweather.sh} ${color white}${tab 120}${exec cat /tmp/wdaynames.txt} Temp AM C${color yellow}${tab 60}${exec cat /tmp/wmrealtemp.txt} ${color white}Wind AM mph${color yellow}${tab 60}${exec cat /tmp/wmwindspeed.txt} ${color white}Conditions AM${color yellow}${font Weather:size=22}${voffset -3}${tab 57}${exec cat /tmp/wmconditions.txt | cut -f1}${tab}${exec cat /tmp/wmconditions.txt | cut -f2}${tab}${exec cat /tmp/wmconditions.txt | cut -f3}${tab}${exec cat /tmp/wmconditions.txt | cut -f4}${tab}${exec cat /tmp/wmconditions.txt | cut -f5}${offset -3}${exec cat /tmp/wmconditions.txt | cut -f6}${font DejaVu LGC Sans Mono:Bold:size=8} ${font DejaVu LGC Sans Mono:Bold:size=8}${color white}Temp PM C${color yellow}${tab 60}${exec cat /tmp/warealtemp.txt} ${color white}Wind PM mph${color yellow}${tab 60}${exec cat /tmp/wawindspeed.txt} ${color white}Conditions PM${color yellow}${font Weather:size=22}${voffset -3}${tab 57}${exec cat /tmp/waconditions.txt | cut -f1}${tab}${exec cat /tmp/waconditions.txt | cut -f2}${tab}${exec cat /tmp/waconditions.txt | cut -f3}${tab}${exec cat /tmp/waconditions.txt | cut -f4}${tab}${exec cat /tmp/waconditions.txt | cut -f5}${offset -3}${exec cat /tmp/waconditions.txt | cut -f6}${font DejaVu LGC Sans Mono:Bold:size=8} ${font DejaVu LGC Sans Mono:Bold:size=8}${color white}Temp Ngt C${color yellow}${tab 60}${exec cat /tmp/wnrealtemp.txt} ${color white}Wind Ngt mph${color yellow}${tab 60}${exec cat /tmp/wnwindspeed.txt} ${color white}Conditions Ngt${color yellow}${font Weather:size=22}${voffset -3}${tab 57}${exec cat /tmp/wnconditions.txt | cut -f1}${tab}${exec cat /tmp/wnconditions.txt | cut -f2}${tab}${exec cat /tmp/wnconditions.txt | cut -f3}${tab}${exec cat /tmp/wnconditions.txt | cut -f4}${tab}${exec cat /tmp/wnconditions.txt | cut -f5}${offset -3}${exec cat /tmp/wnconditions.txt | cut -f6}${font DejaVu LGC Sans Mono:Bold:size=8} ${font DejaVu LGC Sans Mono:Bold:size=8}${color white}Wind Dir${tab 60}${exec cat /tmp/wmwinddir.txt}
Code:#!/bin/bash # Section is to capture the temperature from /proc/acpi/ibm/thermal #----------------------------------------------------------------- cat /proc/acpi/ibm/thermal | awk -F " " '{ORS=" "} {print $2,"\t",$3,"\t",$4,"\t",$5}' > /tmp/thinkpadtemps.txt cat /tmp/thinkpadtemps.txt | awk -F " " '{ORS=" "} {print $1}' > /tmp/thinkpadcputemp.txt cat /tmp/thinkpadtemps.txt | awk -F " " '{ORS=" "} {print $2}' > /tmp/thinkpadpcitemp.txt cat /tmp/thinkpadtemps.txt | awk -F " " '{ORS=" "} {print $3}' > /tmp/thinkpadhddtemp.txt cat /tmp/thinkpadtemps.txt | awk -F " " '{ORS=" "} {print $4}' > /tmp/thinkpadgputemp.txt HOT="HOT" COOL="COOL" WARM="WARM" # Now we have to convert those temps into filenames that identify the temp range #------------------------------------------------------------------------------- # create the directory if [ ! -d /tmp/.hardwaretemp ]; then mkdir /tmp/.hardwaretemp; fi # Get the cpu temp and set the status cat /tmp/thinkpadcputemp.txt | sed -e 's/2[0-9]/COOL/g;s/3[0-9]/COOL/g;s/4[0-9]/COOL/g;s/5[0-9]/COOL/g;s/6[0-9]/WARM/g;s/7[0-5]/WARM/g;s/7[6-9]/HOT/g;s/8[0-9]/HOT/g;s/9[0-9]/HOT/g' > /tmp/thinkpadcputemp.txt STATUSCPU="`cat /tmp/thinkpadcputemp.txt`" # Remove the old status if [ -f /tmp/.hardwaretemp/CPU. ]; then rm /tmp/.hardwaretemp/CPU.; fi if [ -f /tmp/.hardwaretemp/CPU.$COOL ]; then rm /tmp/.hardwaretemp/CPU.$COOL; fi if [ -f /tmp/.hardwaretemp/CPU.$WARM ]; then rm /tmp/.hardwaretemp/CPU.$WARM; fi if [ -f /tmp/.hardwaretemp/CPU.$HOT ]; then rm /tmp/.hardwaretemp/CPU.$HOT; fi # Create the new status file if [ ! -f /tmp/.hardwaretemp/CPU.$STATUSCPU ]; then touch /tmp/.hardwaretemp/CPU.$STATUSCPU; fi # Get the pci(mobo) temp and set the status cat /tmp/thinkpadpcitemp.txt | sed -e 's/2[0-9]/COOL/g;s/3[0-9]/COOL/g;s/4[0-9]/COOL/g;s/5[0-9]/COOL/g;s/6[0-4]/COOL/g;s/6[5-9]/WARM/g;s/7[0-9]/HOT/g;s/8[0-9]/HOT/g' > /tmp/thinkpadpcitemp.txt STATUSPCI="`cat /tmp/thinkpadpcitemp.txt`" # Remove the old status if [ -f /tmp/.hardwaretemp/PCI. ]; then rm /tmp/.hardwaretemp/PCI.; fi if [ -f /tmp/.hardwaretemp/PCI.$COOL ]; then rm /tmp/.hardwaretemp/PCI.$COOL; fi if [ -f /tmp/.hardwaretemp/PCI.$WARM ]; then rm /tmp/.hardwaretemp/PCI.$WARM; fi if [ -f /tmp/.hardwaretemp/PCI.$HOT ]; then rm /tmp/.hardwaretemp/PCI.$HOT; fi # Create the new status file if [ ! -f /tmp/.hardwaretemp/PCI.$STATUSPCI ]; then touch /tmp/.hardwaretemp/PCI.$STATUSPCI; fi # Get the HDD temp and set the status cat /tmp/thinkpadhddtemp.txt | sed -e 's/2[0-9]/COOL/g;s/3[0-9]/COOL/g;s/4[0-9]/COOL/g;s/5[0-5]/WARM/g;s/5[6-9]/HOT/g;s/6[0-9]/HOT/g;s/7[0-9]/HOT/g;s/8[0-9]/HOT/g' > /tmp/thinkpadhddtemp.txt STATUSHDD="`cat /tmp/thinkpadhddtemp.txt`" # Remove the old status if [ -f /tmp/.hardwaretemp/HDD.$COOL ]; then rm /tmp/.hardwaretemp/HDD.$COOL; fi if [ -f /tmp/.hardwaretemp/HDD.$WARM ]; then rm /tmp/.hardwaretemp/HDD.$WARM; fi if [ -f /tmp/.hardwaretemp/HDD.$HOT ]; then rm /tmp/.hardwaretemp/HDD.$HOT; fi # Create the new status file if [ ! -f /tmp/.hardwaretemp/HDD.$STATUSHDD ]; then touch /tmp/.hardwaretemp/HDD.$STATUSHDD; fi # Get the GPU temp and set the status cat /tmp/thinkpadgputemp.txt | sed -e 's/2[0-9]/COOL/g;s/3[0-9]/COOL/g;s/4[0-9]/COOL/g;s/5[0-9]/COOL/g;s/6[0-9]/COOL/g;s/7[0-9]/COOL/g;s/8[0-9]/COOL/g;s/9[0-9]/HOT/g;s/10[0-9]/HOT/g' > /tmp/thinkpadgputemp.txt STATUSGPU="`cat /tmp/thinkpadgputemp.txt`" # Remove the old status if [ -f /tmp/.hardwaretemp/GPU.$COOL ]; then rm /tmp/.hardwaretemp/GPU.$COOL; fi if [ -f /tmp/.hardwaretemp/GPU.$WARM ]; then rm /tmp/.hardwaretemp/GPU.$WARM; fi if [ -f /tmp/.hardwaretemp/GPU.$HOT ]; then rm /tmp/.hardwaretemp/GPU.$HOT; fi # Create the new status file if [ ! -f /tmp/.hardwaretemp/GPU.$STATUSGPU ]; then touch /tmp/.hardwaretemp/GPU.$STATUSGPU; fi # Section is to identify amount of free space left on disk # -------------------------------------------------------- df /dev/sda3 -h > /tmp/harddiskspace.txt cat /tmp/harddiskspace.txt | tail -n 1 | awk -F " " '{ORS=" "} {print $4}' > /tmp/harddiskspace.txt cat /tmp/harddiskspace.txt | sed -e 's/1G/LOW/g' >/tmp/harddisklow.txt # Section is to capture the temperature from the hd using smart (not needed on thinkpads) #-------------------------------------------------------------- # smartctl -A /dev/hda | grep Temperature_Celsius | awk '{print $10}' > /tmp/hdtemp.txt # cat /tmp/hdtemp.txt # The next section is for the log/messages formatting #-------------------------------------------------------------- cat /var/log/messages | tail -n 6 > /tmp/currenttail.txt cat /tmp/currenttail.txt | awk -F " " '{ORS=" "} {print $1,$2,$3,$4,$5,$6,"\n",$7,$8,$9,$10,$11,$12,"\n","\n"}' > /tmp/shorttail.txt #prints all the fields to 'standardise' the spacing (needed to identify and substitute 'Cloudy' as against 'Partly Cloudy' # ------------ SEDS and AWKS if I need to parse any of the data files ---------------------- #cat /tmp/shorttail.txt | sed -e 's/°c//g' -e 's/mb//g' -e 's/mm//g' -e 's/Wind from//g' -e 's/mph//g' -e 's/\%//g' > /tmp/tidytail.txt # strips out unneeded data # cat $filetoday | sed -e 's/Partly Cloudy/c/g' -e 's/Cloudy/d/g' -e 's/Fair/C/g' -e 's/Heavy Rain/j/g' -e 's/Light Rain/i/g' -e 's/Mainly Clear/b/g' -e 's/Sunny/A/g' -e 's/Intermittent Rain/e/g' -e 's/Clear/K/g' -e 's/Showers/e/g' -e 's/Mist/l/g' > $filetoday # converts weather descriptions to weather font character - standardises field numbers before final strip !! NEEDS TO BE ADDED TO # cat $filetoday | awk -F " " '{print $1,$2,$3,$7,$9,$10,"\n",$11,$12,$13,$17,$19,$20,"\n",$21,$22,$23,$27,$29,$30}' > $filetoday # we've now got just the data we want and in a standardised format
tweather.sh
Code:#!/bin/bash # Released under GPL - Feel free to modify code as appropriate - please include credit to original source # This script takes the source data from a UK weather site and formats it into a usage I wanted for Conky # I've never written scripting using awk, grep and sed in linux before this so it was an exercise for me # I'm sure that a more experienced scripter would get the code to be substantially more effecient # however I had to do it a stage at a time to help me understand what was happening. # The parsing of the individual day datablocks was especially difficult as they spread over multiple lines and # in many instances this caused spacing or EOL/CR/LF issues with specific fields I was trying to identify (for example # I spent half a day trying to get sed to delete EOL properly on $filetoday before I discovered with tr it was easy). # I'm sure the code could be modified to use different source sites - please if you do mods post them back to the # Conky project page on sourceforge. # To allow you to use the weather fonts you'll need to install the weather font from http://www.dafont.com/weather.font # Please note that how the fonts are handled are usually distro specific and you'll need to work this bit out for yourself. # Hopefully this will be useful to you - all feedback gratefully received. file=/tmp/wmetcheckcom.txt #The original Source file filedatablock=/tmp/weatherdatablock.txt #The source file stripped of lots of garbage filetempblock=/tmp/wtempblock.txt #temp file stipped of more garbage filetoday=/tmp/weathertoday.txt #The data block for todays weather filetoday1=/tmp/weathertoday1.txt #The data block for tomorrows weather filetoday2=/tmp/weathertoday2.txt #The data block for next day weather filetoday3=/tmp/weathertoday3.txt # so on as above till day 6 filetoday4=/tmp/weathertoday4.txt filetoday5=/tmp/weathertoday5.txt filetoday6=/tmp/weathertoday6.txt daynames=/tmp/wdaynames.txt sunriseset=/tmp/weathersunriseset.txt #The data for sunrise and sunset times for today shorttoday=/tmp/wshorttoday.txt #sets the short form for todays date i.e. Fri 11 to identify where the data block starts in original source file arealtemp=/tmp/warealtemp.txt #afternoon real temp awindchill=/tmp/wawindchill.txt #afternoon wind chill awindspd=/tmp/wawindspeed.txt #afternoon wind speed awinddir=/tmp/wawinddir.txt #afternoon wind direction aconditions=/tmp/waconditions.txt #afternoon conditions mrealtemp=/tmp/wmrealtemp.txt #morning real temp mwindchill=/tmp/wmwindchill.txt #morning wind chill mwindspd=/tmp/wmwindspeed.txt #morning wind speed mwinddir=/tmp/wmwinddir.txt #morning wind direction mconditions=/tmp/wmconditions.txt #morning conditions nrealtemp=/tmp/wnrealtemp.txt #night real temp nwindchill=/tmp/wnwindchill.txt #night wind chill nwindspd=/tmp/wnwindspeed.txt #night wind speed nwinddir=/tmp/wnwinddir.txt #night wind direction nconditions=/tmp/wnconditions.txt #night conditions alldata=/tmp/walldata.txt isitcoldorhot=/tmp/isitcoldorhot.txt #All Data today="`date +%a' '%-e`" #todays date in format Fri 11 - padded spaces stripped today1="`date --date="tomorrow" +%a' '%-e`" #tomorrows date in format Sat 12 - padded spaces stripped today2="`date --date="2 days" +%a' '%-e`" #as above till 6 days today3="`date --date="3 days" +%a' '%-e`" today4="`date --date="4 days" +%a' '%-e`" today5="`date --date="5 days" +%a' '%-e`" today6="`date --date="6 days" +%a' '%-e`" location=http://www.metcheck.com/V40/UK/FREE/7days.asp?zipcode=EGLC #the location from which to pull the file - change by changing EGLC location to yours (UK only supported) lynx -accept_all_cookies -dump $location > $file #get the raw data from the location above and dump into the original source file cat $file | grep "this week in " -A 60 > $filedatablock #identifies the start of the actual weather data block and dumps the next 60 lines sed -e '/bullet_15.gif/d' $filedatablock > $filetempblock cat $filetempblock > $filedatablock cat $filedatablock | grep "Sunrise : " | awk -F " " '{ORS=" "} {print $13 , $15}' > $sunriseset #extracts todays sunrise and sunset time from datablock cat $filedatablock | grep "Sunset : " | awk -F " " '{print $1 , $3}' >> $sunriseset echo $today sed -e '/./{H;$!d;}' -e "x;/ $today /!d;/ Afternoon /!d" $filedatablock > $filetoday #extracts the paragraph for today for the data block echo $today > $shorttoday cat $filetoday | grep -A 8 -f $shorttoday > $filetoday #only saves the data from the paragraph (looks for 'day date' ($shorttoday) to identify start of data) sed -e '/./{H;$!d;}' -e "x;/ $today1 /!d;/ Afternoon /!d" $filedatablock > $filetoday1 #saves datablock for tomorrow sed -e '/./{H;$!d;}' -e "x;/ $today2 /!d;/ Afternoon /!d" $filedatablock > $filetoday2 # and so on for 6 days sed -e '/./{H;$!d;}' -e "x;/ $today3 /!d;/ Afternoon /!d" $filedatablock > $filetoday3 sed -e '/./{H;$!d;}' -e "x;/ $today4 /!d;/ Afternoon /!d" $filedatablock > $filetoday4 sed -e '/./{H;$!d;}' -e "x;/ $today5 /!d;/ Afternoon /!d" $filedatablock > $filetoday5 sed -e '/./{H;$!d;}' -e "x;/ $today6 /!d;/ Afternoon /!d" $filedatablock > $filetoday6 # This is where we do the parsing......I know this code could be written substantially better/differently but it's my first attempt at this type of scripting - In total took me 2 days to write (with no knowledge of awk,sed or grep) # It's been written in this format so that's it's fairly easy to follow on a step by step basis cat $filetoday | tr '\n' ' ' > $filetoday # strips line feeds and EOL's from lines to put all data into one block cat $filetoday | awk -F " " '{ORS=" "} {print $4,$5,$6,$7,$8,$9,$10,$11,$12,$13,$14,$15,$16,$17,$18,$19,$20,$21,$22,$23,$24,$25,$26,$27,$28,$29,$30,$31,$32,$33,$34,$35,$36,$37,$38,$39,$40,$41,$42,$43,$44,$45,$46,$47,$48,$49,$50,$51,$52,$53,$54,$55,$56,$57,$58,$59,$60}' > $filetoday #prints all the fields to 'standardise' the spacing (needed to identify and substitute 'Cloudy' as against 'Partly Cloudy' cat $filetoday | sed -e 's/°c//g' -e 's/mb//g' -e 's/mm//g' -e 's/Wind from//g' -e 's/mph//g' -e 's/\%//g' > $filetoday # strips out unneeded data cat $filetoday | sed -e 's/Partly Cloudy/c/g' -e 's/Cloudy/d/g' -e 's/Fair/C/g' -e 's/Heavy Rain/j/g' -e 's/Light Rain/i/g' -e 's/Mainly Clear/b/g' -e 's/Sunny/A/g' -e 's/Intermittent Rain/e/g' -e 's/Clear/K/g' -e 's/Showers/e/g' -e 's/Mist/l/g' > $filetoday # converts weather descriptions to weather font character - standardises field numbers before final strip !! NEEDS TO BE ADDED TO cat $filetoday | awk -F " " '{print $1,$2,$3,$7,$9,$10,"\n",$11,$12,$13,$17,$19,$20,"\n",$21,$22,$23,$27,$29,$30}' > $filetoday # we've now got just the data we want and in a standardised format cat $filetoday1 | tr '\n' ' ' > $filetoday1 # strips line feeds and EOL's from lines to put all data into one block cat $filetoday1 | awk -F " " '{ORS=" "} {print $4,$5,$6,$7,$8,$9,$10,$11,$12,$13,$14,$15,$16,$17,$18,$19,$20,$21,$22,$23,$24,$25,$26,$27,$28,$29,$30,$31,$32,$33,$34,$35,$36,$37,$38,$39,$40,$41,$42,$43,$44,$45,$46,$47,$48,$49,$50,$51,$52,$53,$54,$55,$56,$57,$58,$59,$60}' > $filetoday1 #prints all the fields to 'standardise' the spacing (needed to identify and substitute 'Cloudy' as against 'Partly Cloudy' cat $filetoday1 | sed -e 's/°c//g' -e 's/mb//g' -e 's/mm//g' -e 's/Wind from//g' -e 's/mph//g' -e 's/\%//g' > $filetoday1 # strips out unneeded data cat $filetoday1 | sed -e 's/Partly Cloudy/c/g' -e 's/Cloudy/d/g' -e 's/Fair/C/g' -e 's/Heavy Rain/j/g' -e 's/Light Rain/i/g' -e 's/Mainly Clear/b/g' -e 's/Sunny/A/g' -e 's/Intermittent Rain/e/g' -e 's/Clear/K/g' -e 's/Showers/e/g' -e 's/Mist/l/g' > $filetoday1 # converts weather descriptions to weather font character - standardises field numbers before final strip !! NEEDS TO BE ADDED TO cat $filetoday1 | awk -F " " '{print $1,$2,$3,$7,$9,$10,"\n",$11,$12,$13,$17,$19,$20,"\n",$21,$22,$23,$27,$29,$30}' > $filetoday1 # we've now got just the data we want and in a standardised format cat $filetoday2 | tr '\n' ' ' > $filetoday2 # strips line feeds and EOL's from lines to put all data into one block cat $filetoday2 | awk -F " " '{ORS=" "} {print $4,$5,$6,$7,$8,$9,$10,$11,$12,$13,$14,$15,$16,$17,$18,$19,$20,$21,$22,$23,$24,$25,$26,$27,$28,$29,$30,$31,$32,$33,$34,$35,$36,$37,$38,$39,$40,$41,$42,$43,$44,$45,$46,$47,$48,$49,$50,$51,$52,$53,$54,$55,$56,$57,$58,$59,$60}' > $filetoday2 #prints all the fields to 'standardise' the spacing (needed to identify and substitute 'Cloudy' as against 'Partly Cloudy' cat $filetoday2 | sed -e 's/°c//g' -e 's/mb//g' -e 's/mm//g' -e 's/Wind from//g' -e 's/mph//g' -e 's/\%//g' > $filetoday2 # strips out unneeded data cat $filetoday2 | sed -e 's/Partly Cloudy/c/g' -e 's/Cloudy/d/g' -e 's/Fair/C/g' -e 's/Heavy Rain/j/g' -e 's/Light Rain/i/g' -e 's/Mainly Clear/b/g' -e 's/Sunny/A/g' -e 's/Intermittent Rain/e/g' -e 's/Clear/K/g' -e 's/Showers/e/g' -e 's/Mist/l/g' > $filetoday2 # converts weather descriptions to weather font character - standardises field numbers before final strip !! NEEDS TO BE ADDED TO cat $filetoday2 | awk -F " " '{print $1,$2,$3,$7,$9,$10,"\n",$11,$12,$13,$17,$19,$20,"\n",$21,$22,$23,$27,$29,$30}' > $filetoday2 # we've now got just the data we want and in a standardised format cat $filetoday3 | tr '\n' ' ' > $filetoday3 # strips line feeds and EOL's from lines to put all data into one block cat $filetoday3 | awk -F " " '{ORS=" "} {print $4,$5,$6,$7,$8,$9,$10,$11,$12,$13,$14,$15,$16,$17,$18,$19,$20,$21,$22,$23,$24,$25,$26,$27,$28,$29,$30,$31,$32,$33,$34,$35,$36,$37,$38,$39,$40,$41,$42,$43,$44,$45,$46,$47,$48,$49,$50,$51,$52,$53,$54,$55,$56,$57,$58,$59,$60}' > $filetoday3 #prints all the fields to 'standardise' the spacing (needed to identify and substitute 'Cloudy' as against 'Partly Cloudy' cat $filetoday3 | sed -e 's/°c//g' -e 's/mb//g' -e 's/mm//g' -e 's/Wind from//g' -e 's/mph//g' -e 's/\%//g' > $filetoday3 # strips out unneeded data cat $filetoday3 | sed -e 's/Partly Cloudy/c/g' -e 's/Cloudy/d/g' -e 's/Fair/C/g' -e 's/Heavy Rain/j/g' -e 's/Light Rain/i/g' -e 's/Mainly Clear/b/g' -e 's/Sunny/A/g' -e 's/Intermittent Rain/e/g' -e 's/Clear/K/g' -e 's/Showers/e/g' -e 's/Mist/l/g' > $filetoday3 # converts weather descriptions to weather font character - standardises field numbers before final strip !! NEEDS TO BE ADDED TO cat $filetoday3 | awk -F " " '{print $1,$2,$3,$7,$9,$10,"\n",$11,$12,$13,$17,$19,$20,"\n",$21,$22,$23,$27,$29,$30}' > $filetoday3 # we've now got just the data we want and in a standardised format cat $filetoday4 | tr '\n' ' ' > $filetoday4 # strips line feeds and EOL's from lines to put all data into one block cat $filetoday4 | awk -F " " '{ORS=" "} {print $4,$5,$6,$7,$8,$9,$10,$11,$12,$13,$14,$15,$16,$17,$18,$19,$20,$21,$22,$23,$24,$25,$26,$27,$28,$29,$30,$31,$32,$33,$34,$35,$36,$37,$38,$39,$40,$41,$42,$43,$44,$45,$46,$47,$48,$49,$50,$51,$52,$53,$54,$55,$56,$57,$58,$59,$60}' > $filetoday4 #prints all the fields to 'standardise' the spacing (needed to identify and substitute 'Cloudy' as against 'Partly Cloudy' cat $filetoday4 | sed -e 's/°c//g' -e 's/mb//g' -e 's/mm//g' -e 's/Wind from//g' -e 's/mph//g' -e 's/\%//g' > $filetoday4 # strips out unneeded data cat $filetoday4 | sed -e 's/Partly Cloudy/c/g' -e 's/Cloudy/d/g' -e 's/Fair/C/g' -e 's/Heavy Rain/j/g' -e 's/Light Rain/i/g' -e 's/Mainly Clear/b/g' -e 's/Sunny/A/g' -e 's/Intermittent Rain/e/g' -e 's/Clear/K/g' -e 's/Showers/e/g' -e 's/Mist/l/g' > $filetoday4 # converts weather descriptions to weather font character - standardises field numbers before final strip !! NEEDS TO BE ADDED TO cat $filetoday4 | awk -F " " '{print $1,$2,$3,$7,$9,$10,"\n",$11,$12,$13,$17,$19,$20,"\n",$21,$22,$23,$27,$29,$30}' > $filetoday4 # we've now got just the data we want and in a standardised format cat $filetoday5 | tr '\n' ' ' > $filetoday5 # strips line feeds and EOL's from lines to put all data into one block cat $filetoday5 | awk -F " " '{ORS=" "} {print $4,$5,$6,$7,$8,$9,$10,$11,$12,$13,$14,$15,$16,$17,$18,$19,$20,$21,$22,$23,$24,$25,$26,$27,$28,$29,$30,$31,$32,$33,$34,$35,$36,$37,$38,$39,$40,$41,$42,$43,$44,$45,$46,$47,$48,$49,$50,$51,$52,$53,$54,$55,$56,$57,$58,$59,$60}' > $filetoday5 #prints all the fields to 'standardise' the spacing (needed to identify and substitute 'Cloudy' as against 'Partly Cloudy' cat $filetoday5 | sed -e 's/°c//g' -e 's/mb//g' -e 's/mm//g' -e 's/Wind from//g' -e 's/mph//g' -e 's/\%//g' > $filetoday5 # strips out unneeded data cat $filetoday5 | sed -e 's/Partly Cloudy/c/g' -e 's/Cloudy/d/g' -e 's/Fair/C/g' -e 's/Heavy Rain/j/g' -e 's/Light Rain/i/g' -e 's/Mainly Clear/b/g' -e 's/Sunny/A/g' -e 's/Intermittent Rain/e/g' -e 's/Clear/K/g' -e 's/Showers/e/g' -e 's/Mist/l/g' > $filetoday5 # converts weather descriptions to weather font character - standardises field numbers before final strip !! NEEDS TO BE ADDED TO cat $filetoday5 | awk -F " " '{print $1,$2,$3,$7,$9,$10,"\n",$11,$12,$13,$17,$19,$20,"\n",$21,$22,$23,$27,$29,$30}' > $filetoday5 # we've now got just the data we want and in a standardised format cat $filetoday6 | tr '\n' ' ' > $filetoday6 # strips line feeds and EOL's from lines to put all data into one block cat $filetoday6 | awk -F " " '{ORS=" "} {print $4,$5,$6,$7,$8,$9,$10,$11,$12,$13,$14,$15,$16,$17,$18,$19,$20,$21,$22,$23,$24,$25,$26,$27,$28,$29,$30,$31,$32,$33,$34,$35,$36,$37,$38,$39,$40,$41,$42,$43,$44,$45,$46,$47,$48,$49,$50,$51,$52,$53,$54,$55,$56,$57,$58,$59,$60}' > $filetoday6 #prints all the fields to 'standardise' the spacing (needed to identify and substitute 'Cloudy' as against 'Partly Cloudy' cat $filetoday6 | sed -e 's/°c//g' -e 's/mb//g' -e 's/mm//g' -e 's/Wind from//g' -e 's/mph//g' -e 's/\%//g' > $filetoday6 # strips out unneeded data cat $filetoday6 | sed -e 's/Partly Cloudy/c/g' -e 's/Cloudy/d/g' -e 's/Fair/C/g' -e 's/Heavy Rain/j/g' -e 's/Light Rain/i/g' -e 's/Mainly Clear/b/g' -e 's/Sunny/A/g' -e 's/Intermittent Rain/e/g' -e 's/Clear/K/g' -e 's/Showers/e/g' -e 's/Mist/l/g' > $filetoday6 # converts weather descriptions to weather font character - standardises field numbers before final strip !! NEEDS TO BE ADDED TO cat $filetoday6 | awk -F " " '{print $1,$2,$3,$7,$9,$10,"\n",$11,$12,$13,$17,$19,$20,"\n",$21,$22,$23,$27,$29,$30}' > $filetoday6 # we've now got just the data we want and in a standardised format # Now we have to format the data and transpose some settings for day or night characters - then output to files that conky can import directly echo $today | awk -F " " '{ORS=" "} {print $1}' > $daynames echo $today1 | awk -F " " '{ORS=" "} {print $1}' >> $daynames echo $today2 | awk -F " " '{ORS=" "} {print $1}' >> $daynames echo $today3 | awk -F " " '{ORS=" "} {print $1}' >> $daynames echo $today4 | awk -F " " '{ORS=" "} {print $1}' >> $daynames echo $today5 | awk -F " " '{print $1}' >> $daynames cat $daynames | awk -F " " '{print $1,"\t",$2,"\t",$3,"\t",$4,"\t",$5,"\t",$6}' > $daynames cat $filetoday | grep "Morning" | awk -F " " '{ORS=" "} {print $2,"\t"}' > $mrealtemp cat $filetoday1 | grep "Morning" | awk -F " " '{ORS=" "} {print $2,"\t"}' >> $mrealtemp cat $filetoday2 | grep "Morning" | awk -F " " '{ORS=" "} {print $2,"\t"}' >> $mrealtemp cat $filetoday3 | grep "Morning" | awk -F " " '{ORS=" "} {print $2,"\t"}' >> $mrealtemp cat $filetoday4 | grep "Morning" | awk -F " " '{ORS=" "} {print $2,"\t"}' >> $mrealtemp cat $filetoday5 | grep "Morning" | awk -F " " '{ORS=" "} {print $2,"\t"}'>> $mrealtemp cat $filetoday6 | grep "Morning" | awk -F " " '{print $2,"\t"}' >> $mrealtemp cat $mrealtemp | awk -F " " '{print $1,"\t",$2,"\t",$3,"\t",$4,"\t",$5,"\t",$6}' > $mrealtemp cat $mrealtemp | sed -e 's/ -8 /cold/g' -e 's/ -7 /cold/g' -e 's/ -6 /cold/g' -e 's/ -5 /cold/g' -e 's/ -4 /cold/g' -e 's/ -3 /cold/g' -e 's/ -2 /cold/g' -e 's/ -1 /cold/g' -e 's/ 0 /cold/g' -e 's/ 1 /cold/g' -e 's/ 2 /cold/g' -e 's/ 3 /cold/g' -e 's/ 4 /cold/g' -e 's/ 5 /cold/g' -e 's/ 6 /cold/g' -e 's/ 7 /cold/g' -e 's/ 15 /hot/g' > $isitcoldorhot cat $mrealtemp | awk -F " " '{print $1,$2,$3,$4,$5,$6,$7,$8}' > $alldata cat $filetoday | grep "Afternoon" | awk -F " " '{ORS=" "} {print $2,"\t"}' > $arealtemp cat $filetoday1 | grep "Afternoon" | awk -F " " '{ORS=" "} {print $2,"\t"}' >> $arealtemp cat $filetoday2 | grep "Afternoon" | awk -F " " '{ORS=" "} {print $2,"\t"}' >> $arealtemp cat $filetoday3 | grep "Afternoon" | awk -F " " '{ORS=" "} {print $2,"\t"}' >> $arealtemp cat $filetoday4 | grep "Afternoon" | awk -F " " '{ORS=" "} {print $2,"\t"}' >> $arealtemp cat $filetoday5 | grep "Afternoon" | awk -F " " '{ORS=" "} {print $2,"\t"}'>> $arealtemp cat $filetoday6 | grep "Afternoon" | awk -F " " '{print $2,"\t"}' >> $arealtemp cat $arealtemp | awk -F " " '{print $1,"\t",$2,"\t",$3,"\t",$4,"\t",$5,"\t",$6}' > $arealtemp cat $arealtemp | awk -F " " '{print $1,$2,$3,$4,$5,$6,$7,$8}' > $alldata cat $filetoday | grep "Evening" | awk -F " " '{ORS=" "} {print $2,"\t"}' > $nrealtemp cat $filetoday1 | grep "Evening" | awk -F " " '{ORS=" "} {print $2,"\t"}' >> $nrealtemp cat $filetoday2 | grep "Evening" | awk -F " " '{ORS=" "} {print $2,"\t"}' >> $nrealtemp cat $filetoday3 | grep "Evening" | awk -F " " '{ORS=" "} {print $2,"\t"}' >> $nrealtemp cat $filetoday4 | grep "Evening" | awk -F " " '{ORS=" "} {print $2,"\t"}' >> $nrealtemp cat $filetoday5 | grep "Evening" | awk -F " " '{ORS=" "} {print $2,"\t"}'>> $nrealtemp cat $filetoday6 | grep "Evening" | awk -F " " '{print $2,"\t"}' >> $nrealtemp cat $nrealtemp | awk -F " " '{print $1,"\t",$2,"\t",$3,"\t",$4,"\t",$5,"\t",$6}' > $nrealtemp cat $nrealtemp | awk -F " " '{print $1,$2,$3,$4,$5,$6,$7,$8}' > $alldata cat $filetoday | grep "Morning" | awk -F " " '{ORS=" "} {print $5,"\t"}' > $mwindspd cat $filetoday1 | grep "Morning" | awk -F " " '{ORS=" "} {print $5,"\t"}' >> $mwindspd cat $filetoday2 | grep "Morning" | awk -F " " '{ORS=" "} {print $5,"\t"}' >> $mwindspd cat $filetoday3 | grep "Morning" | awk -F " " '{ORS=" "} {print $5,"\t"}' >> $mwindspd cat $filetoday4 | grep "Morning" | awk -F " " '{ORS=" "} {print $5,"\t"}' >> $mwindspd cat $filetoday5 | grep "Morning" | awk -F " " '{ORS=" "} {print $5,"\t"}' >> $mwindspd cat $filetoday6 | grep "Morning" | awk -F " " '{print $5}' >> $mwindspd cat $mwindspd | awk -F " " '{print $1,"\t",$2,"\t",$3,"\t",$4,"\t",$5,"\t",$6}' > $mwindspd cat $mwindspd | awk -F " " '{print $1,$2,$3,$4,$5,$6}' >>$alldata cat $filetoday | grep "Afternoon" | awk -F " " '{ORS=" "} {print $5,"\t"}' > $awindspd cat $filetoday1 | grep "Afternoon" | awk -F " " '{ORS=" "} {print $5,"\t"}' >> $awindspd cat $filetoday2 | grep "Afternoon" | awk -F " " '{ORS=" "} {print $5,"\t"}' >> $awindspd cat $filetoday3 | grep "Afternoon" | awk -F " " '{ORS=" "} {print $5,"\t"}' >> $awindspd cat $filetoday4 | grep "Afternoon" | awk -F " " '{ORS=" "} {print $5,"\t"}' >> $awindspd cat $filetoday5 | grep "Afternoon" | awk -F " " '{ORS=" "} {print $5,"\t"}' >> $awindspd cat $filetoday6 | grep "Afternoon" | awk -F " " '{print $5}' >> $awindspd cat $awindspd | awk -F " " '{print $1,"\t",$2,"\t",$3,"\t",$4,"\t",$5,"\t",$6}' > $awindspd cat $awindspd | awk -F " " '{print $1,$2,$3,$4,$5,$6}' >>$alldata cat $filetoday | grep "Evening" | awk -F " " '{ORS=" "} {print $5,"\t"}' > $nwindspd cat $filetoday1 | grep "Evening" | awk -F " " '{ORS=" "} {print $5,"\t"}' >> $nwindspd cat $filetoday2 | grep "Evening" | awk -F " " '{ORS=" "} {print $5,"\t"}' >> $nwindspd cat $filetoday3 | grep "Evening" | awk -F " " '{ORS=" "} {print $5,"\t"}' >> $nwindspd cat $filetoday4 | grep "Evening" | awk -F " " '{ORS=" "} {print $5,"\t"}' >> $nwindspd cat $filetoday5 | grep "Evening" | awk -F " " '{ORS=" "} {print $5,"\t"}' >> $nwindspd cat $filetoday6 | grep "Evening" | awk -F " " '{print $5}' >> $nwindspd cat $nwindspd | awk -F " " '{print $1,"\t",$2,"\t",$3,"\t",$4,"\t",$5,"\t",$6}' > $nwindspd cat $nwindspd | awk -F " " '{print $1,$2,$3,$4,$5,$6}' >>$alldata cat $filetoday | grep "Morning" | awk -F " " '{ORS=" "} {print $4,"\t"}' > $mwinddir cat $filetoday1 | grep "Morning" | awk -F " " '{ORS=" "} {print $4,"\t"}' >> $mwinddir cat $filetoday2 | grep "Morning" | awk -F " " '{ORS=" "} {print $4,"\t"}' >> $mwinddir cat $filetoday3 | grep "Morning" | awk -F " " '{ORS=" "} {print $4,"\t"}' >> $mwinddir cat $filetoday4 | grep "Morning" | awk -F " " '{ORS=" "} {print $4,"\t"}' >> $mwinddir cat $filetoday5 | grep "Morning" | awk -F " " '{ORS=" "} {print $4,"\t"}' >> $mwinddir cat $filetoday6 | grep "Morning" | awk -F " " '{print $4}' >> $mwinddir cat $mwinddir | awk -F " " '{print $1,"\t",$2,"\t",$3,"\t",$4,"\t",$5,"\t",$6}' > $mwinddir cat $mwinddir | awk -F " " '{print $1,$2,$3,$4,$5,$6}' >>$alldata cat $filetoday | grep "Morning" | awk -F " " '{ORS=" "} {print $6,"\t"}' > $mconditions cat $filetoday1 | grep "Morning" | awk -F " " '{ORS=" "} {print $6,"\t"}' >> $mconditions cat $filetoday2 | grep "Morning" | awk -F " " '{ORS=" "} {print $6,"\t"}' >> $mconditions cat $filetoday3 | grep "Morning" | awk -F " " '{ORS=" "} {print $6,"\t"}' >> $mconditions cat $filetoday4 | grep "Morning" | awk -F " " '{ORS=" "} {print $6,"\t"}' >> $mconditions cat $filetoday5 | grep "Morning" | awk -F " " '{ORS=" "} {print $6,"\t"}' >> $mconditions cat $filetoday6 | grep "Morning" | awk -F " " '{print $6}' >> $mconditions cat $mconditions | awk -F " " '{print $1,"\t",$2,"\t",$3,"\t",$4,"\t",$5,"\t",$6}' > $mconditions cat $mconditions | awk -F " " '{print $1,$2,$3,$4,$5,$6}' >>$alldata cat $filetoday | grep "Afternoon" | awk -F " " '{ORS=" "} {print $6,"\t"}' > $aconditions cat $filetoday1 | grep "Afternoon" | awk -F " " '{ORS=" "} {print $6,"\t"}' >> $aconditions cat $filetoday2 | grep "Afternoon" | awk -F " " '{ORS=" "} {print $6,"\t"}' >> $aconditions cat $filetoday3 | grep "Afternoon" | awk -F " " '{ORS=" "} {print $6,"\t"}' >> $aconditions cat $filetoday4 | grep "Afternoon" | awk -F " " '{ORS=" "} {print $6,"\t"}' >> $aconditions cat $filetoday5 | grep "Afternoon" | awk -F " " '{ORS=" "} {print $6,"\t"}' >> $aconditions cat $filetoday6 | grep "Afternoon" | awk -F " " '{print $6}' >> $aconditions cat $aconditions | awk -F " " '{print $1,"\t",$2,"\t",$3,"\t",$4,"\t",$5,"\t",$6}' > $aconditions cat $aconditions | awk -F " " '{print $1,$2,$3,$4,$5,$6}' >>$alldata cat $filetoday | grep "Evening" | awk -F " " '{ORS=" "} {print $6,"\t"}' > $nconditions cat $filetoday1 | grep "Evening" | awk -F " " '{ORS=" "} {print $6,"\t"}' >> $nconditions cat $filetoday2 | grep "Evening" | awk -F " " '{ORS=" "} {print $6,"\t"}' >> $nconditions cat $filetoday3 | grep "Evening" | awk -F " " '{ORS=" "} {print $6,"\t"}' >> $nconditions cat $filetoday4 | grep "Evening" | awk -F " " '{ORS=" "} {print $6,"\t"}' >> $nconditions cat $filetoday5 | grep "Evening" | awk -F " " '{ORS=" "} {print $6,"\t"}' >> $nconditions cat $filetoday6 | grep "Evening" | awk -F " " '{print $6}' >> $nconditions cat $nconditions | sed -e 's/c/n/g' -e 's/d/o/g' -e 's/C/K/g' -e 's/j/t/g' -e 's/i/s/g' -e 's/b/m/g' -e 's/A/K/g' -e 's/e/s/g' > $nconditions # converts day weather font to night weather font character - NEEDS TO BE ADDED TO cat $nconditions | awk -F " " '{print $1,"\t",$2,"\t",$3,"\t",$4,"\t",$5,"\t",$6}' > $nconditions cat $nconditions | awk -F " " '{print $1,$2,$3,$4,$5,$6}' >>$alldata
Heres what im currently using. It needs no external scripts.
Code:background yes use_xft no xftfont Sans:size=8 xftalpha 0.8 update_interval 1 total_run_times 0 # Create own window own_window yes own_window_type override own_window_transparent 1 own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager double_buffer yes minimum_size 170 5 maximum_width 170 draw_shades no draw_outline no draw_borders no draw_graph_borders no default_color 000000 default_shade_color red default_outline_color green alignment top_right gap_x 18 gap_y 48 uppercase no cpu_avg_samples 2 net_avg_samples 1 override_utf8_locale no use_spacer yes TEXT - SYSTEM ( $sysname ) ${hr 1} Kernel:${alignr}$kernel Load:${alignr}${loadavg 3} ${loadavg 2} ${loadavg 1} Battery:${alignr}$battery - CPU ( ${freq_dyn_g}Ghz ) ${hr 1} Core 1 ${cpu cpu1}% ${cpubar cpu1} Core 2 ${cpu cpu2}% ${cpubar cpu2} ${cpugraph cpu0 16,170 000000 000000} - MEMORY/DISK ${hr 1} RAM $alignc $mem/$memmax $alignr $memperc% $membar ROOT $alignc ${fs_used /}/${fs_size /}$alignr${fs_used_perc /} % ${fs_bar /} i/o ${diskiograph 16,170 000000 000000} - NETWORK ( ${tcp_portmon 32768 61000 count} Conn. ) ${hr 1} MAC${alignr}${execi 300 ifconfig -a | grep ${1-eth1} | sed -n 's/^.*HWaddr[ \t]\([^ ]*\).*$/\1/p'} local ip ${alignr}${addr eth1} ip ${alignr}${execi 60 ruby -e "require 'net/http';Net::HTTP.get_print URI.parse('http://briancarper.net/cgi-bin/ip.cgi')"} Link strength:${alignr}${linkstatus eth1} / 100 eth1 down $alignr [${downspeedf eth1}kb/s] ${downspeedgraph eth1 16,170} eth1 up $alignr [${upspeedf eth1}kb/s] ${upspeedgraph eth1 16,170} - PROCESSES ( ${running_processes}/ ${processes}) ${hr 1} TOP CPU ${alignr}CPU % ${top name 1}$alignr${top cpu 1} ${top name 2}$alignr${top cpu 2} ${top name 3}$alignr${top cpu 3} TOP MEM ${alignr}MEM % ${top_mem name 1}$alignr${top_mem mem 1} ${top_mem name 2}$alignr${top_mem mem 2} ${top_mem name 3}$alignr${top_mem mem 3} - LOGGING ${hr 1} (/var/log/dmesg) ${execi 2 tail -n15 /var/log/dmesg | grep -v "message handler not found" | sed 's/\[.*\] \(.*\)/\1/' | grep '.....*' | tail -n5 } (/var/log/messages) ${execi 2 tail -n15 /var/log/messages | grep -v "message handler not found" | cut -c53-99 | grep '.....*' | tail -n5 } (/var/log/syslog) ${execi 2 tail -n15 /var/log/syslog | grep -v "message handler not found" | sed -e 's/.*: \([^:]*$\)/\1/' -e 's/^..*:..*:..*: \(.*$\)/\1/' | grep '.....*' | tail -n5 } -n5 }
Last edited by phaedOne; August 1st, 2007 at 04:21 AM.
Bookmarks