Posts: 150
rjm65
Joined: 20 Jan 2014
#1
I just installed mx-16 on my wife's old laptop which is NON-PAE...
I am looking for a desktop weather program that works...
I tried searching synaptic and found gdesklets and added 4 weather related gdesklets to it, they work and display on the desktop, but I can't seem to get my weather location to work in them...
Is there a working weather program that anyone knows about, and or maybe a working conky weather???
Thanks in advance for any help... __{{emoticon}}__
Last edited by rjm65 on 01 Feb 2017, 16:11, edited 1 time in total.
Posts: 521
Shay
Joined: 20 Apr 2015
#2
Inxi has weather built in

Code: Select all

inxi -w
inxi -wxxx
Inxi -W 97131 -xxx
See if those commands in terminal help.
Posts: 150
rjm65
Joined: 20 Jan 2014
#3
Thank you, those all work, but I was looking for something that displayed on the desktop, something similar to linux mint desklets weather... __{{emoticon}}__
Posts: 521
Shay
Joined: 20 Apr 2015
#4
Sorry, but I do hope someone can help you.
Posts: 604
thriftee
Joined: 27 Feb 2009
#5
Are you in the USA? I have one, but it's based on the National Weather Service here in the US.
Posts: 1,445
skidoo
Joined: 09 Feb 2012
#6
rjm65 wrote:I was looking for something that displayed on the desktop, something similar to linux mint desklets weather
v--------- LOTS of ideas here:
Topic: » Conky weather+moon scripts (Accuw/WUndergr/NWS/MoonGiant)

========= SCRAPER REMOVED AN EMBEDDED LINK HERE ===========
url was:"https://forums.bunsenlabs.org/viewtopic.php?id=189&p=54"
linktext was:"https://forums.bunsenlabs.org/viewtopic.php?id=189&p=54"
====================================



FWIW, instead of adding desktop distractions, I just check from terminal, on-demand
~.profile

Code: Select all

alias weather='curl http://wttr.in'
...or if the browser's open, I just surf to wttr.in
Posts: 150
rjm65
Joined: 20 Jan 2014
#7
skidoo wrote:
rjm65 wrote:I was looking for something that displayed on the desktop, something similar to linux mint desklets weather
v--------- LOTS of ideas here:
Topic: » Conky weather+moon scripts (Accuw/WUndergr/NWS/MoonGiant)

========= SCRAPER REMOVED AN EMBEDDED LINK HERE ===========
url was:"https://forums.bunsenlabs.org/viewtopic.php?id=189&p=54"
linktext was:"https://forums.bunsenlabs.org/viewtopic.php?id=189&p=54"
====================================



FWIW, instead of adding desktop distractions, I just check from terminal, on-demand
~.profile

Code: Select all

alias weather='curl http://wttr.in'
...or if the browser's open, I just surf to wttr.in
I actually liked the one that was on that forum link but I could not find anywhere to download it at....
Posts: 150
rjm65
Joined: 20 Jan 2014
#8
thriftee wrote:Are you in the USA? I have one, but it's based on the National Weather Service here in the US.
Yes I am in Pennsylvania, I could live with what I am seeing on your desktop, is the weather portion of your conkyrc easy to add to an existing conkyrc???
Posts: 4,164
rokytnji
Joined: 20 Feb 2009
#9
I know Sector11 as a online buddy. He is located in South America and is a Conky Guru in my estimation.
Since he lives in South America. He likes his conky complicated.
========= SCRAPER REMOVED AN EMBEDDED LINK HERE ===========
url was:"http://i.imgur.com/GC8p0SY.jpg"
linktext was:"Very very complicated."
====================================




Which from I am gathering from this thread. Complicated is not your forte.
I actually liked the one that was on that forum link but I could not find anywhere to download it at....
Living in the desert. My needs are not so complicated in AntiX conky.
========= SCRAPER REMOVED AN EMBEDDED LINK HERE ===========
url was:"antix.freeforu ms.org/post21567.html#p21567"
linktext was:"So my weather script is KISS."
====================================


I know you said your wifes computer is non-pae.But. I would like to see a

Code: Select all

inxi -Fxz
report.

I am sure if you ask nice like over here.


========= SCRAPER REMOVED AN EMBEDDED LINK HERE ===========
url was:"https://forum.mxlinux.org/viewforum.php?f=55"
linktext was:"https://forum.mxlinux.org/viewforum.php?f=55"
====================================


