Compare commits

..

1 Commits

Author SHA1 Message Date
appeasementPolitik
a6be7daab2
Merge 36d40adb8df2809767d8c0447b9f4d3d62200d1d into ed9633da3f876b6c9dae13434fb7ea30208a5b5f 2023-08-16 19:59:02 +00:00
4 changed files with 6 additions and 9 deletions

View File

@ -16,8 +16,5 @@ IFS='
# Update each found profile.
for profile in $profiles; do
userjs=${profile%%/user.js*}
user=$(stat -c '%U' "$userjs") || continue
su -l "$user" -c "arkenfox-updater -c -p $userjs -s"
arkenfox-updater -p "${profile%%/user.js*}" -s
done

View File

@ -7,11 +7,11 @@ url="${WTTRURL:-wttr.in}"
weatherreport="${XDG_CACHE_HOME:-$HOME/.cache}/weatherreport"
# Get a weather report from 'wttr.in' and save it locally.
getforecast() { curl -sf "$url/$LOCATION" --output "$weatherreport" && touch "$weatherreport"; }
getforecast() { curl -sf "$url/$LOCATION" --output "$weatherreport"; }
# Forecast should be updated only once a day.
checkforecast() {
[ "$(stat -c %y "$weatherreport" 2>/dev/null |
[ -s "$weatherreport" ] && [ "$(stat -c %y "$weatherreport" 2>/dev/null |
cut -d' ' -f1)" = "$(date '+%Y-%m-%d')" ]
}

View File

@ -4,10 +4,10 @@
moonfile="${XDG_DATA_HOME:-$HOME/.local/share}/moonphase"
[ "$(stat -c %y "$moonfile" 2>/dev/null | cut -d' ' -f1)" = "$(date '+%Y-%m-%d')" ] ||
[ -s "$moonfile" ] && [ "$(stat -c %y "$moonfile" 2>/dev/null | cut -d' ' -f1)" = "$(date '+%Y-%m-%d')" ] ||
{ [ -z "$(pgrep 'sb-moonphase' | tail -n +3)" ] &&
( until { [ "$(cat /sys/class/net/w*/operstate)" = 'up' ] || [ "$(cat /sys/class/net/e*/operstate)" = 'up' ]; } &&
curl -sf "wttr.in/?format=%m" --output "$moonfile" && touch "$moonfile"; do sleep 60; done &&
curl -sf "wttr.in/?format=%m" --output "$moonfile"; do sleep 60; done &&
pkill -RTMIN+"${1:-17}" "${STATUSBAR:-dwmblocks}" ) &
echo; exit; }

View File

@ -28,7 +28,7 @@ filestat="$(stat -c %x "$pricefile" 2>/dev/null)"
[ -d "$dir" ] || mkdir -p "$dir"
updateprice() { curl -sf --fail-early $denom.$url/{1$target,$target$interval} --output "$pricefile" --output "$chartfile" && touch "$pricefile" "$chartfile"; }
updateprice() { curl -sf --fail-early $denom.$url/{1$target,$target$interval} --output "$pricefile" --output "$chartfile"; }
[ "${filestat%% *}" != "$(date '+%Y-%m-%d')" ] &&
updateme="1"