diff options
| author | TheSiahxyz <164138827+TheSiahxyz@users.noreply.github.com> | 2026-03-29 10:01:46 +0900 |
|---|---|---|
| committer | TheSiahxyz <164138827+TheSiahxyz@users.noreply.github.com> | 2026-03-29 10:01:46 +0900 |
| commit | 64d760460383da782277ecfc52effaf776398d84 (patch) | |
| tree | 38ecf3c37e570aee72d97afaf61a08b75b9e3500 /ar/.local/bin/statusbar/sb-system | |
| parent | a5242927bb70c24a92588438f75d88cbc151a809 (diff) | |
deleted statusbar/sb-disk, modified statusbar/sb-system
Diffstat (limited to 'ar/.local/bin/statusbar/sb-system')
| -rwxr-xr-x | ar/.local/bin/statusbar/sb-system | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/ar/.local/bin/statusbar/sb-system b/ar/.local/bin/statusbar/sb-system index b2e28af..48addca 100755 --- a/ar/.local/bin/statusbar/sb-system +++ b/ar/.local/bin/statusbar/sb-system @@ -21,6 +21,13 @@ DISK_LOCATION=${1:-/} CACHE_DIR=/tmp/sb-system mkdir -p "$CACHE_DIR" +# Clear stale caches on first run (e.g. dwmblocks restart) +LOCK="$CACHE_DIR/.started" +if [ ! -f "$LOCK" ]; then + rm -f "$CACHE_DIR"/cpu "$CACHE_DIR"/cpubars "$CACHE_DIR"/cpubars_prev "$CACHE_DIR"/memory "$CACHE_DIR"/disk* + touch "$LOCK" +fi + # ── Helper: check if cache is stale ──────────────────────── # usage: is_stale <cache_file> <interval_seconds> is_stale() { |
