From 315ec4abb53e0149daebcefb9730bc24dcbcb3f7 Mon Sep 17 00:00:00 2001 From: Jonatas Medeiros Date: Mon, 6 Apr 2020 20:49:52 -0300 Subject: [PATCH] wttr options --- .local/bin/statusbar/weather | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.local/bin/statusbar/weather b/.local/bin/statusbar/weather index 0a501e3c..c5d4d608 100755 --- a/.local/bin/statusbar/weather +++ b/.local/bin/statusbar/weather @@ -7,14 +7,14 @@ # 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. getforecast() { ping -q -c 1 1.1.1.1 >/dev/null && -curl -sf "wttr.in/$LOCATION" > "$HOME/.local/share/weatherreport" || exit 1 ;} +curl -sf "wttr.in/${LOCATION}?1FQT" > "$HOME/.local/share/weatherreport" || exit 1 ;} # Some very particular and terse stream manipulation. We get the maximum # precipication chance and the daily high and low from the downloaded file and # display them with coresponding emojis. -showweather() { printf "%s" "$(sed '16q;d' "$HOME/.local/share/weatherreport" | +showweather() { printf "%s" "$(sed '14q;d' "$HOME/.local/share/weatherreport" | grep -wo "[0-9]*%" | sort -rn | sed "s/^/☔ /g;1q" | tr -d '\n')" -sed '13q;d' "$HOME/.local/share/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 '11q;d' "$HOME/.local/share/weatherreport" | grep -o "\\([-+]\\)*[0-9]\\+" | sort -n | sed -e 1b -e '$!d' | tr '\n' ' ' | awk '{print " ❄️",$1 "°","🌞",$2 "°"}' ;} # The BLOCK_BUTTON bloat for clicking in i3. case $BLOCK_BUTTON in