You can ask them to build you MX compatible package of Flair. Which can then be installed through Synaptic package manager.
Here is more info on flair for that thread you can open up in MX Forum when you ask for your weather Desktop Widget.

========= SCRAPER REMOVED AN EMBEDDED LINK HERE ===========
url was:"https://launchpad.net/~teejee2008/+archive/ubuntu/ppa/+packages"
linktext was:"https://launchpad.net/~teejee2008/+arch ... /+packages"
====================================


What flair looks like

Image

The package developers at MX Forums are very accommodating and helpful. Don't try adding Ubuntu PPA to install flair in MX linux. It might end badly for you. Just ask nicely and show what info I shared with you just now. I am sure they will build a flair package for MX.

Or. Fly with thrftees post. I have no dog in this hunt.
Posts: 150
rjm65
Joined: 20 Jan 2014
#10
rokytnji wrote:I know Sector11 as a online buddy. He is located in South America and is a Conky Guru in my estimation.
Since he lives in South America. He likes his conky complicated.
========= SCRAPER REMOVED AN EMBEDDED LINK HERE ===========
url was:"http://i.imgur.com/GC8p0SY.jpg"
linktext was:"Very very complicated."
====================================




Which from I am gathering from this thread. Complicated is not your forte.
Yes I would like something simple at this point in time, i spent two days now searching online and trying stuff with no luck at all...
I ran into problems when I first bought this machine on ebay, however the guys over at solydx found out the processor was non pae when they looked up the processor on a website...
MX-16 is flying on this machine and I am very happy with it...
I know the machine is old compared to the machines we have here at home, but we keep this one at my mother in laws house, so when my wife goes to visit on the weekends she don't have to be carrying her laptop back and forth...
here is the inxi you asked me for...

Code: Select all

$ inxi -Fxz
System:    Host: ibmt40 Kernel: 3.16.0-4-686-pae i686 (32 bit gcc: 4.8.4)
           Desktop: Xfce 4.12.2 (Gtk 2.24.25) Distro: MX-16_386 Metamorphosis 12 December 2016
Machine:   Device: laptop System: IBM product: 23737CU v: ThinkPad T40
           Mobo: IBM model: 23737CU BIOS: IBM v: 1RETDRWW (3.23 ) date: 06/18/2007
Battery    BAT0: charge: 4.0 Wh 101.0% condition: 4.0/47.5 Wh (8%)
           model: SANYO IBM-08K8193 status: Full
CPU:       Single core Intel Pentium M (-UP-) cache: 1024 KB
           flags: (sse sse2) bmips: 1598 speed/max: 800/1300 MHz
Graphics:  Card: Advanced Micro Devices [AMD/ATI] RV200/M7 [Mobility Radeon 7500] bus-ID: 01:00.0
           Display Server: X.Org 1.16.4 drivers: ati,radeon (unloaded: modesetting,fbdev,vesa)
           Resolution: 1024x768@60.00hz
           GLX Renderer: Mesa DRI R100 (RV200 4C57) x86/MMX/SSE2 DRI2
           GLX Version: 1.3 Mesa 12.0.3 Direct Rendering: Yes
Audio:     Card Intel 82801DB/DBL/DBM (ICH4/ICH4-L/ICH4-M) AC'97 Audio Controller
           driver: snd_intel8x0 ports: 1c00 18c0 bus-ID: 00:1f.5
           Sound: Advanced Linux Sound Architecture v: k3.16.0-4-686-pae
Network:   Card-1: Qualcomm Atheros AR5212/AR5213 Wireless Network Adapter
           driver: ath5k bus-ID: 02:02.0
           IF: wlan0 state: up mac: <filter>
           Card-2: Intel 82801DB PRO/100 VE (MOB) Ethernet Controller
           driver: e100 v: 3.5.24-k2-NAPI port: 8000 bus-ID: 02:08.0
           IF: eth0 state: down mac: <filter>
Drives:    HDD Total Size: 81.1GB (9.1% used)
           ID-1: /dev/sda model: HTS721080G9AT00 size: 80.0GB
           ID-2: USB /dev/sdb model: DataTraveler_2.0 size: 1.0GB
Partition: ID-1: / size: 72G used: 5.0G (8%) fs: ext4 dev: /dev/sda1
           ID-2: swap-1 size: 2.17GB used: 0.00GB (0%) fs: swap dev: /dev/sda2
Sensors:   System Temperatures: cpu: 42.0C mobo: 35.0C
           Fan Speeds (in rpm): cpu: N/A fan-1: 2996
