# Source0 is GitLab's archive of the tag named like the version (0.8.0, no "v"): # spectool -g -R claude-usage.spec # rpmbuild -ba claude-usage.spec # For an untagged commit, make the same archive locally instead: # git archive --prefix=claude-usage-$(cat scripts/VERSION)/ \ # -o ~/rpmbuild/SOURCES/claude-usage-$(cat scripts/VERSION).tar.gz HEAD # Version has to match scripts/VERSION. %global uuid_claudeai claudeusage@claudeusage %global uuid_vertex claudeusage-vertex@claudeusage Name: claude-usage Version: 0.8.7 Release: 1%{?dist} Summary: Claude usage rings for the KDE Plasma and GNOME Shell panels License: MIT URL: https://gitlab.cee.redhat.com/poros/claude-usage Source0: %{url}/-/archive/%{version}/%{name}-%{version}.tar.gz BuildArch: noarch BuildRequires: python3 BuildRequires: unzip BuildRequires: zip %global _description %{expand: Two rings in the panel that show how much Claude you use. The claude.ai ring shows the limits of a claude.ai subscription (Pro, Max) the same way as /usage in Claude Code, the Vertex AI ring the estimated spend in USD on Google Vertex AI. A ring whose source is not set up on the machine hides itself.} %description %_description %package kde Summary: Claude usage tray items for KDE Plasma 6 Requires: plasma-workspace >= 6 Requires: python3 # QML modules the widget imports. plasma5support (the executable data engine that runs the # script) is not pulled in by plasma-workspace. Requires: qt6qml(org.kde.kcmutils) Requires: qt6qml(org.kde.kirigami) Requires: qt6qml(org.kde.plasma.components) Requires: qt6qml(org.kde.plasma.core) Requires: qt6qml(org.kde.plasma.extras) Requires: qt6qml(org.kde.plasma.plasma5support) Requires: qt6qml(org.kde.plasma.plasmoid) Requires: qt6qml(QtQuick.Dialogs) # Vertex AI only; without them the script falls back to the gcloud command. Recommends: python3-google-auth Recommends: python3-requests %description kde %_description This package contains the two KDE Plasma system tray items, Claude Usage (claude.ai) and Claude Usage (Vertex AI). %package gnome Summary: Claude usage extensions for GNOME Shell # The lowest version in shell-version of gnome/metadata.json. Requires: gnome-shell >= 45 Requires: python3 # Vertex AI only; without them the script falls back to the gcloud command. Recommends: python3-google-auth Recommends: python3-requests %description gnome %_description This package contains the two GNOME Shell extensions, Claude Usage (claude.ai) and Claude Usage (Vertex AI). Log out and back in, then enable the ones you want in the Extensions app, or with: gnome-extensions enable %{uuid_claudeai} gnome-extensions enable %{uuid_vertex} %prep %autosetup [ "$(cat scripts/VERSION)" = "%{version}" ] || { echo "scripts/VERSION is not %{version}"; exit 1; } %build # Runs the tests and lays out the release the way install.sh installs it: the two Plasma items # with their own Ids and the two GNOME extensions, each with a copy of scripts/. ./build.sh %install mkdir -p release tar -xzf dist/%{name}-%{version}.tar.gz -C release install -d %{buildroot}%{_datadir}/plasma/plasmoids cp -a release/%{name}-%{version}/plasmoid-claudeai %{buildroot}%{_datadir}/plasma/plasmoids/claudeusage cp -a release/%{name}-%{version}/plasmoid-vertex %{buildroot}%{_datadir}/plasma/plasmoids/claudeusage.vertex for uuid in %{uuid_claudeai} %{uuid_vertex}; do install -d %{buildroot}%{_datadir}/gnome-shell/extensions/$uuid unzip -q dist/$uuid.shell-extension.zip -d %{buildroot}%{_datadir}/gnome-shell/extensions/$uuid done %check python3 tests/test_scripts.py %files kde %license LICENSE %doc README.md %{_datadir}/plasma/plasmoids/claudeusage/ %{_datadir}/plasma/plasmoids/claudeusage.vertex/ %files gnome %license LICENSE %doc README.md %{_datadir}/gnome-shell/extensions/%{uuid_claudeai}/ %{_datadir}/gnome-shell/extensions/%{uuid_vertex}/ %changelog * Fri Oct 16 2026 Petr Oros - 0.8.7-1 - Support GNOME Shell 51, where St.BoxLayout no longer has the vertical property and the popups stayed empty * Fri Oct 16 2026 Petr Oros - 0.8.6-1 - Split the GNOME extension into two, claudeusage@claudeusage for the claude.ai ring and claudeusage-vertex@claudeusage for the Vertex AI ring, so each ring is enabled on its own like the Plasma items - Describe each Plasma item by its own ring * Fri Oct 16 2026 Petr Oros - 0.8.5-1 - Never replace a config.env that cannot be read, and keep bytes that are not UTF-8 when rewriting it - Survive damaged credentials, cache and backoff files - Show a GNOME ring whose script failed before it answered - Say "Problem with the settings" instead of "Invalid settings" - Wrap long messages in the GNOME popup * Fri Oct 16 2026 Petr Oros - 0.8.4-1 - Write a setting back to config.env only when it differs, which stops a write and fetch loop of a Plasma item with a lost configuration * Fri Oct 16 2026 Petr Oros - 0.8.3-1 - Keep the focus in a color band amount while typing in the Plasma settings, and show the spend limit as a plain number * Fri Oct 16 2026 Petr Oros - 0.8.2-1 - Query the Vertex AI spend in hourly steps; one long step overstated older, sparse usage up to twice the bill - Keep the quota project warning of google-auth off stderr - Describe the RPM packages as the way to install * Wed Oct 14 2026 Petr Oros - 0.8.1-1 - Take the source from the GitLab tag archive * Wed Oct 14 2026 Petr Oros - 0.8.0-1 - Price Vertex AI usage with Google's price list, per endpoint location - Show only the ring's own source in its popup and tooltip - Give each ring its own settings - Optionally show the Vertex AI spend per model * Tue Oct 13 2026 Ivan Vecera - 0.7.0-1 - Initial package