added weather script
This commit is contained in:
parent
dbcd59ed66
commit
ff318eb66f
19
scripts/xmobar-status-weather
Executable file
19
scripts/xmobar-status-weather
Executable file
@ -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 "<fc=#ff79c6>$loc <fc=#FFFFFF>$temp</fc><fn=1>\u00b0</fn>C</fc>"
|
||||||
Reference in New Issue
Block a user