This repository has been archived on 2025-12-28. You can view files and clone it, but cannot push or open issues or pull requests.
inks-scripts/scripts/xmobar-status-weather

20 lines
443 B
Bash
Executable File

#!/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>"