diff options
| author | Robert Günzler <r@gnzler.io> | 2026-02-10 12:32:48 +0100 |
|---|---|---|
| committer | Robert Günzler <r@gnzler.io> | 2026-02-10 12:41:25 +0100 |
| commit | 63feeb9f369fc6176e85c1c2d8fcc863caad1946 (patch) | |
| tree | 41cd5d2d1ec36e74e464caab722cc9b460153f04 /.config/waybar/modules/weather.sh | |
| parent | 5bd0a4aca65ecb9818ef1285982d160b6b6ff665 (diff) | |
start new
Signed-off-by: Robert Günzler <r@gnzler.io>
Diffstat (limited to '.config/waybar/modules/weather.sh')
| -rwxr-xr-x | .config/waybar/modules/weather.sh | 42 |
1 files changed, 0 insertions, 42 deletions
diff --git a/.config/waybar/modules/weather.sh b/.config/waybar/modules/weather.sh deleted file mode 100755 index 929732b..0000000 --- a/.config/waybar/modules/weather.sh +++ /dev/null @@ -1,42 +0,0 @@ -#!/bin/sh -set -e -[ -n "$DEBUG" ] && set -x - -loc=$1 -if [ -z "${loc}" ]; then - # use /etc/localtime - # loc=$(basename "$(readlink -f /etc/localtime)") - loc="${HOME_LAT},${HOME_LON}" -fi - -if [ -n "$REPORT" ]; then - curl -s v2.wttr.in/"${loc}"?F | less - exit 0 -fi - -data="$(curl -s wttr.in/"${loc}"?format=j1)" - -class= -case "$(echo "${data}" | jq -r '.current_condition[].weatherCode')" in -113) class="sunny" ;; -116) class="partlycloudy" ;; -119) class="cloudy" ;; -122) class="verycloudy" ;; -143|248|260) class="fog" ;; -176|263|266|293|296|353) class="lightrain" ;; -179|182|185|281|284|311|314|317|350|362|365|374|377) class="hail" ;; -200|386|389|392) class="thunder" ;; -227|320) class="lightsnow" ;; -230|329|332|335|338|371|395) class="heavysnow" ;; -299|302|305|308|356|359): class="heavyrain" ;; -323|326|368) class="snowrain" ;; -esac - -echo "${data}" | jq \ - --raw-output \ - --unbuffered \ - --compact-output \ - --arg class "${class}" \ - --arg tooltip "$(curl -s v2.wttr.in/"${loc}"?ATFQ | tail -n5)" \ - '.current_condition[] | { text: .weatherDesc[0].value, percentage: (.temp_C | tonumber), class: $class, alt: $class, tooltip: ($tooltip) }' - |