mirror of
https://github.com/kuhyx/testsAndMisc.git
synced 2026-11-21 00:52:17 +01:00
Add a [claude_usage] block showing the 5h and 7d rate-limit windows. It
reads ~/.claude/cache/limit-state/*.json, which Claude Code's statusLine
hook already writes to disk, so the data costs nothing to display: the
script only runs jq against a local file and makes no API call. Limits
are account-wide while the cache is sharded one file per project, so it
takes the newest file and ignores cwd. Percentages arrive as floats and
are truncated; a stale cache is labelled rather than shown as current,
and a rolled-over window reads "?%" instead of a misleading value.
Replace Font Awesome private-use-area icons with plain Unicode. Both
fonts named in the bar's pango string ("System San Francisco Display",
"FontAwesome") are not installed, so PUA codepoints fell through to
whatever font claimed them: ethernet rendered as a star, wifi as
Cyrillic, gpu as Hangul, disk as a chess pawn. Emoji resolve through
fontconfig consistently, which the pre-existing volume block already
relied on, and need no change to ~/.config/i3/config.
Remove the bluetooth, battery, wifi, activitywatch, warp and
network_monitor blocks: this desktop has no BT adapter, no battery, no
wireless interface, and no warp-cli. This also removes a rendering bug,
since activitywatch_status.sh and warp_status.sh were interval=persist
yet emitted three lines per update, leaking their colour line into the
bar as literal "#FF0000" text.
Fix ethernet reporting "down" on a live wired link:
find_ethernet_interface returned the first non-loopback interface, which
with docker installed is a br-* bridge (permanently down, and sorted
before enp*). It now requires a real /sys/class/net/*/device and prefers
an interface that is up.
Tests drop the assertions and fixtures for the removed blocks and add
claude_usage coverage (fresh, warn, critical, stale, rolled-over, null
reset, unparsable, missing dir), a guard that removed blocks cannot
return, a repo-wide check that no block script uses a PUA codepoint, and
an ethernet physical-NIC regression check. The fork budget is asserted
against a populated cache directory, which caught a stat call inside the
scan loop that cost one fork per cached project (170 -> 2 execs).
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01YQLwdquDCNmWtvgi3Lk72J
22 lines
1.8 KiB
JSON
22 lines
1.8 KiB
JSON
{
|
|
"title": "i3 bar: add Claude usage block, fix broken icons, remove dead blocks",
|
|
"objective": "Surface Claude Code's 5-hour and 7-day rate-limit windows in the i3 status bar, replace Font Awesome private-use-area icon codepoints that render as wrong glyphs (the fonts named in the bar's pango string are not installed), and remove status blocks for hardware/software absent from this desktop.",
|
|
"acceptance_criteria": [
|
|
"A [claude_usage] block renders '5h NN% · 7d NN%' matching the newest ~/.claude/cache/limit-state/*.json",
|
|
"claude_usage degrades safely: stale cache is labelled, a rolled-over window reads '?%' instead of a misleading number, and missing/unparsable data reads 'no data'",
|
|
"No script under i3blocks/ contains a private-use-area codepoint (U+E000-U+F8FF) or a \\uEXXX/\\uFXXX escape",
|
|
"No literal colour string (e.g. #FF0000) is rendered as visible text in the bar",
|
|
"The bluetooth, battery, wifi, activitywatch, warp and network_monitor blocks are absent from the config and their scripts deleted",
|
|
"The ethernet block reports the physical NIC's address rather than a docker bridge's permanent 'down'",
|
|
"bash linux_configuration/tests/test_i3blocks_efficiency.sh exits 0",
|
|
"pre-commit passes on all changed files"
|
|
],
|
|
"out_of_scope": [
|
|
"Editing ~/.config/i3/config or its font line (it has drifted from the repo by three live-only exec lines; the emoji approach avoids needing a font change)",
|
|
"Installing a Nerd Font or any new font package",
|
|
"Restarting i3 while a fullscreen game session is running",
|
|
"Any change to blocks that already render correctly (volume, shutdown_countdown, pc_startup)"
|
|
],
|
|
"verifier": "bash linux_configuration/tests/test_i3blocks_efficiency.sh; pre-commit run --files <changed>; i3blocks -c ~/.config/i3blocks/config -o i3bar (inspect emitted JSON)"
|
|
}
|