Info:      Processes: 135 Uptime: 26 min Memory: 153.7/2023.1MB
           Init: SysVinit runlevel: 5 Gcc sys: 4.9.2 Client: Shell (bash 4.3.301) inxi: 2.3.8

cat /proc/cpuinfo

processor    : 0
vendor_id    : GenuineIntel
cpu family    : 6
model        : 9
model name    : Intel(R) Pentium(R) M processor 1300MHz
stepping    : 5
microcode    : 0x7
cpu MHz        : 600.000
cache size    : 1024 KB
fdiv_bug    : no
f00f_bug    : no
coma_bug    : no
fpu        : yes
fpu_exception    : yes
cpuid level    : 2
wp        : yes
flags        : fpu vme de pse tsc msr mce cx8 sep mtrr pge mca cmov clflush dts acpi mmx fxsr sse sse2 tm pbe bts est tm2
bogomips    : 1198.98
clflush size    : 64
cache_alignment    : 64
address sizes    : 32 bits physical, 32 bits virtual
power management: 
Posts: 1,139
masinick
Joined: 26 Apr 2008
#11
The Xfce desktop (which is available in MX-16) has an Xfce Weather applet available.

Using DuckDuckGo, I found this:
========= SCRAPER REMOVED AN EMBEDDED LINK HERE ===========
url was:"https://community.linuxmint.com/idea/view/418"
linktext was:"https://community.linuxmint.com/idea/view/418"
====================================
- they mention a Xfce weather applet.

I used to use a weather app that has been modified considerably over the years.
========= SCRAPER REMOVED AN EMBEDDED LINK HERE ===========
url was:"http://fungi.yuggoth.org/weather/"
linktext was:"http://fungi.yuggoth.org/weather/"
====================================
documents where it's at now. The code works on Linux systems; it's fast, efficient, fairly portable, and I believe that the current implementation is written in Python. I believe that a very old version used to use shell-based code with calls to a command browser, such as links, elinks, etc. I have not used this one recently, but it may be suitable for someone with a need for a light, fast interface that can probably be customized (provided you understand the code).

I also used
========= SCRAPER REMOVED AN EMBEDDED LINK HERE ===========
url was:"http://www.linuxquestions.org/questions/linux-newbie-8/weather-applet-832330/"
linktext was:"http://www.linuxquestions.org/questions ... et-832330/"
====================================
to point me in this direction.


========= SCRAPER REMOVED AN EMBEDDED LINK HERE ===========
url was:"http://www.wxforum.net/index.php?topic=29502.0"
linktext was:"http://www.wxforum.net/index.php?topic=29502.0"
====================================
has more information about many of the old scripts that have changed.


========= SCRAPER REMOVED AN EMBEDDED LINK HERE ===========
url was:"http://vortex.plymouth.edu/rwis/nh_zrwis.html"
linktext was:"http://vortex.plymouth.edu/rwis/nh_zrwis.html"
====================================
from Plymouth State University in Plymouth, NH always has some interesting stuff available.

Let me know if any of this is helpful.
Posts: 604
thriftee
Joined: 27 Feb 2009
#12
There is no big magic for weather in my conky. There is one line for a script getweatherc.sh I got the gets current conditions, which appears to not be working at the moment I took that snapshot (got it from a site like crunchbang), and a 2nd script I wrote getweather7d.sh which is working in the pic that takes the NWS 7 day forecast and trims out all the long words and extra words to squish it down to fit the conky screen well. All the scripts should be somewhere on the path. I use /usr/local/bin because for some odd reason /usr/local/sbin isn't always in the path. You need to find out and replace my KORD (airport code for Chicago O'Hare) and il/ilz014.txt (filename for NWS 7 day text forecast in Chicago area on NWS site) with values for your airport and 7 day text forecast files. So for Pennsylvania, they are in
========= SCRAPER REMOVED AN EMBEDDED LINK HERE ===========
url was:"http://tgftp.nws.noaa.gov/data/forecasts/zone/pa/"
linktext was:"http://tgftp.nws.noaa.gov/data/forecasts/zone/pa/"
====================================
and you go look at the files there to find the one you want tio use and put the pa/paz001.txt if you are in Erie, for example, into the .conkyrc to replace my il/ilz014.txt, and it will go get Erie's weather forecast every 600 seconds

Code: Select all

# .conkyrc - conky resource file
# Update interval in seconds
update_interval 5

text_buffer_size 6000
max_specials 600

# set to yes if you want Conky to be forked in the background
background yes

