plasma6-applets-ai-usage
LOW
maintainer jinzhongjia
0 votes
scanned 2026-08-27 19:33:23.106999
Why flagged
Uploaded within the last 14 days with 2 or fewer community votes — little peer review so far.
Triggered rules
Low
Few votes, recently uploaded
zero_votes_recent
Uploaded within the last 14 days with 2 or fewer community votes — little peer review so far.
PKGBUILD
1
# Maintainer: jinzhongjia <mail@nvimer.org>
2
3
# Scope: the KDE Plasma 6 applet only. Upstream also ships a Hyprland/Quickshell
4
# shell and a terminal frontend; neither is packaged or supported here.
5
6
_gitname=kde-ai-usage
7
# KPlugin.Id from package/metadata.json — the plasmoid install dir, the icon
8
# name and the kpackagetool6 removal id all derive from it.
9
_plasmoid=org.muddyblack.aiUsageWidget
10
11
pkgname=plasma6-applets-ai-usage
12
pkgver=2.1.1
13
pkgrel=1
14
pkgdesc="KDE Plasma 6 panel widget tracking AI usage quotas across 11 AI providers"
15
arch=('any')
16
url="https://github.com/Muddyblack/kde-ai-usage"
17
license=('MIT')
18
# The backend is stdlib-only Python driven by bash launchers; the widget reaches
19
# it through plasma5support's executable DataEngine.
20
depends=('libplasma' 'plasma5support' 'python' 'hicolor-icon-theme')
21
optdepends=(
22
'claude-code: Claude subscription windows and local activity stats'
23
'codex-bin: Codex/ChatGPT plan limits and account status for the OpenAI tab'
24
'kiro: Kiro monthly credit tracking'
25
'antigravity: Antigravity/Google AI Studio quota tracking'
26
'nodejs: run the antigravity-usage CLI for richer Antigravity data'
27
)
28
install="${pkgname}.install"
29
source=("${pkgname}-${pkgver}.tar.gz::${url}/archive/refs/tags/v${pkgver}.tar.gz")
30
sha256sums=('47ddc1aa0c5f3577b246827f5af784ad18a2c81c932d4415097f68c3dea45cfb')
31
32
check() {
33
cd "${_gitname}-${pkgver}"
34
# Tests import the Python modules shipped inside package/. Keep build-host
35
# bytecode (and its $srcdir paths) out of the final architecture-any payload.
36
export PYTHONDONTWRITEBYTECODE=1
37
# Contract tests for the backend the widget shells out to. They are pure
38
# fixture replays — no network, no credentials — so they are safe in a
39
# clean chroot. tests/ai-usage-cli.test.sh is skipped on purpose: it covers
40
# the terminal frontend, which this package does not ship.
41
./tests/get-ai-usage.test.sh
42
./tests/credentials.test.sh
43
./tests/python-interp.test.sh
44
./tests/get-codex-stats.test.sh
45
./tests/get-codex-rate-limits.test.sh
46
}
47
48
package() {
49
cd "${_gitname}-${pkgver}"
50
51
local _root="${pkgdir}/usr/share/plasma/plasmoids/${_plasmoid}"
52
53
install -dm755 "${_root}"
54
cp -r package/. "${_root}/"
55
56
# cp carries the tarball's group-writable bits over; normalise, then put the
57
# exec bit back on the launchers. main.qml drives get-ai-usage,
58
# export-snapshot and history-io through the executable DataEngine;
59
# ai-usage-cli is left runnable because the widget's own settings page
60
# prints its in-package path, and a 644 file there would just fail for
61
# anyone who follows that hint. python-interp.sh stays 644 — it is sourced,
62
# never executed.
63
find "${_root}" -type d -exec chmod 755 {} +
64
find "${_root}" -type f -exec chmod 644 {} +
65
chmod 755 "${_root}"/contents/tools/sh/{ai-usage-cli,get-ai-usage,export-snapshot,history-io}
66
67
# plasmashell inherits the systemd user session's PATH, not a login shell's
68
# — a `python3` that only exists via a shell rc file makes every provider
69
# render "python3 missing". Pin the distro interpreter so the installed
70
# widget is self-contained. $PYTHON3 (and the widget's Settings -> Advanced
71
# -> Python field) still win, and the PATH candidates further down in
72
# python-interp.sh still act as fallbacks. Patched here rather than in
73
# prepare() so check() gets to run the suite against pristine sources: its
74
# "no interpreter" case assumes the unpinned default.
75
grep -q '^PY_DEFAULT="python3"$' "${_root}/contents/tools/sh/python-interp.sh"
76
sed -i 's|^PY_DEFAULT="python3"$|PY_DEFAULT="/usr/bin/python3"|' \
77
"${_root}/contents/tools/sh/python-interp.sh"
78
79
# Plasma's Widget Explorer looks the icon up by name in the icon theme, not
80
# inside the plasmoid, so it has to be registered in hicolor as well.
81
install -Dm644 "package/contents/icons/${_plasmoid}.svg" \
82
"${pkgdir}/usr/share/icons/hicolor/scalable/apps/${_plasmoid}.svg"
83
84
install -Dm644 LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
85
install -Dm644 README.md "${pkgdir}/usr/share/doc/${pkgname}/README.md"
86
install -Dm644 docs/provider-contract.md \
87
"${pkgdir}/usr/share/doc/${pkgname}/provider-contract.md"
88
}
89
Changes since previous scan
--- PKGBUILD @ 2026-08-18 00:03+++ PKGBUILD @ 2026-08-27 19:33@@ -9,7 +9,7 @@ _plasmoid=org.muddyblack.aiUsageWidget pkgname=plasma6-applets-ai-usage-pkgver=2.1.0+pkgver=2.1.1 pkgrel=1 pkgdesc="KDE Plasma 6 panel widget tracking AI usage quotas across 11 AI providers" arch=('any')@@ -27,15 +27,19 @@ ) install="${pkgname}.install" source=("${pkgname}-${pkgver}.tar.gz::${url}/archive/refs/tags/v${pkgver}.tar.gz")-sha256sums=('ad0aec4f51a348ef2839224ad833c04deb0e38287703a43bc60f216f9b631363')+sha256sums=('47ddc1aa0c5f3577b246827f5af784ad18a2c81c932d4415097f68c3dea45cfb') check() { cd "${_gitname}-${pkgver}"+ # Tests import the Python modules shipped inside package/. Keep build-host+ # bytecode (and its $srcdir paths) out of the final architecture-any payload.+ export PYTHONDONTWRITEBYTECODE=1 # Contract tests for the backend the widget shells out to. They are pure # fixture replays — no network, no credentials — so they are safe in a # clean chroot. tests/ai-usage-cli.test.sh is skipped on purpose: it covers # the terminal frontend, which this package does not ship. ./tests/get-ai-usage.test.sh+ ./tests/credentials.test.sh ./tests/python-interp.test.sh ./tests/get-codex-stats.test.sh ./tests/get-codex-rate-limits.test.shScan history
| Scanned at (UTC) | Severity | Rules |
|---|---|---|
| 2026-08-27 19:33:23 | Low | 1 |
| 2026-08-18 00:03:42 | Clean | 2 |
| 2026-08-17 07:35:18 | Low | 1 |