From a79416f5eb2de2d9505704911dfca4b048157f2c Mon Sep 17 00:00:00 2001 From: TheSiahxyz <164138827+TheSiahxyz@users.noreply.github.com> Date: Thu, 29 Jan 2026 10:51:32 +0900 Subject: modified statusbar/sb-clock, modified statusbar/sb-forecast, created plugins/auto-tag.lua --- ar/.local/bin/statusbar/sb-forecast | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'ar/.local/bin/statusbar/sb-forecast') diff --git a/ar/.local/bin/statusbar/sb-forecast b/ar/.local/bin/statusbar/sb-forecast index 65bcd1a..af3c7fd 100755 --- a/ar/.local/bin/statusbar/sb-forecast +++ b/ar/.local/bin/statusbar/sb-forecast @@ -3,7 +3,13 @@ # Displays today's snow chance (🏂), precipication chance (☔), humidity (💧), wind speed (🎐), and current (feel like) temperature (🌞). # Usually intended for the statusbar. -location=$(curl -s http://ip-api.com/json | jq -r '[.regionName, .countryCode] | join(",")') +# Cache location for 24 hours +locationfile="${XDG_CACHE_HOME:-${HOME}/.cache}/statusbar/location" +if [ ! -s "$locationfile" ] || [ $(($(date +%s) - $(stat -c %Y "$locationfile" 2>/dev/null || echo 0))) -gt 86400 ]; then + mkdir -p "${XDG_CACHE_HOME:-${HOME}/.cache}/statusbar" + curl -s http://ip-api.com/json 2>/dev/null | jq -r '[.regionName, .countryCode] | join(",")' > "$locationfile" 2>/dev/null || true +fi +location=$(cat "$locationfile" 2>/dev/null || echo "") url="${WTTRURL:-wttr.in}" weatherreport="${XDG_CACHE_HOME:-${HOME}/.cache}/weatherreport" -- cgit v1.2.3