short_units yes

cpu_avg_samples 2
net_avg_samples 2

out_to_console no

# X font when Xft is disabled, you can pick one with program xfontsel
#font 7x12
#font 6x10
#font 7x13
 font 8x12
#font 7x12
#font *mintsmild.se*
#font -*-*-*-*-*-*-34-*-*-*-*-*-*-*
#font -artwiz-snap-normal-r-normal-*-*-100-*-*-p-*-iso8859-1

# Use Xft?
use_xft yes

# Xft font when Xft is enabled
xftfont Sans:size=10

# Create own window instead of using desktop (required in nautilus, pcmanfm and rox desktops)
own_window yes
own_window_type desktop
own_window_transparent yes
own_window_hints undecorated,sticky,skip_taskbar

# Text alpha when using Xft
xftalpha 0.8

#on_bottom no

# mail spool
#mail_spool $MAIL

# Use double buffering (reduces flicker, may not work for everyone)
double_buffer yes

# Minimum size of text area
minimum_size 445 869
maximum_width 545

# Gap between borders of screen and text
# x = distance from right edge
# y = distance from top edge
gap_x 15
gap_y 1

# Draw shades?
draw_shades no

# Draw outlines?
draw_outline no

# Draw borders around text
draw_borders no

# Stippled borders?
stippled_borders 0

# border margins
#border_margin 10

# border width
border_width 2

# color scheme
color0 black
color1 red
color2 green
color3 yellow
color4 blue
color5 magenta
color6 cyan
color7 white
# hot pink
#color8 #FF078B
# flourecent orange
#color9 #FF9C07

# Default colors and also border colors
default_color white
default_shade_color white
default_outline_color white

# Text alignment, other possible values are commented
#alignment top_left
alignment top_right
#alignment bottom_left
#alignment bottom_right

# Add spaces to keep things from moving about?  This only affects certain objects.
use_spacer right

# Subtract file system buffers from used memory?
no_buffers yes

# set to yes if you want all text to be in uppercase
uppercase no

# boinc (seti) dir
# seti_dir /opt/seti

