aboutsummaryrefslogtreecommitdiff
path: root/dotfiles/.local/bin/barweather
blob: 0ae6d3cb104b3a72341c953d92e3f4cb106dee62 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#!/bin/bash

location="Saint Petersburg"

if [[ "$location" != "" ]]
then
    location="~${location// /+}"
fi

forecast=$(curl -s wttr.in/$location?format=1)

if [[ ${#forecast} -gt 30 ]]
then
    exit
fi

echo $forecast