From e54d9405dd818cd3ee7c203b8ec1d21713470904 Mon Sep 17 00:00:00 2001 From: "Danilo M." Date: Sun, 18 Oct 2026 10:40:18 +0200 Subject: feat: the cache and slackware cards move to quickshell Both cards are now drawn by quickshell, so the conky copies go: the two widgets, their samplers and texeci lines, their fixtures and icons, and du_parse with human_bytes, which only the cache card used. kv_parse stays for breaktimer; its test now runs on an inline string. README gains a Samplers section listing what conky still schedules, and DESIGN.md's examples point at the cards that remain. Their slots in the layout are left open. Co-Authored-By: Claude Opus 5.5 --- bin/cache-sample.sh | 33 ------------------------------- bin/slackware-sample.sh | 52 ------------------------------------------------- 2 files changed, 85 deletions(-) delete mode 100755 bin/cache-sample.sh delete mode 100755 bin/slackware-sample.sh (limited to 'bin') diff --git a/bin/cache-sample.sh b/bin/cache-sample.sh deleted file mode 100755 index 202bc63..0000000 --- a/bin/cache-sample.sh +++ /dev/null @@ -1,33 +0,0 @@ -#!/bin/bash -# Sample ~/.cache sizes into a cache file, for widgets/cache.lua. -# -# du walks the tree and costs about 100ms warm, which is fine every 15 minutes -# and unthinkable on a 2-second draw. The old conky config used the same -# interval for the same reason. - -set -u - -CACHE_DIR="${XDG_CACHE_HOME:-$HOME/.cache}/udt" -CACHE="$CACHE_DIR/cachesize.txt" -TARGET="${XDG_CACHE_HOME:-$HOME/.cache}" - -umask 077 -mkdir -p "$CACHE_DIR" - -TMP="$CACHE.tmp.$$" -trap 'rm -f "$TMP"' EXIT - -# Total first, then the four largest children. `sort -h` compares human sizes -# numerically; the Lua side converts them again because it needs the ratio to -# the total, not just the order. -{ - du -sh "$TARGET" 2>/dev/null - du -sh "$TARGET"/* 2>/dev/null | sort -hr | head -4 -} > "$TMP" - -if [ ! -s "$TMP" ]; then - echo "cache-sample: du produced nothing" >&2 - exit 1 -fi - -mv -f "$TMP" "$CACHE" diff --git a/bin/slackware-sample.sh b/bin/slackware-sample.sh deleted file mode 100755 index 066c520..0000000 --- a/bin/slackware-sample.sh +++ /dev/null @@ -1,52 +0,0 @@ -#!/bin/bash -# Sample Slackware facts into a cache file, for widgets/slackware.lua. -# -# Conky's Lua has no lfs, so it cannot stat a file for an mtime, and counting -# 2800 package files every two seconds would be a directory walk per draw. -# Both belong here. - -set -u - -CACHE_DIR="${XDG_CACHE_HOME:-$HOME/.cache}/udt" -CACHE="$CACHE_DIR/slackware.txt" - -umask 077 -mkdir -p "$CACHE_DIR" - -TMP="$CACHE.tmp.$$" -trap 'rm -f "$TMP"' EXIT - -VERSION=$(cat /etc/slackware-version 2>/dev/null || echo unknown) - -# /var/log/packages is a symlink to /var/lib/pkgtools/packages. GNU ls follows -# it either way, so the trailing slash is belt and braces rather than the load -# bearing part; what would break this is adding -d, which lists the link itself -# and reports one package. -# -# The real trap is `ls` being aliased: the user's shell aliases it to `ls -lh`, -# and a long-format listing counts a "total" header line as a package. This -# script is not interactive so aliases do not apply, but do not move this -# counting into anything that is. -PACKAGES=$(ls -1 /var/log/packages/ 2>/dev/null | wc -l) - -# Epochs, never formatted dates. The shell function this replaces rebuilds a -# date string from `ls -l` output with the year hardcoded, which breaks every -# January and on any file older than six months, when ls prints a year instead -# of a time and the field offsets shift. -CHANGELOG=$(stat -c %Y /var/lib/slackpkg/ChangeLog.txt 2>/dev/null || echo 0) - -# Filesystem birth time: the install date. Not every filesystem records it, -# and those that do not report 0, which the widget shows as '--'. -BIRTH=$(stat -c %W / 2>/dev/null || echo 0) - -KERNEL=$(uname -r) - -{ - echo "version $VERSION" - echo "packages $PACKAGES" - echo "changelog $CHANGELOG" - echo "birth $BIRTH" - echo "kernel $KERNEL" -} > "$TMP" - -mv -f "$TMP" "$CACHE" -- cgit v1.2.3