1
0
Fork 0

add git config, stop sb-forecast from running haywire before captive portals

This commit is contained in:
Luca Bilke 2023-05-31 09:28:52 +02:00
parent f9b88a7962
commit cf93ac0a7e
2 changed files with 14 additions and 2 deletions

12
.config/git/config Normal file
View File

@ -0,0 +1,12 @@
[init]
defaultBranch = main
[push]
recurseSubmodules = check
[pull]
rebase = false
[submodule]
recurse = true
[credential]
helper = store
[include]
path = ~/.config/git/host-setup

View File

@ -16,8 +16,8 @@ weatheropts="?FA"
emojiopts="?FA&format=%c"
getforecast() {
curl -sf --retry 5 "$url$weatheropts" >"$weatherfile" || exit 1
curl -sf "$url$emojiopts" --retry 5 | sed 's/☀️//;s/☁️//;s/⛅️//;s/⛈//;s/✨//;s/❄️//;s/🌦//;s/🌧//;s/🌨//;s/🌩//;s/🌫//;' | cut -d ' ' -f 1 >"$emojifile" || exit 1
curl -sfL --retry 5 "$url$weatheropts" >"$weatherfile" || return 1
curl -sfL "$url$emojiopts" --retry 5 | sed 's/☀️//;s/☁️//;s/⛅️//;s/⛈//;s/✨//;s/❄️//;s/🌦//;s/🌧//;s/🌨//;s/🌩//;s/🌫//;' | cut -d ' ' -f 1 >"$emojifile" || return 1
}
fresh() {
[ -s "$weatherfile" ] && [ "$(stat -c %y "$weatherfile" 2>/dev/null | cut -d' ' -f1)" = "$(date '+%Y-%m-%d')" ]