*nohtml*

local/bin/weather

   1 #!/bin/bash
   2 
   3 f=~/.cache/weather
   4 
   5 [[ $1 == -n && -f $f ]] && cat $f && exit
   6 read icon weather desc < <(curl -s 'https://wttr.in/spb?lang=ru&format=%c%20%t%20%C')
   7 
   8 [[ $weather ]] || exit
   9 echo "$weather ${desc,,}" | tee $f
  10 printf '<svg><text y="38" style="font-size: 38px">%s</text></svg>' $icon > $f.svg