mirror of
https://github.com/LukeSmithxyz/voidrice.git
synced 2026-01-30 09:48:11 +01:00
Compare commits
4 Commits
a6be7daab2
...
282045b108
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
282045b108 | ||
|
|
92d3560888 | ||
|
|
b0dbb1d1f6 | ||
|
|
f26e5678e6 |
@ -16,5 +16,8 @@ IFS='
|
||||
|
||||
# Update each found profile.
|
||||
for profile in $profiles; do
|
||||
arkenfox-updater -p "${profile%%/user.js*}" -s
|
||||
userjs=${profile%%/user.js*}
|
||||
user=$(stat -c '%U' "$userjs") || continue
|
||||
|
||||
su -l "$user" -c "arkenfox-updater -c -p $userjs -s"
|
||||
done
|
||||
|
||||
@ -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"; }
|
||||
getforecast() { curl -sf "$url/$LOCATION" --output "$weatherreport" && touch "$weatherreport"; }
|
||||
|
||||
# Forecast should be updated only once a day.
|
||||
checkforecast() {
|
||||
[ -s "$weatherreport" ] && [ "$(stat -c %y "$weatherreport" 2>/dev/null |
|
||||
[ "$(stat -c %y "$weatherreport" 2>/dev/null |
|
||||
cut -d' ' -f1)" = "$(date '+%Y-%m-%d')" ]
|
||||
}
|
||||
|
||||
|
||||
@ -4,10 +4,10 @@
|
||||
|
||||
moonfile="${XDG_DATA_HOME:-$HOME/.local/share}/moonphase"
|
||||
|
||||
[ -s "$moonfile" ] && [ "$(stat -c %y "$moonfile" 2>/dev/null | cut -d' ' -f1)" = "$(date '+%Y-%m-%d')" ] ||
|
||||
[ "$(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"; do sleep 60; done &&
|
||||
curl -sf "wttr.in/?format=%m" --output "$moonfile" && touch "$moonfile"; do sleep 60; done &&
|
||||
pkill -RTMIN+"${1:-17}" "${STATUSBAR:-dwmblocks}" ) &
|
||||
echo; exit; }
|
||||
|
||||
|
||||
@ -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"; }
|
||||
updateprice() { curl -sf --fail-early $denom.$url/{1$target,$target$interval} --output "$pricefile" --output "$chartfile" && touch "$pricefile" "$chartfile"; }
|
||||
|
||||
[ "${filestat%% *}" != "$(date '+%Y-%m-%d')" ] &&
|
||||
updateme="1"
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user