# stuff after 'TEXT' will be formatted on screen
TEXT
${font Sans:size=16}${color #FF078B}${nodename}     ${font Sans:size=10}\
${color2}O/S: ${color}${head ~/.conkyosversion 1}\
${color2}CpuAvg: ${color}${freq_g}Ghz ${machine} - ${color}${cpu}%  ${color2}Temp: ${color}${acpitemp}'C   ${color2}System/kernel: ${color}$sysname $kernel
${color2}  Cpu 1: ${color}${cpu cpu1}% \
${if_match ${cpu cpu1} <= 50}\
${color green}${cpubar cpu1 9}\
${else}\
    ${if_match ${cpu cpu1} <= 80}\
${color orange}${cpubar cpu1 9}\
    ${else}\
${color red}${cpubar cpu1 9}\
    ${endif}\
${endif}
${color2}  Cpu 2: ${color}${cpu cpu2}% \
${if_match ${cpu cpu2} <= 50}\
${color green}${cpubar cpu2 9}\
${else}\
    ${if_match ${cpu cpu2} <= 80}\
${color orange}${cpubar cpu2 9}\
    ${else}\
${color red}${cpubar cpu2 9}\
    ${endif}\
${endif}
${color2}Ram : ${color}$mem${color}/${color}$memmax ${color}- $memperc% \
${if_match ${memperc} <= 50}\
${color green}${membar 9}\
${else}\
    ${if_match ${memperc} <= 80}\
${color orange}${membar 9}\
    ${else}\
${color red}${membar 9}\
    ${endif}\
${endif}
#${color2}Swap: ${color}$swap${color}/${color}$swapmax ${color}- ${color}$swapperc%    \
#${if_match ${swapperc} <= 10}\
#${color green}${swapbar 9}\
#${else}\
#    ${if_match ${swapperc} <= 60}\
#${color orange}${swapbar 9}\
#    ${else}\
#${color red}${swapbar 9}\
#    ${endif}\
#${endif}
#${if_existing /live/boot-dev/antiX/rootfs}
#${color2}RootFS:/live/persist-root:${color} ${fs_free /live/persist-root}Free ${color}= ${fs_free_perc /live/persist-root}%       \
#${if_match ${fs_free_perc /live/persist-root} < 10}\
#${color red}${fs_bar 9 /live/persist-root}\
#${else}\
#    ${if_match ${fs_free_perc /live/persist-root} < 20}\
#${color orange}${fs_bar 9 /live/persist-root}\
#    ${else}\
#${color green}${fs_bar 9 /live/persist-root}\
#    ${endif}\
#${endif}
#${else}\
#${color2}Root:/:${color} ${fs_free /}Free ${color}= ${fs_free_perc /}%       \
#${if_match ${fs_free_perc /} < 10}\
#${color red}${fs_bar 9 /}\
#${if_match ${fs_free_perc /} < 3}${execi 60 lowspace /}${endif}\
#${else}\
#    ${if_match ${fs_free_perc /} < 20}\
#${color orange}${fs_bar 9 /}\
#    ${else}\
#${color green}${fs_bar 9 /}\
#    ${endif}\
#${endif}\
#${endif}
${color2}Home:/home:${color} ${fs_free /home}Free ${color}= ${fs_free_perc /home}%       \
${if_match ${fs_free_perc /home} < 10}\
${color red}${fs_bar 9 /home}\
${if_match ${fs_free_perc /home} < 3}${execi 60 lowspace /home}${endif}\
${else}\
    ${if_match ${fs_free_perc /home} < 20}\
${color orange}${fs_bar 9 /home}\
    ${else}\
${color green}${fs_bar 9 /home}\
    ${endif}\
${endif}
${if_match"${battery_short BAT0}" >="G"}\
${else}\
${if_match"${battery_short BAT0}" >="F"}\
${color green}Battery ${battery BAT0} ${battery_bar 9 BAT0}\
${else}\
${if_match"${battery_short BAT0}" >="D"}\
${if_match ${battery_percent BAT0} > 75}\
${color yellow}Battery ${color green}${battery BAT0} ${battery_time BAT0} min ${battery_bar 9 BAT0}\
${else}\
${if_match ${battery_percent BAT0} > 50}\
${color yellow}Battery ${battery BAT0} ${battery_time BAT0} min ${battery_bar 9 BAT0}\
${else}\
${if_match ${battery_percent BAT0} > 35}\
${color orange}Battery ${battery BAT0} ${battery_time BAT0} min ${battery_bar 9 BAT0}\
${else}\
${color red}${blink PLUG IN CHARGER NOW!!!   }${color}\
${color red}Battery ${color red}${battery BAT0} ${battery_time BAT0} min ${battery_bar 9 BAT0}\
${if_match ${battery_percent BAT0} <= 20}${execi 60 lowbattery}${endif}\
${endif}\
${endif}\
${endif}\
${else}\
${if_match"${battery_short BAT0}" >="C"}\
${if_match ${battery_percent BAT0} > 50}\
${color2}Battery ${color green}${battery BAT0} ${battery_bar 9 BAT0}\
${else}\
${if_match ${battery_percent BAT0} > 25}\
${color2}Battery ${color yellow}${battery BAT0} ${battery_bar 9 BAT0}\
${else}\
${if_match ${battery_percent BAT0} > 10}\
${color2}Battery ${color orange}${battery BAT0} ${battery_bar 9 BAT0}\
${else}\
${color2}Battery ${color orange}${battery BAT0} ${battery_bar 9 BAT0}\
${endif}\
${endif}\
${endif}\
${endif}\
${endif}\
${endif}
${if_match ${acpitemp} > 77}${execi 60 hightemp}${endif}\
${color2}Wireless: ${color}${wireless_essid wlan0} ${color2}IP:${color} ${addr wlan0} ${color2}spd: ${color} ${wireless_bitrate wlan0} ${color2}strength: ${color3} ${wireless_link_bar 9 wlan0}
${color2}Processes: ${color}$processes  ${color2}Running: ${color}$running_processes ${color2}Uptime: ${color}$uptime   ${color2}wlan0 Up/Dn ${color}${upspeed wlan0}${color2}/${color}${downspeed wlan0}
${color3}Program Name         PID    CPU%  MEM%                            ${color2}eth0 Up/Dn ${color}${upspeed eth0}${color2}/${color}${downspeed eth0}
${color} ${top name 1} ${top pid 1} ${top cpu 1} ${top mem 1}
${color} ${top name 2} ${top pid 2} ${top cpu 2} ${top mem 2}
${color} ${top name 3} ${top pid 3} ${top cpu 3} ${top mem 3}
${color} ${top name 4} ${top pid 4} ${top cpu 4} ${top mem 4}
${color3}News Headlines, NWS Current Weather and 7 Day Forecast:
${color}${execi 60 conky-rss.sh http://feeds.abcnews.com/abcnews/topstories 6 2}
${font Sans:size=10}${color3}${execi 120 getweatherc.sh KORD}
${font Sans:size=8}${color}${execi 600 getweather7d.sh il/ilz014.txt}
${font courier:bold:size=15}${color3}                     ${time %a} ${time %b} ${time %d} ${time %Y}
${color3}${font courier:bold:size=13}${execpi 600 DJS=`date +%_d`; cal -h | sed '1d' | sed '2s/^/\${color}/' | sed 's/^/                         /g' | sed s/"\(^\|[^0-9]\)$DJS"'\b'/'\1${color2}'"$DJS"'$color'/}

Code: Select all

#!/bin/bash
# getweather7d - gets weather forecast text file
# usage: getweather7d.sh il/ilz014.txt
#   files are stored by state, so need to pass combined state and filename 
#   delete first 11 lines and last 2 lines to get actual forecast text 
#
# Requires: curl, tr, fold, sed
#
if ["$1" ="" ]; then
    echo"ERROR, usage: getweather7d.sh il/ilz014.txt"
else
    curl_retryn=0
    curl -s http://tgftp.nws.noaa.gov/data/forecasts/zone/$1 > ~/.getweather7d.tmp.txt
    if [ $? -ne 0 ]; then
        while [ curl_retryn -le 3 ]
        do
            sleep 10
            curl_retryn=`expr $curl_retryn + 1`
            curl -s http://tgftp.nws.noaa.gov/data/forecasts/zone/$1 > ~/.getweather7d.tmp.txt
            if [ $? -ne 0 ]; then
                continue
            fi
            curl_retryn=0
            break
        done
    fi
    if [ $curl_retryn -ne 0 ]; then
        echo"ERROR, getweather7d.sh curl failed to get weather for $1"
    else
        # ~/.getweather7d.tmp.txt now contains text of 7 day forecast, remove 1st 2 lines and 1st 11 lines, 
        #      delete 1st char of 1st line 
        #####cat ~/.getweather7d.tmp.txt | sed '$ d' | sed '$ d' | sed '1,11 d' | sed -e '1s/^.//' > ~/.getweather7d.tmp2.txt
        cat ~/.getweather7d.tmp.txt | sed '1,11 d' > ~/.getweather7d.tmp2.txt
        # lines are wrapped at xx chars, so need to unwrap and then rewrap at yy chars
        # change all newline 0a characters into and all . to b
        tr '\n' 'a' < ~/.getweather7d.tmp2.txt > ~/.getweather7d.tmp3.txt
        tr '.' 'b' < ~/.getweather7d.tmp3.txt > ~/.getweather7d.tmp4.txt
        # ab combos are real newlines, and change all ... to -
        cat ~/.getweather7d.tmp4.txt | sed -e"s/ab/\n/g" | sed -e"s/bbb/-/g" > ~/.getweather7d.tmp5.txt
        # change b back to. and make a into spaces
        tr 'b' '.' < ~/.getweather7d.tmp5.txt > ~/.getweather7d.tmp6.txt
        tr 'a' ' ' < ~/.getweather7d.tmp6.txt > ~/.getweather7d.tmp7.txt
        cat ~/.getweather7d.tmp7.txt | sed -e"s/^/--/g" | sed -e"s/ PERCENT/%/g" | sed -e"s/TEMPERATURES/TEMPS/g" | sed -e"s/AROUND/ABOUT/g" \
        | sed -e"s/BELOW ZERO/BELOW/g" | sed -e"s/ABOVE ZERO/ABOVE/g" | sed -e"s/ ABOVE//g" | sed -e"s/ ZERO/ 0/g" | sed -e"s/TEMPS NEARLY/TEMPS/g" \
        | sed -e"s/REST OF TODAY/TODAY/g" | sed -e"s/REST OF TONIGHT/TONITE/g" | sed -e"s/IN THE AFTERNOON/AFTERNOON/g" | sed -e"s/IN THE EVENING/EVENING/g" \
        | sed -e"s/SUBURBS/BURBS/g" | sed -e"s/DOWNTOWN/CITY/g" | sed -e"s/THROUGH/THRU/g" | sed -e"s/MOSTLY SUNNY/SUNNY/g" | sed -e"s/RANGING FROM/FROM/g" \
        | sed -e"s/MPH WITH GUSTS UP/MPH, GUSTS/g" | sed -e"s/GUSTS UP TO/GUSTS TO/g" | sed -e"s/CHILLS/CHILL/g" | sed -e"s/MOSTLY CLOUDY/CLOUDY/g" \
        | sed -e"s/WINDS/WIND/g" | sed -e"s/LOWS/LO/g" | sed -e"s/HIGHS/HI/g" | sed -e"s/BITTERLY/BITTER/g" | sed -e"s/MOSTLY CLEAR/CLEAR/g" \
        | sed -e"s/NUMEROUS SNOW SHOWERS/SNOW/g" | sed -e"s/SNOW SHOWERS/SNOW/g" | sed -e"s/RAIN SHOWERS/RAIN/g" | sed -e"s/MORNING/AM/g" \
        | sed -e"s/ACCUMULATION/ACCUM/g" | sed -e"s/TONIGHT/TONITE/g" | sed -e"s/LOWER/LO/g" | sed -e"s/LOW/LO/g" | sed -e"s/BECOMING/TURNING/g" \
        | sed -e"s/ADVISORY IN EFFECT FROM/ADVISORY FROM/g" | sed -e"s/HIGH/HI/g" | sed -e"s/NORTHEAST/NE/g" | sed -e"s/NORTHWEST/NW/g" \
        | sed -e"s/PRECIPITATION/PRECIP/g" | sed -e"s/SOUTHEAST/SE/g" | sed -e"s/SOUTHWEST/SW/g" | sed -e"s/LIGHT/LITE/g" \
        | sed -e"s/THUNDERSTORMS/STORMS/g"  > ~/.getweather7d.tmp8.txt  
        # to limit number of forecast day/night sections, count each section as a line before wrapping, typically 15 max
        cat ~/.getweather7d.tmp8.txt | sed -e '15,$d' > ~/.getweather7d.tmp9.txt 
        # wrap text for 80 char wide display, limit to 26 lines of output
        fold -s -w 80 ~/.getweather7d.tmp9.txt | sed -e '26,$d' > ~/.getweather7d.tmp10.txt 
        # print lines to std output, conky will get result and display
        cat ~/.getweather7d.tmp10.txt
    fi
fi

Code: Select all

#!/bin/bash
# getweatherc.sh - - Gets and returns one line current conditions for weather station code passed as parm1
# usage: getweatherc.sh KORD
#
# Requires: wget, sed, xmllint
#
station="$1.xml"
wdir='/tmp/weather'

update_xml() {
    if [ ! -e"$station" ]; then
        wget -q http://w1.weather.gov/xml/current_obs/${station}
        [ -e"$station" ] && touch"${station}"
    else
        # dtime: time the .xml file was downloaded
        # otime: time the weather data was observed
        # ctime: current time (time this script is being run)
        dtime=$(stat -c %Y $station)
        otime=$(date -d"$utime" +%s)
        ctime=$(date +%s)

        if (("$otime" + 4507 <"$ctime" )); then
            if (("$dtime" + 307 <"$ctime" )); then
                wget -q -O"$station" http://w1.weather.gov/xml/current_obs/${station}
                [ -e"$station" ] && touch"${station}"
            fi
        fi
    fi
}

from_xml() { xmllint -xpath"//$1" - <<<"$xml" | sed 's/<[^>]*>//g'; }
    
[ -d"$wdir" ] || mkdir -p"$wdir"
cd"$wdir" || exit 1

xml=''
[ -r $station ] && xml="$(< $station)"
( update_xml >/dev/null 2>&1 ) &

if [ -n"$xml" ]; then
    location=$(from_xml"location")
    # if we just want the city the location is in
    #locationx=$(from_xml"location")
    #location="$(echo"$locationx" | cut -f1 -d",")"
    utime=$(from_xml"observation_time_rfc822")
    otime=$(date -d"$utime" '+%a %b %e %R')
    #date +"%Y/%m/%d %H:%M"
    #Invoking date with no format argument is equivalent to invoking `date '+%a %b %e %H:%M:%S %Z %Y''. 
    weather=$(from_xml"weather")
    temperature=$(from_xml"temp_f")
    humid=$(from_xml"relative_humidity")
    wind_dir=$(from_xml"wind_dir")
    case"$wind_dir" in
       "North") wind_dir="N" ;;
       "South") wind_dir="S" ;;
       "East") wind_dir="E" ;;
       "West") wind_dir="W" ;;
       "Northwest") wind_dir="NW" ;;
       "Northeast") wind_dir="NE" ;;
       "Southwest") wind_dir="SW" ;;
       "Southeast") wind_dir="SE" ;;
    esac
    wind_speed=$(from_xml"wind_kt")
    baro_pressure=$(from_xml"pressure_in")

