mirror of
https://github.com/nmasur/dotfiles
synced 2024-12-25 19:24:53 +00:00
13 lines
262 B
Plaintext
13 lines
262 B
Plaintext
|
#!/bin/sh
|
||
|
|
||
|
CACHE_FILE="$HOME/.tmux/.weather_cache"
|
||
|
CACHE_TIME=$(stat -f %m $CACHE_FILE)
|
||
|
NOW_TIME=$(date +%s)
|
||
|
TIME_PASSED=$((NOW_TIME-CACHE_TIME))
|
||
|
if [[ "$TIME_PASSED" -gt "1200" ]]
|
||
|
then
|
||
|
curl -m 2 -s wttr.in/\?format\="%c%t" > $CACHE_FILE
|
||
|
fi
|
||
|
cat $CACHE_FILE
|
||
|
|