SEARCH

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

You are not logged in.

#1701 2015-01-31 09:57:13

TeoBigusGeekus
#! Die Hard
From: /Greece/Kastoria
Registered: 2012-04-28
Posts: 963

Re: Conky weather+moon scripts (Accuw/WUndergr/NWS/MoonGiant)

lol  I've no idea what you're talking about  tongue


Please make Autocad Civil 3D and Archicad work on Linux!
Please make Autocad Civil 3D and Archicad work on Linux!
Please make Autocad Civil 3D and Archicad work on Linux!
Please make Autocad Civil 3D and Archicad work on Linux!

Offline

Help fund CrunchBang, donate to the project!

#1702 2015-02-01 01:03:17

Mpok
Member
Registered: 2014-12-06
Posts: 28
Website

Re: Conky weather+moon scripts (Accuw/WUndergr/NWS/MoonGiant)

Last edited by Mpok (2015-02-01 01:54:21)

Offline

#1703 2015-02-01 10:06:00

TeoBigusGeekus
#! Die Hard
From: /Greece/Kastoria
Registered: 2012-04-28
Posts: 963

Re: Conky weather+moon scripts (Accuw/WUndergr/NWS/MoonGiant)

I was talking about my scripts: they ARE light.
My conkyrcs? Perhaps not so.
It had previously occured to me that I could create (within the script) a text file with all conky info gathered together (in conky format) and then call the text file from within conky with only one exec command.
But I don't like this approach as it takes away the user's freedom to create a final conky screen of their liking: my contribution is one or more text files with weather info in them. The users can do whatever they want with them.

I don't want to argue no more, I just wish you good luck and I hope to see your light Lua scripts as soon as possible.


Please make Autocad Civil 3D and Archicad work on Linux!
Please make Autocad Civil 3D and Archicad work on Linux!
Please make Autocad Civil 3D and Archicad work on Linux!
Please make Autocad Civil 3D and Archicad work on Linux!

Offline

#1704 2015-02-20 08:10:21

Mpok
Member
Registered: 2014-12-06
Posts: 28
Website

Re: Conky weather+moon scripts (Accuw/WUndergr/NWS/MoonGiant)

Offline

#1705 2015-02-20 10:43:33

TeoBigusGeekus
#! Die Hard
From: /Greece/Kastoria
Registered: 2012-04-28
Posts: 963

Re: Conky weather+moon scripts (Accuw/WUndergr/NWS/MoonGiant)

Chill out man!
No reason for arguing whatsoever... lol

Do whatever you want, but with my present hectic schedule I don't think I can follow your admitedly totally different way of doing things. So it would be unfair to you to restrict yourself in this thread; creating a new one will make sure that more people will be able to notice your work  wink


Please make Autocad Civil 3D and Archicad work on Linux!
Please make Autocad Civil 3D and Archicad work on Linux!
Please make Autocad Civil 3D and Archicad work on Linux!
Please make Autocad Civil 3D and Archicad work on Linux!

Offline

#1706 2015-02-20 12:46:46

Sector11
#!'er to BL'er
From: SR11 Cockpit
Registered: 2010-05-05
Posts: 15,667
Website

Re: Conky weather+moon scripts (Accuw/WUndergr/NWS/MoonGiant)

Offline

#1707 2015-02-20 15:54:54

TeoBigusGeekus
#! Die Hard
From: /Greece/Kastoria
Registered: 2012-04-28
Posts: 963

Re: Conky weather+moon scripts (Accuw/WUndergr/NWS/MoonGiant)


Please make Autocad Civil 3D and Archicad work on Linux!
Please make Autocad Civil 3D and Archicad work on Linux!
Please make Autocad Civil 3D and Archicad work on Linux!
Please make Autocad Civil 3D and Archicad work on Linux!

Offline

#1708 2015-02-20 18:10:55

Sector11
#!'er to BL'er
From: SR11 Cockpit
Registered: 2010-05-05
Posts: 15,667
Website

Re: Conky weather+moon scripts (Accuw/WUndergr/NWS/MoonGiant)

 20 Feb 15 | 15:05:48 ~
    $ conkyLatLong
-34.612999 / -58.470001
 
 20 Feb 15 | 15:06:00 ~
    $ conkyLatLong -i
34°36"46.7964'S / 58°28"12.0036'W
 
 20 Feb 15 | 15:06:07 ~
    $ conkyDaysDiff 20000101
5529
 
 20 Feb 15 | 15:06:51 ~
    $ conkyDatetimeDiff -s 20000101
15 yrs 1 mth  19 days
 
 20 Feb 15 | 15:07:11 ~
    $ 

Last edited by Sector11 (2015-02-20 18:17:22)

Offline

#1709 2015-02-20 21:19:14

TeoBigusGeekus
#! Die Hard
From: /Greece/Kastoria
Registered: 2012-04-28
Posts: 963