###    echo"$location"
    printf '%s, %s %s F, wind %s %s kt in %s, NWS station %s\n'"$otime""$weather""$temperature""$wind_dir""$wind_speed""$location""$1"
###    echo"$location"
###    printf 'Weather: %s %s°F\n'"$weather""$temperature"
###    printf 'Barometric Pressure: %s inches\n'"$baro_pressure"
###    printf 'Wind: %s at %s knots\n'"$wind_dir""$wind_speed"
###    printf 'Humidity: %s%%\n'"$humid"
###    echo"Updated: $(date -d"$utime" 2>/dev/null )"
else
    echo"ERROR: No weather data available for $1..."
fi

Code: Select all

#!/bin/bash

# getosversion - saves os version to a file for conky to display

rm ~/.conkyosversion
touch ~/.conkyosversion

# bash for loop
for f in $( ls /etc/*version --sort=time ); do
    cat $f >> ~/.conkyosversion
    echo $f
done 

Code: Select all

#!/bin/bash

# lowbattery - alert for low battery with sound and popup screen from dave

play /usr/share/sounds/error.wav
play /usr/share/sounds/error.wav
play /usr/share/sounds/error.wav

MESSAGE="The System Battery is Extremely low! Shut Down Now?"
TITLE="BATTERY EXTREMELY LOW!"

FLAG_FILE="/tmp/batterylow"

if [ ! -f $FLAG_FILE ]; then
    touch $FLAG_FILE
    yad --image='error' --text="$MESSAGE" #--button='ok:0' --button='cancel:1'
    case $? in
            0)    rm $FLAG_FILE && desktop-session -s    ;;
            1)    rm $FLAG_FILE && exit                  ;;
            *)    echo"Not an option" && exit                ;;
    esac
fi
[code]

[code]
#!/bin/bash
#
# conky-rss.sh - RSS Display Script by Bill Woodford (admin@sdesign.us) v1.0
#
# This script is designed to output story titles for most any RSS Feed.
#
# This script depends on curl.  Please ensure it is installed and in your $PATH
# Gentoo: emerge -av net-misc/curl
# Debian: apt-get install curl
# Homepage: http://curl.haxx.se/
#
# Usage:
# .conkyrc:    ${execi [time] /path/to/script/conky-rss.sh URI LINES TITLENUM}
#    URI = Location of feed, ex. http://www.gentoo.org/rdf/en/glsa-index.rdf
#    LINES = How many titles to display (default 5)
#    TITLENUM = How many times the title of the feed itself is specified, usually 1 or 2 (default 2)
#
# Usage Example        
#        ${execi 300 /home/youruser/scripts/conky-rss.sh http://www.foxnews.com/xmlfeed/rss/0,4313,1,00.rss 4 2}

#RSS Setup - Don't change unless you want these values hard-coded!
uri=$1                            #URI of RSS Feed
lines=$2                        #Number of headlines
titlenum=$3                        #Number of extra titles

#Script start
#Require a uri, as a minimum
if [["$uri" =="" ]]; then
    echo"No URI specified, cannot continue!" >&2
    echo"Please read script for more information" >&2
else
    #Set defaults if none specified
    if [[ $lines =="" ]]; then lines=5 ; fi
    if [[ $titlenum =="" ]]; then titlenum=2 ; fi

    #The actual work
    curl -s --connect-timeout 30 $uri |\
    sed -e 's/<\/title>/\n/g' |\
    grep -o '<title>.*' |\
    sed -e 's/<title>//' |\
    sed -e 's/<!\[CDATA\[//g' |\
    sed -e 's/\]\]>//g' |\
    head -n $(($lines + $titlenum)) |\
    tail -n $(($lines))
fi
Posts: 150
rjm65
Joined: 20 Jan 2014
#13
this all seems like too much work, it is a shame there isn't an easy way to do this like linux mint has, where you choose a desklet put in your zip code and it is done.... I guess I am just going to use the one for the task bar and call it a day.... Thank you everyone for your suggestions, I appreciate it.... __{{emoticon}}__
Posts: 452
Jerry
Joined: 12 Sep 2007
#14
This is a good question--sorry I did not see it sooner. There is gis-weather in the MX repo you could take a look at.


Image
Posts: 452
Jerry
Joined: 12 Sep 2007
#15
It's highly configurable (via right-click), and here is how I actually run it on my main desktop:


Image