#!/bin/bash # dbanner-title-uk: Погода (wttr.in) # dbanner-title-en: Weather (wttr.in) # dbanner-mode: cached # dbanner-interval: 1800 # Weather from wttr.in for the "city" variable of the banner (DBANNER_CITY). . "${0%/*}/lib.sh" command -v curl >/dev/null || exit 0 city=${DBANNER_CITY:-} lang=${DBANNER_LANG:-en} line=$(curl -fsS -m 15 -H "Accept-Language: $lang" "https://wttr.in/${city// /+}?format=%l:+%c+%t+(%f),+%w,+%h&lang=$lang" 2>/dev/null) || exit 0 [[ $line == *"Unknown location"* || -z $line ]] && exit 0 echo "$Bold$(say "Погода:" "Weather:")$Off $Cyan$line$Off"