1
0
mirror of https://github.com/eoli3n/dotfiles synced 2024-11-22 23:12:32 +01:00
eoli3n-dotfiles/i3/weather.sh
2016-03-16 12:23:43 +01:00

17 lines
626 B
Bash
Executable File

#!/bin/bash
loc="34090"
mph=$(cliweather $loc| grep 'Wind:' | cut -d' ' -f2)
kmh=$(echo "$(($mph*(8/5)))" | cut -d'.' -f1)
#today_cond="$(cliweather $loc | grep 'Condition:' | sed 's-Condition: --')"
today_temp="$(cliweather $loc | grep 'Temperature:' | sed 's-Temperature: .*/\(.*C\)- \1°-')"
today_humi="$(cliweather $loc | grep 'Humidity:' | sed 's-Humidity: --')"
today_wind="$(cliweather $loc | grep 'Wind:' | sed "s-Wind: .* mph\( .*\)-"$kmh"km/h-")"
#today
echo $today_temp $today_humi $today_wind
#next days
#cliweather -f 34090 | head -n 9 | sed 's-Day: --' | sed 's- .*/\(.*C\)- \1°-' | sed 's-Condition: --'