Re: Conky weather+moon scripts (Accuw/WUndergr/NWS/MoonGiant)


Please make Autocad Civil 3D and Archicad work on Linux!
Please make Autocad Civil 3D and Archicad work on Linux!
Please make Autocad Civil 3D and Archicad work on Linux!
Please make Autocad Civil 3D and Archicad work on Linux!

Offline

#1710 2015-02-20 21:38:21

Sector11
#!'er to BL'er
From: SR11 Cockpit
Registered: 2010-05-05
Posts: 15,667
Website

Re: Conky weather+moon scripts (Accuw/WUndergr/NWS/MoonGiant)

Is or was?  Hmmmmmmmm must email him again  big_smile

Thank you ... I'm retired - lots of free time helps.  I think that's the only time I've ever posted all my desktops in one place.  big_smile
I know for the most part they go against the KISS principle you like ... but I like to play   wink

Offline

#1711 2015-02-20 22:48:05

TeoBigusGeekus
#! Die Hard
From: /Greece/Kastoria
Registered: 2012-04-28
Posts: 963

Re: Conky weather+moon scripts (Accuw/WUndergr/NWS/MoonGiant)


Please make Autocad Civil 3D and Archicad work on Linux!
Please make Autocad Civil 3D and Archicad work on Linux!
Please make Autocad Civil 3D and Archicad work on Linux!
Please make Autocad Civil 3D and Archicad work on Linux!

Offline

#1712 2015-02-21 18:59:01

bobc
Member
From: Chicago
Registered: 2014-12-11
Posts: 17

Re: Conky weather+moon scripts (Accuw/WUndergr/NWS/MoonGiant)

Last edited by bobc (2015-02-21 19:02:53)


This is a neat site and seems to have lots of useful questions and answers.  I'm just learning linux and like to learning by doing.  Sometimes I really don't know, LOL.

Offline

#1713 2015-02-22 10:28:41

TeoBigusGeekus
#! Die Hard
From: /Greece/Kastoria
Registered: 2012-04-28
Posts: 963

Re: Conky weather+moon scripts (Accuw/WUndergr/NWS/MoonGiant)

Simple and informative. Nice  cool


Please make Autocad Civil 3D and Archicad work on Linux!
Please make Autocad Civil 3D and Archicad work on Linux!
Please make Autocad Civil 3D and Archicad work on Linux!
Please make Autocad Civil 3D and Archicad work on Linux!

Offline

#1714 2015-02-22 11:27:09

bobc
Member
From: Chicago
Registered: 2014-12-11
Posts: 17

Re: Conky weather+moon scripts (Accuw/WUndergr/NWS/MoonGiant)

The hard parts were doing the color coded bars for cpu usage, ram, swap, and space avail, and the routine that pares down the NWS 7 day text forecast down, first expanding it to long lines, then phrase by phrase, abbreviating to get it shorter so that when it gets word wrapped it takes many fewer lines, so there is space for the color coded calendar. 

Somehow I need to make it beep do something to get my attention before battery power gives out, though, perhaps with sound or popup windows.  I also need to build in my low swap space warning system, but on this machine with everything running from a 32 gb SSD its not really needed.

I also need to learn how to do temp files properly.  My current 7 day forecast script uses 8 or 9 temp files to massage the data leaving a trail of debugging breadcrumbs, but to be honest, I don't know enough about linux architecture to know where they should be put or named.  Every program seems to do things differently it seems.

Both the conky and scripts are very efficient for older cpu's because the conky interval is wide and the weather ones wider, and I'm downloading the text file which is quite small.  I think it would be too tight to try to get the current and 7 day, both day and in pics onto the screen at one time, so I haven't attempted it.  I suppose if I was to lose my calendar it would be possible at that point, especially with my trimmed down text, which I could abbreviate more if I used picture icons...

Here is the conky itself:

# 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 845
maximum_width 545

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

# 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=10}${color2}Host: 
${font Sans:size=16}${color #FF078B}${nodename}  ${font Sans:size=10}${alignr 39}${color2}Date: ${color}${time %c}
${color2}CpuAvg: ${color}${freq_g}Ghz ${machine} - ${color}${cpu}%            ${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}Bat:   ${color}${battery BAT0}\
${if_match "$battery_short"<"D"}\
	${if_match ${battery_percent BAT0} <= 40}\
${color red} ${battery_bar 9 BAT0}${color2}\
	${else}\
		${if_match ${battery_percent BAT0} <= 80}\
${color orange} ${battery_bar 9 BAT0}${color2}\
		${else}\
${color green} ${battery_bar 9 BAT0}\
		${endif}\
	${endif}\
${else}\
	${if_match ${battery_percent BAT0} <= 40}\
${blink ${color red} ${battery_bar 9 BAT0} }${color2}\
	${else}\
		${if_match ${battery_percent BAT0} <= 80}\
${color orange} ${battery_bar 9 BAT0}${color2}\
		${else}\
${color green} ${battery_bar 9 BAT0}\
		${endif}\
	${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} <= 25}\
