diff options
| author | narukeh <hekurangashi@protonmail.com> | 2021-03-05 15:43:44 +0100 |
|---|---|---|
| committer | narukeh <hekurangashi@protonmail.com> | 2021-03-05 15:43:44 +0100 |
| commit | bc553f06be4635ad24ee3cc499523050a4ed389d (patch) | |
| tree | 5792fcc54b21857f7ab5964c5e8f1b62176dd5b8 | |
| parent | 73b174cedf7ed2046b40b74c82400004898d48b4 (diff) | |
| download | eibhear-bc553f06be4635ad24ee3cc499523050a4ed389d.tar.gz eibhear-bc553f06be4635ad24ee3cc499523050a4ed389d.tar.zst eibhear-bc553f06be4635ad24ee3cc499523050a4ed389d.zip | |
fix sb-forecast
| -rwxr-xr-x | .local/bin/statusbar/sb-forecast | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/.local/bin/statusbar/sb-forecast b/.local/bin/statusbar/sb-forecast index 6652edd..1c9c0ff 100755 --- a/.local/bin/statusbar/sb-forecast +++ b/.local/bin/statusbar/sb-forecast @@ -6,6 +6,7 @@ # If we have internet, get a weather report from wttr.in and store it locally. # You could set up a shell alias to view the full file in a pager in the # terminal if desired. This function will only be run once a day when needed. +LOCATION='' weatherreport="${XDG_DATA_HOME:-$HOME/.local/share}/weatherreport" getforecast() { curl -sf "wttr.in/$LOCATION" > "$weatherreport" || exit 1 ;} @@ -14,7 +15,7 @@ getforecast() { curl -sf "wttr.in/$LOCATION" > "$weatherreport" || exit 1 ;} # display them with coresponding emojis. showweather() { printf "%s" "$(sed '16q;d' "$weatherreport" | grep -wo "[0-9]*%" | sort -rn | sed "s/^/☔/g;1q" | tr -d '\n')" -sed '13q;d' "$weatherreport" | grep -o "m\\([-+]\\)*[0-9]\\+" | sort -n -t 'm' -k 2n | sed -e 1b -e '$!d' | tr '\n|m' ' ' | awk '{print " 🥶" $1 "°","🌞" $2 "°"}' ;} +sed '13q;d' "$weatherreport" | grep -o "m\\([-+]\\)*[0-9]\\+" | sed 's/+//g' | sort -n -t 'm' -k 2n | sed -e 1b -e '$!d' | tr '\n|m' ' ' | awk '{print " 🥶" $1 "°","🌞" $2 "°"}' ;} case $BLOCK_BUTTON in 1) setsid -f "$TERMINAL" -e less -Srf "$weatherreport" ;; |
