{ "intent": "Show Claude Code's 5h/7d rate-limit usage in the i3 bar, make the status icons render as the symbols they are meant to be, and stop displaying blocks for hardware this desktop does not have.", "scope": [ "linux_configuration/scripts/periodic_background/i3-configuration/i3blocks/ (config + block scripts)", "linux_configuration/tests/test_i3blocks_efficiency.sh", "Non-goal: ~/.config/i3/config and its font line are deliberately untouched (drifted from repo by three live-only exec lines)", "Non-goal: installing fonts" ], "changes": [ "Added claude_usage.sh: interval=60, 3-line i3blocks protocol, reads the newest ~/.claude/cache/limit-state/*.json (limits are account-wide but the cache is sharded per-cwd, so newest-by-mtime wins and cwd is ignored). Truncates float percentages, tolerates a null seven_day_resets_at, labels stale data, and reports '?%' for a rolled-over window instead of a misleading cached value.", "Replaced Font Awesome private-use-area codepoints with plain Unicode emoji in cpu_monitor, gpu_monitor, motherboard_temp, memory, disk, ethernet and time. Root cause: both fonts named in the bar's pango string ('System San Francisco Display', 'FontAwesome') are not installed, so PUA codepoints fell through to arbitrary fonts - ethernet rendered as a star, wifi as Cyrillic, gpu as Hangul, disk as a chess pawn.", "Removed the bluetooth, battery, wifi, activitywatch, warp and network_monitor blocks and their scripts, plus the dangling ~/.config/i3blocks symlinks they left behind. This also removed a rendering bug: activitywatch_status.sh and warp_status.sh were interval=persist yet emitted three lines per update, so their trailing colour line was displayed as literal '#FF0000' text in the bar.", "Fixed a pre-existing ethernet bug: find_ethernet_interface returned the first non-loopback interface, which on a machine with docker installed is a br-* bridge (permanently 'down' and alphabetically before enp*), so the bar showed 'down' on a live wired link. It now requires a real /sys/class/net/*/device and prefers an interface that is actually up.", "Updated test_i3blocks_efficiency.sh: dropped assertions and fixtures for the removed blocks, added claude_usage behaviour/fork-budget tests (fresh, warn, critical, stale, rolled-over, null reset, unparsable, missing dir), a guard that removed blocks do not return, a repo-wide check that no block script contains a PUA codepoint, and an ethernet physical-NIC regression check." ], "verification": [ { "command": "bash linux_configuration/tests/test_i3blocks_efficiency.sh", "result": "pass", "evidence": "EXIT=0; 'All i3blocks efficiency regression tests passed.' Includes the new 'Checking Claude usage block behavior and fork count' and 'Checking status icons avoid Font Awesome private-use codepoints' sections." }, { "command": "i3blocks -c ~/.config/i3blocks/config -o i3bar", "result": "pass", "evidence": "Emitted blocks: cpu ๐Ÿ–ฅ 57ยฐC | gpu ๐ŸŽฎ 70ยฐC | mobo ๐ŸŒก 58ยฐC | memory ๐Ÿง  13.8GiB/30.4GiB | disk ๐Ÿ’พ 1.3T/3.6T | volume ๐Ÿ”Š 100% | ethernet ๐ŸŒ 192.168.1.43/24 | claude_usage ๐Ÿค– 5h 38% ยท 7d 55% | pc_startup PC:warn | shutdown โป 23:00 | time ๐Ÿ•‘ 2026-08-10 15:07. No PUA glyphs, no literal colour text, no removed blocks." }, { "command": "./claude_usage.sh vs jq -s 'max_by(.updated_at)' ~/.claude/cache/limit-state/*.json", "result": "pass", "evidence": "Script printed '๐Ÿค– 5h 36% ยท 7d 55%' while the cache reported five_hour_pct=36, seven_day_pct=55.00000000000001. Edge cases exercised with a synthetic LIMIT_STATE_DIR: stale -> '(stale)' grey, rolled window -> '5h ?%', null seven_day reset -> normal render, corrupt/missing/empty -> '๐Ÿค– no data'." }, { "command": "pre-commit run --files ", "result": "pass", "evidence": "shellcheck, codespell, polling-antipattern, binary-file and secret-leak hooks all pass after fixing SC2016 and a codespell hit." } ], "risks": [ "Emoji are rendered by Segoe UI Emoji via fontconfig fallback; if that font were removed the icons would degrade to tofu. Mitigated by the fact that the pre-existing ๐Ÿ”Š and โป blocks already depended on the same path and render correctly.", "claude_usage only refreshes while a Claude Code session is open, because the underlying cache is written by the statusLine hook. Handled explicitly by the stale label rather than silently showing an old number.", "Config-stanza changes need i3blocks to be respawned (i3blocks has no config-reload signal). Script edits are live immediately via the symlinks." ], "rollback": [ "git revert the commit; the deleted block scripts return with it.", "Recreate the ~/.config/i3blocks symlinks for any restored scripts (ln -sf into the repo i3blocks dir) and remove the claude_usage.sh symlink.", "Run i3-msg restart, then confirm the bar renders and bash linux_configuration/tests/test_i3blocks_efficiency.sh exits 0." ] }