diff --git a/scripts/xmobar-status-weather b/scripts/xmobar-status-weather new file mode 100755 index 0000000..fbb8550 --- /dev/null +++ b/scripts/xmobar-status-weather @@ -0,0 +1,19 @@ +#!/bin/sh + +# simple script to read weather from airport code and return it for display in xmobar + +weather=$(weather-report $1 -m --no-cache -n | \ + grep -e '\[' \ + -e 'Temp' | \ + sed -e 's/\[using result //' \ + -e 's/,.*\]//' \ + -e 's/Temp.*: //' \ + -e 's/ C//' \ + -e 's/ //') + +readarray -t y <<< "$weather" + +loc=${y[0]} +temp=${y[1]} + +echo -e "$loc $temp\u00b0C"