${color green}${swapbar 9}\
${else}\
	${if_match ${swapperc} <= 60}\
${color orange}${swapbar 9}\
	${else}\
${color red}${swapbar 9}\
	${endif}\
${endif}
${color2}Root:${color} ${fs_free /}Free ${color}= ${fs_free_perc /}%       \
${if_match ${fs_free_perc} <= 25}\
${color red}${fs_bar 9}\
${else}\
	${if_match ${fs_free_perc} <= 50}\
${color orange}${fs_bar 9}\
	${else}\
${color green}${fs_bar 9}\
	${endif}\
${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}
${color2}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}
${color2}News Headlines:
${color}${execi 60 conky-rss.sh http://feeds.abcnews.com/abcnews/topstories 9 2}
${font Sans:size=10}${color2}NWS Current Weather and Forecast:
${font Sans:size=10}${color3}${execi 300 getweatherc.sh KORD}
${font Sans:size=8}${color}${execi 1200 getweather7d.sh il/ilz014.txt}
${font Ubuntu Mono:bold:size=15}${color2}                         ${time %B} ${time %Y}
${color3}${font Ubuntu Mono:bold:size=15}${execpi 600 DJS=`date +%_d`; cal | sed '1d' | sed '2s/^/\${color}/' | sed 's/^/                         /g' | sed s/"\(^\|[^0-9]\)$DJS"'\b'/'\1${color2}'"$DJS"'$color'/}

The conky-rss.sh script to get the rss news feed

#!/bin/bash
# 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

The script to get current weather conditions

#!/bin/bash

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

And the script to get and massage the NWS 7 day text forecast

#!/bin/bash
# getweather7d.sh - gets weather forecast text file
#
# bobc Feb 10, 2015 written
#   TODO - use legit temp files
#
# 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 
if [ "$1" = "" ]; then
    echo "ERROR, usage: getweather7d.sh il/ilz014.txt"
else
	curl_retryn=0
    curl -s http://weather.noaa.gov/pub/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://weather.noaa.gov/pub/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
		# 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/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/SUBURBS/BURBS/g" | sed -e "s/DOWNTOWN/CITY/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/WINDS/WIND/g" | sed -e "s/LOWS/LOW/g" | sed -e "s/HIGHS/HIGH/g" | sed -e "s/BITTERLY/BITTER/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/ACCUMULATION/ACCUM/g" \
		| sed -e "s/ADVISORY IN EFFECT FROM/ADVISORY FROM/g" \
		| sed -e "s/PRECIPITATION/PRECIP/g" > ~/.getweather7d.tmp8.txt  
# fmt -t -c -w 80 test6.txt > test7.txt
		fold -s -w 80 ~/.getweather7d.tmp8.txt | sed -e '26,$d' > ~/.getweather7d.tmp9.txt 
		# print lines to std output, conky will get result and display
		cat ~/.getweather7d.tmp9.txt
	fi
fi

Last edited by bobc (2015-02-22 11:41:29)


This is a neat site and seems to have lots of useful questions and answers.  I'm just learning linux and like to learning by doing.  Sometimes I really don't know, LOL.

Offline

#1715 2015-02-22 15:46:21

Sector11
#!'er to BL'er
From: SR11 Cockpit
Registered: 2010-05-05
Posts: 15,667
Website

Re: Conky weather+moon scripts (Accuw/WUndergr/NWS/MoonGiant)

${battery_percent BAT0}

Offline

#1716 2015-02-22 16:45:16

TeoBigusGeekus
#! Die Hard
From: /Greece/Kastoria
Registered: 2012-04-28
Posts: 963

Re: Conky weather+moon scripts (Accuw/WUndergr/NWS/MoonGiant)

Anytime mate!


Please make Autocad Civil 3D and Archicad work on Linux!
Please make Autocad Civil 3D and Archicad work on Linux!
Please make Autocad Civil 3D and Archicad work on Linux!
Please make Autocad Civil 3D and Archicad work on Linux!

Offline

#1717 2015-02-24 14:57:04

Mpok
Member
Registered: 2014-12-06
Posts: 28
Website

Re: Conky weather+moon scripts (Accuw/WUndergr/NWS/MoonGiant)

#!/bin/bash

#put your Accuweather address here
address="http://www.accuweather.com/[WHATEVER_WE_HAVE]/weather-forecast/[ID]"

loc_id=$(echo $address|sed 's/\/weather-forecast.*$//'|sed 's/^.*\///')
last_number=$(echo $address|sed 's/^.*\///')

curr_addr="$(echo $address|sed 's/weather-forecast.*$//')"current-weather/"$last_number"

addr1="$(echo $address|sed 's/weather-forecast.*$//')"daily-weather-forecast/"$last_number"
addr2="$addr1"?day=6

Offline

#1718 2015-02-24 22:37:52

bobc
Member
From: Chicago
Registered: 2014-12-11
Posts: 17

Re: Conky weather+moon scripts (Accuw/WUndergr/NWS/MoonGiant)

Sorry for not realizing this was a thread about Teo's scripts, and until I read the first page I thought it was a thread about any conky related scripts for weather or moon phases.

It looks like most of the sites are trying to avoid giving out an weather info unless you are getting it via their pages with adds etc., so I'm trying to use the NWS, especially since I'm in the US anyway, and the others seem to be trying to make it difficult or at least are definitely not trying to make it easy at all, and I would expect they won't care at all about the repercussions changing their pages would have on people like us.

So given that I see you download the NWS Forecast XML file, and way down at the bottom, I see current conditions embedded in a huge line.  Do you have a script to parse current conditions out of the xml file?  I see you parse out the forecast, but not the location or current conditions.

Its interesting how you stop and then start the conky during the time you are getting and calculating the weather info.

I would be interested to see better ways to do things, but I was trying to find ways that are readable, easily comprehend-able, and therefore easily tweaked.


This is a neat site and seems to have lots of useful questions and answers.  I'm just learning linux and like to learning by doing.  Sometimes I really don't know, LOL.

Offline

#1719 2015-02-24 23:02:50

Sector11
#!'er to BL'er
From: SR11 Cockpit
Registered: 2010-05-05
Posts: 15,667
Website

Re: Conky weather+moon scripts (Accuw/WUndergr/NWS/MoonGiant)

Offline

#1720 2015-02-24 23:24:20

Sector11
#!'er to BL'er
From: SR11 Cockpit
Registered: 2010-05-05
Posts: 15,667
Website

Re: Conky weather+moon scripts (Accuw/WUndergr/NWS/MoonGiant)

Offline

#1721 2015-02-25 11:50:07

TeoBigusGeekus
#! Die Hard
From: /Greece/Kastoria
Registered: 2012-04-28
Posts: 963

Re: Conky weather+moon scripts (Accuw/WUndergr/NWS/MoonGiant)


Please make Autocad Civil 3D and Archicad work on Linux!
Please make Autocad Civil 3D and Archicad work on Linux!
Please make Autocad Civil 3D and Archicad work on Linux!
Please make Autocad Civil 3D and Archicad work on Linux!

Offline

#1722 2015-02-25 14:40:45

bobc
Member
From: Chicago
Registered: 2014-12-11
Posts: 17

Re: Conky weather+moon scripts (Accuw/WUndergr/NWS/MoonGiant)

Teo,

If you don't already have a script with it done, its ok.  I just am not good working with sed, awk or grep due to the snytax being so difficult, so whenever possible I try to find existing scripts that I can modify because I'd have zero chance of ever coming up with the syntax myself.


This is a neat site and seems to have lots of useful questions and answers.  I'm just learning linux and like to learning by doing.  Sometimes I really don't know, LOL.

Offline

#1723 2015-02-25 19:37:16

TeoBigusGeekus
#! Die Hard
From: /Greece/Kastoria
Registered: 2012-04-28
Posts: 963

Re: Conky weather+moon scripts (Accuw/WUndergr/NWS/MoonGiant)


Please make Autocad Civil 3D and Archicad work on Linux!
Please make Autocad Civil 3D and Archicad work on Linux!
Please make Autocad Civil 3D and Archicad work on Linux!
Please make Autocad Civil 3D and Archicad work on Linux!

Offline

#1724 2015-02-27 02:06:19

bobc
Member
From: Chicago
Registered: 2014-12-11
Posts: 17

Re: Conky weather+moon scripts (Accuw/WUndergr/NWS/MoonGiant)

I looked at the regular expressions link.  Thanks for posting it.  I wasn't aware of most of those options.  Its no wonder it takes a ton of effort to make any sense of what their purpose is.  I'm sure if I had been using them all along it would eventually become second nature, but the ones I worked with before were simpleton by comparison.

Its a shame the NWS didn't implement the same features across the board.  Thanks for letting me know before I spent a lot of time on it.


This is a neat site and seems to have lots of useful questions and answers.  I'm just learning linux and like to learning by doing.  Sometimes I really don't know, LOL.

Offline

Help fund CrunchBang, donate to the project!

#1725 2015-03-04 21:35:04

Mpok
Member
Registered: 2014-12-06
Posts: 28
Website

Re: Conky weather+moon scripts (Accuw/WUndergr/NWS/MoonGiant)

Offline

Board footer

Powered by FluxBB

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

Debian Logo