{"slug": "kde-plasma-ai-quota-hud-my-arch-linux-setup", "title": "KDE Plasma AI Quota HUD: My Arch Linux Setup", "summary": "A developer built a KDE Plasma panel HUD for Arch Linux that tracks AI quota usage across Claude, Codex, Gemini, and DeepSeek using four circular indicators, after fixing a bug caused by relying on positional data in API responses. The system now uses duration-based identification and state validation to handle schema changes from providers like Codex.", "body_md": "# KDE Plasma AI Quota HUD: My Arch Linux Setup\n\n[Claude](/en/tags/claude/)Code, Codex, Gemini, and DeepSeek on Arch Linux is a logistical nightmare. When you're deep into a complex task with massive context and an hour of iteration, the last thing you want is to hit a rate limit mid-\n\n`git rebase`\n\n. To solve this, I built a HUD for the KDE panel that tracks remaining room and reset times for each agent via four circular indicators.## The \"Token-Week\" Problem\n\nThe industry has created a bizarre new unit of measurement: the token-hour or token-week. Every provider does it differently:\n\n**Claude:** Uses rolling hour/day windows.**Codex:** Reports specific plan windows.Requires local request estimation.[Gemini](/en/tags/gemini/):Operates on a monetary balance.[DeepSeek](/en/tags/deepseek/):\n\nI've essentially turned my panel into a dashboard of \"donuts.\" A full ring means the agent is ready; an empty one means it's time to switch models. Hovering provides the exact reset time, so I don't have to leave my terminal to check if I've exhausted my limits.\n\n## Technical Pivot: Data over Position\n\nMy initial deployment failed because I relied on the position of data in the API response. For Codex, I assumed the first window returned was the 5-hour limit and the second was the weekly limit.\n\nWhen Codex changed their schema and stopped reporting the short window, my logic broke. The widget started labeling a 7-day window as \"5h\" because it was the first item in the list. To fix this for a more robust AI workflow, I implemented two changes:\n\n1. **Duration-based Identification:** The system now identifies windows by their actual length. Short durations are flagged as sessions; long durations are flagged as weekly limits.\n\n2. **State Validation:** I decoupled \"failed queries\" from \"missing data.\" If a query fails, the HUD preserves the last cached value. If a query succeeds but a window is missing, the HUD removes that window from the state entirely.\n\nThis prevents the \"ghost value\" bug where a depleted quota appears active just because the API call timed out. For anyone building a custom LLM agent monitor, avoid positional indexing at all costs—API schemas shift too often.\n\n[Next SEO Automation vs. Domain Authority: A Reality Check →](/en/threads/3771/)", "url": "https://wpnews.pro/news/kde-plasma-ai-quota-hud-my-arch-linux-setup", "canonical_source": "https://promptcube3.com/en/threads/3799/", "published_at": "2026-07-26 18:46:17+00:00", "updated_at": "2026-07-26 19:11:04.463626+00:00", "lang": "en", "topics": ["ai-tools", "developer-tools"], "entities": ["KDE Plasma", "Arch Linux", "Claude", "Codex", "Gemini", "DeepSeek"], "alternates": {"html": "https://wpnews.pro/news/kde-plasma-ai-quota-hud-my-arch-linux-setup", "markdown": "https://wpnews.pro/news/kde-plasma-ai-quota-hud-my-arch-linux-setup.md", "text": "https://wpnews.pro/news/kde-plasma-ai-quota-hud-my-arch-linux-setup.txt", "jsonld": "https://wpnews.pro/news/kde-plasma-ai-quota-hud-my-arch-linux-setup.jsonld"}}