From fd9c42d70389390c858e30e44a3db558bb698668 Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 1 Dec 2026 07:25:54 +0000 Subject: [PATCH 1/4] Desktops other than Plasma: the installer says what is missing, and the docs say what works (0.9.12) Linux/install.sh --check installs nothing and says which parts of Qt 6 the window still needs with the command that brings them, whether the desktop shows app icons in its notification area (GNOME needs its AppIndicator extension), and that the widget is Plasma's alone. A normal install says the same instead of promising a window that would not open or an icon nothing shows. Co-Authored-By: tokenmeter1 <358883051+tokenmeter1@users.noreply.github.com> Co-Authored-By: Claude Fable 5.2 Claude-Session: https://claude.ai/code/session_01EE8zW9xXDFNPa2ueA83i2x --- .github/workflows/build.yml | 4 + Android/build.sh | 2 +- App/StatusJSON.swift | 2 +- Linux/install.sh | 151 +++++++++++++++++++++++++++++-- Linux/kde/app/AppVersion.js | 2 +- Linux/kde/mock/machines.json | 2 +- Linux/kde/mock/settings.json | 2 +- Linux/kde/plasmoid/metadata.json | 2 +- Linux/tests/desktops.sh | 86 ++++++++++++++++++ README.md | 4 +- build-library-app.sh | 2 +- docs/wiki/Install-Linux.md | 27 +++++- scripts/check.sh | 2 +- scripts/package-flatpak.sh | 2 +- scripts/package-linux.sh | 2 +- scripts/package-service.sh | 2 +- scripts/package.sh | 2 +- 17 files changed, 272 insertions(+), 24 deletions(-) create mode 100644 Linux/tests/desktops.sh diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 71e8bc9a..589410ba 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -348,6 +348,10 @@ jobs: # A stand-in collector: nothing is sent until the export is on, then the figures of /metrics arrive under the # same names with the headers given, a refusal is told, and switching it off stops the sending. run: sh Linux/tests/otlp.sh .build/release/tokenmeter + - name: Desktops other than Plasma + # The installer's check against stand-in folders of Qt, package managers and desktops: the missing parts of + # Qt are named with the command that brings them, GNOME's extension is named, nothing is installed. + run: sh Linux/tests/desktops.sh - name: The idle service stays within its budget # Processor time, wake-ups, open files and memory of a service with nothing to watch, over a minute. # The stand-in engines of the steps above are stopped first: with them it has work to do. diff --git a/Android/build.sh b/Android/build.sh index 6817c7ff..20e38cdf 100755 --- a/Android/build.sh +++ b/Android/build.sh @@ -20,7 +20,7 @@ platform=${ANDROID_PLATFORM:-35} jar=$sdk/platforms/android-$platform/android.jar [ -f "$jar" ] || { echo "No $jar: install the platform with sdkmanager \"platforms;android-$platform\"." >&2; exit 1; } tools=$(ls -d "$sdk"/build-tools/* | sort -V | tail -1) -version=${APP_VERSION:-0.9.11} +version=${APP_VERSION:-0.9.12} IFS=. read -r major minor patch <<<"$version.0.0" code=$((major * 10000 + minor * 100 + ${patch%%[^0-9]*})) diff --git a/App/StatusJSON.swift b/App/StatusJSON.swift index b0dd6ab2..f18d276c 100644 --- a/App/StatusJSON.swift +++ b/App/StatusJSON.swift @@ -440,7 +440,7 @@ struct LocalResponse { extension StatusReport { /// Tokenmeter's version. The Mac app reads it from its Info.plist, which build-library-app.sh writes; the /// Linux service has no Info.plist, so it uses `releaseVersion`. Keep that in step with the build scripts. - static let releaseVersion = "0.9.11" + static let releaseVersion = "0.9.12" static var appVersion: String { Bundle.main.object(forInfoDictionaryKey: "CFBundleShortVersionString") as? String ?? releaseVersion } diff --git a/Linux/install.sh b/Linux/install.sh index 6211a4d0..a687bf5d 100755 --- a/Linux/install.sh +++ b/Linux/install.sh @@ -6,6 +6,8 @@ # Linux/install.sh --service-only only the service, for a machine without a desktop (a DGX Spark, a server): # it keeps running after you log out, and other machines' Tokenmeter can read it # Linux/install.sh --uninstall remove everything but the usage history +# Linux/install.sh --check install nothing: say what this desktop has for the window, the notification +# area icon, the widget and alerts, and which packages bring what is missing # # With --service-only, --local-only keeps the service to this machine (other machines can't read it). # @@ -47,15 +49,140 @@ service_only="" # Not $share, which is the data folder above: --service-only lets other machines read the service unless --local-only. let_others_read=yes uninstall="" +check="" for argument in "$@"; do case "$argument" in --uninstall) uninstall=yes ;; + --check) check=yes ;; --service-only|--headless) service_only=yes ;; --local-only) let_others_read="" ;; - *) echo "Unknown option $argument. Use --service-only, --local-only or --uninstall." >&2; exit 2 ;; + *) echo "Unknown option $argument. Use --service-only, --local-only, --check or --uninstall." >&2; exit 2 ;; esac done +# What the window needs of Qt 6, whatever the desktop (Plasma brings all of it; GNOME, Xfce and others bring little +# or none). Debian and Ubuntu split Qt's QML modules into a package each, so a missing one is named by its package. +# Sets $qml_tool (Qt's `qml` program, empty when there is none), $qml_folder (where Qt keeps its QML modules, empty +# when it can't be found) and $qt_missing (the modules that aren't there, by their import names). +# TOKENMETER_QML_FOLDER names the folder when Qt is somewhere this script does not look. +qt_modules="QtQuick QtQuick.Controls QtQuick.Layouts QtQuick.Templates QtQuick.Window QtQml.WorkerScript QtCore" +look_at_qt() { + qml_tool="" + for candidate in qml6 qml-qt6 /usr/lib/qt6/bin/qml /usr/lib64/qt6/bin/qml; do + if have "$candidate"; then qml_tool=$candidate; break; fi + done + qml_folder="" + asked="" + for tool in qtpaths6 qtpaths-qt6 /usr/lib/qt6/bin/qtpaths /usr/lib64/qt6/bin/qtpaths; do + if have "$tool"; then asked=$("$tool" --query QT_INSTALL_QML 2>/dev/null || true); break; fi + done + for folder in "${TOKENMETER_QML_FOLDER:-}" "$asked" /usr/lib/*/qt6/qml /usr/lib64/qt6/qml /usr/lib/qt6/qml; do + if [ -n "$folder" ] && [ -d "$folder" ]; then qml_folder=$folder; break; fi + done + qt_missing="" + if [ -z "$qml_folder" ]; then + # No folder of modules anywhere: with no `qml` tool either, Qt's QML isn't installed at all. + [ -n "$qml_tool" ] || qt_missing=$qt_modules + return 0 + fi + for module in $qt_modules; do + [ -f "$qml_folder/$(echo "$module" | tr . /)/qmldir" ] || qt_missing="$qt_missing $module" + done + # Settings moved into QtCore with Qt 6.5; an older Qt has them in Qt.labs.settings. + if [ -f "$qml_folder/QtCore/plugins.qmltypes" ] && ! grep -qs Settings "$qml_folder/QtCore/plugins.qmltypes" \ + && [ ! -f "$qml_folder/Qt/labs/settings/qmldir" ]; then + qt_missing="$qt_missing Qt.labs.settings" + fi + qt_missing=${qt_missing# } +} + +# The command that installs what `look_at_qt` found missing, for this distribution's package manager; empty when +# nothing is missing or the package manager is one this script does not know. +qt_install_line() { + [ -n "$qt_missing" ] || [ -z "$qml_tool" ] || return 0 + if have apt-get; then + packages="" + [ -n "$qml_tool" ] || packages="qml-qt6" + for module in $qt_missing; do + case "$module" in + Qt.labs.settings) packages="$packages qml6-module-qt-labs-settings" ;; + *) packages="$packages qml6-module-$(echo "$module" | tr 'A-Z' 'a-z' | sed 's/\./-/')" ;; + esac + done + echo "sudo apt install${packages:+ }${packages# }" + elif have dnf; then echo "sudo dnf install qt6-qtdeclarative-devel" + elif have pacman; then echo "sudo pacman -S --needed qt6-declarative" + elif have zypper; then echo "sudo zypper install qt6-declarative-tools qt6-declarative-imports" + fi +} + +# Whether this session has a notification area that shows app icons (a StatusNotifierItem host): "yes", "no", or +# "unknown" when there is no session to ask (an install over SSH). Plasma, Xfce, Cinnamon, MATE, LXQt and COSMIC +# have one; GNOME has one only with the AppIndicator extension, which Ubuntu switches on and Fedora does not. +tray_host() { + if [ -z "${DBUS_SESSION_BUS_ADDRESS:-}" ] && [ ! -S "${XDG_RUNTIME_DIR:-/nonexistent}/bus" ]; then echo unknown; return 0; fi + if have gdbus; then + answer=$(gdbus call --session --dest org.freedesktop.DBus --object-path /org/freedesktop/DBus \ + --method org.freedesktop.DBus.NameHasOwner org.kde.StatusNotifierWatcher 2>/dev/null || true) + elif have dbus-send; then + answer=$(dbus-send --session --print-reply --dest=org.freedesktop.DBus /org/freedesktop/DBus \ + org.freedesktop.DBus.NameHasOwner string:org.kde.StatusNotifierWatcher 2>/dev/null || true) + else + echo unknown; return 0 + fi + case "$answer" in *true*) echo yes ;; *false*) echo no ;; *) echo unknown ;; esac +} + +# What to do about a desktop with no notification area for app icons, by the desktop's own name. +tray_advice() { + case "${XDG_CURRENT_DESKTOP:-}" in + *GNOME*|*gnome*) + echo "GNOME shows app icons in its top bar only with the \"AppIndicator and KStatusNotifierItem Support\" extension." + if have dnf; then echo " Install it with: sudo dnf install gnome-shell-extension-appindicator" + elif have pacman; then echo " Install it with: sudo pacman -S --needed gnome-shell-extension-appindicator" + elif have apt-get; then echo " Install it with: sudo apt install gnome-shell-extension-appindicator" + elif have zypper; then echo " Install it from https://extensions.gnome.org/extension/615/appindicator-support/" + fi + echo " Then log out and in, switch it on in the Extensions app, and run: tokenmeter-app --tray" ;; + *) + echo "This desktop has no notification area that shows app icons (a StatusNotifierItem tray). Add one to a panel," + echo " then run: tokenmeter-app --tray" ;; + esac +} + +if [ -n "$check" ]; then + look_at_qt + wrong=0 + echo "Tokenmeter on this desktop (${XDG_CURRENT_DESKTOP:-no desktop named}):" + if [ -z "$qt_missing" ] && [ -n "$qml_folder" ]; then + echo " The window: Qt 6 has what it needs ($qml_folder)." + elif [ -z "$qt_missing" ]; then + echo " The window: Qt's qml tool is here ($qml_tool), but not where Qt keeps its modules, so they weren't checked." + else + wrong=1 + echo " The window: these parts of Qt 6 are missing: $(echo "$qt_missing" | sed 's/ /, /g')." + line=$(qt_install_line); [ -z "$line" ] || echo " $line" + fi + if [ -z "$qml_tool" ] && [ -z "$qt_missing" ]; then + echo " Qt's qml tool is not here; the window then has to be compiled (CMake, a C++ compiler, Qt 6's development files)." + fi + if have cmake && { have c++ || have g++ || have clang++; }; then + echo " The notification area icon: CMake and a C++ compiler are here, so install.sh compiles it." + else + echo " The notification area icon: needs CMake, a C++ compiler and Qt 6's development files to be compiled." + fi + case "$(tray_host)" in + yes) echo " This desktop shows app icons in its notification area." ;; + no) wrong=1; echo " $(tray_advice)" ;; + *) echo " No desktop session to ask whether it shows app icons (run this from a terminal on the desktop)." ;; + esac + if have kpackagetool6; then echo " The widget: Plasma 6 is here." + else echo " The widget: is for Plasma 6 only; on other desktops the notification area icon takes its place."; fi + if have notify-send; then echo " Alerts: notify-send is here." + else echo " Alerts: need notify-send (libnotify on Fedora and Arch, libnotify-bin on Debian and Ubuntu)."; fi + exit $wrong +fi + # The service package (scripts/package-service.sh) carries no app, so from there only the service is installed. if [ -x "$here/tokenmeter" ] && [ ! -d "$here/kde" ]; then service_only=yes; fi @@ -197,9 +324,12 @@ for qml in qml6 qml-qt6 /usr/lib/qt6/bin/qml /usr/lib64/qt6/bin/qml; do exec "\$qml" "$share/tokenmeter-kde/app/main.qml" -- "\$@" fi done -message="Tokenmeter needs Qt 6's QML runtime. Install qt6-declarative (Arch), qml-qt6 (Debian, Ubuntu, KDE neon), qt6-qtdeclarative-devel (Fedora) or qt6-declarative-tools (openSUSE)." +message="Tokenmeter needs Qt 6's QML runtime. Linux/install.sh --check says which packages bring it on this system." echo "\$message" >&2 -command -v kdialog >/dev/null 2>&1 && kdialog --title Tokenmeter --error "\$message" +if command -v kdialog >/dev/null 2>&1; then kdialog --title Tokenmeter --error "\$message" +elif command -v zenity >/dev/null 2>&1; then zenity --error --title Tokenmeter --text "\$message" +elif command -v notify-send >/dev/null 2>&1; then notify-send Tokenmeter "\$message" +fi exit 1 LAUNCHER chmod 755 "$bin/tokenmeter-app" @@ -218,7 +348,7 @@ else fi # The Plasma widget, with its own copy of the shared pages. -widget="No Plasma 6 found (kpackagetool6), so the tray widget was not installed." +widget="The widget is for Plasma 6, which is not here (no kpackagetool6); the notification area icon takes its place." if have kpackagetool6; then package=$(mktemp -d) cp -R "$here/kde/plasmoid/." "$package/" @@ -244,7 +374,7 @@ fi # The icon in the notification area, from the compiled window: started at login (unless it was turned off from # its menu, which leaves the entry with Hidden=true) and now. -tray="The notification area icon needs the compiled window (see below)." +tray="The notification area icon needs the compiled window (see above)." pkill -f "tokenmeter-window --tray" 2>/dev/null || true if [ -n "$window" ]; then autostart="$config/autostart/tokenmeter-tray.desktop" @@ -265,6 +395,8 @@ AUTOSTART tray="The notification area icon is turned off; start it with: tokenmeter-app --tray (then tick Show Icon at Login in its menu)." else tray="Tokenmeter's icon is in the notification area and comes back at login (untick Show Icon at Login in its menu to stop that)." + # A desktop that shows no app icons (GNOME without its extension) is told so, rather than promised an icon. + if [ "$(tray_host)" = no ]; then tray="Tokenmeter's icon is set to start at login, but nothing shows it yet. $(tray_advice)"; fi if [ -n "${WAYLAND_DISPLAY:-}${DISPLAY:-}" ]; then nohup "$bin/tokenmeter-app" --tray >/dev/null 2>&1 & fi @@ -274,7 +406,14 @@ fi echo echo "Tokenmeter is installed." echo " $started" -echo " Open the app from the menu, or run: tokenmeter-app" +look_at_qt +if [ -n "$qt_missing" ]; then + echo " The window will NOT open yet: these parts of Qt 6 are missing: $(echo "$qt_missing" | sed 's/ /, /g')." + line=$(qt_install_line); [ -z "$line" ] || echo " $line" + echo " After that, open the app from the menu, or run: tokenmeter-app" +else + echo " Open the app from the menu, or run: tokenmeter-app" +fi if [ -n "${window_failed:-}" ]; then # The tools are there but the window didn't compile: said loudly, since the app still opens (with Qt's qml tool) # and only its icon in the task bar and title bar is missing. diff --git a/Linux/kde/app/AppVersion.js b/Linux/kde/app/AppVersion.js index 762d6030..19cb6506 100644 --- a/Linux/kde/app/AppVersion.js +++ b/Linux/kde/app/AppVersion.js @@ -3,4 +3,4 @@ // update keeps saying the version it is, while the service reports its own (backend.snapshot.version). // scripts/package-linux.sh and package-flatpak.sh write it from the package's version; keep it in step with // StatusReport.releaseVersion when bumping (a unit test checks it). -var version = "0.9.11" +var version = "0.9.12" diff --git a/Linux/kde/mock/machines.json b/Linux/kde/mock/machines.json index 80cadf0b..69acab41 100644 --- a/Linux/kde/mock/machines.json +++ b/Linux/kde/mock/machines.json @@ -7,7 +7,7 @@ "report": { "schema": 1, "app": "Tokenmeter", - "version": "0.9.11", + "version": "0.9.12", "host": "studio", "chip": "Apple M3 Ultra", "time": "2026-11-13T19:00:00Z", diff --git a/Linux/kde/mock/settings.json b/Linux/kde/mock/settings.json index e3b260b0..5cabef36 100644 --- a/Linux/kde/mock/settings.json +++ b/Linux/kde/mock/settings.json @@ -15,7 +15,7 @@ "addresses": [ "192.168.1.20" ], - "version": "0.9.11", + "version": "0.9.12", "shareHistory": false, "footprint": { "cpuPercent": 0.4, diff --git a/Linux/kde/plasmoid/metadata.json b/Linux/kde/plasmoid/metadata.json index e4ddc709..82a460ea 100644 --- a/Linux/kde/plasmoid/metadata.json +++ b/Linux/kde/plasmoid/metadata.json @@ -7,7 +7,7 @@ "Icon": "tokenmeter", "Category": "System Information", "License": "Apache-2.0", - "Version": "0.9.11", + "Version": "0.9.12", "Website": "https://github.com/tokenmeter1/Tokenmeter" }, "X-Plasma-API-Minimum-Version": "6.0", diff --git a/Linux/tests/desktops.sh b/Linux/tests/desktops.sh new file mode 100644 index 00000000..890701c3 --- /dev/null +++ b/Linux/tests/desktops.sh @@ -0,0 +1,86 @@ +#!/bin/sh +# Desktops other than Plasma (Linux/install.sh --check): the installer says which parts of Qt 6 the window still +# needs and the command that brings them, by the system's package manager; that GNOME shows no app icons without its +# extension; and that the widget is Plasma's alone. Nothing is installed: Qt's folder of modules, the package +# manager and the desktop's answer are stand-ins in a folder of their own. +# +# Linux/tests/desktops.sh +set -eu + +install=$(cd "$(dirname "$0")/.." && pwd)/install.sh +work=$(mktemp -d) +trap 'rm -rf "${work:?}" || true' EXIT +fail() { echo "FAILED: $1" >&2; [ -f "$work/said.txt" ] && sed 's/^/ /' "$work/said.txt" >&2; exit 1; } + +# A PATH with only what the installer's check runs, so the package manager and the desktop are the stand-ins'. +tools=$work/bin +mkdir -p "$tools" +for tool in sh dirname tr sed grep cat; do ln -s "$(command -v $tool)" "$tools/$tool"; done +manager() { # the one package manager this "system" has + rm -f "$tools/apt-get" "$tools/dnf" "$tools/pacman" "$tools/zypper" + printf '#!/bin/sh\nexit 0\n' > "$tools/$1"; chmod 755 "$tools/$1" +} +watcher() { # what the session answers when asked whether something shows app icons: true, false, or none (no session) + rm -f "$tools/gdbus" + [ "$1" = none ] && return 0 + printf '#!/bin/sh\necho "(%s,)"\n' "$1" > "$tools/gdbus"; chmod 755 "$tools/gdbus" +} +qt() { # a folder of Qt's QML modules holding the ones named; "settings" puts Settings in QtCore, as Qt 6.5 and later do + rm -rf "$work/qml"; mkdir -p "$work/qml" + for module in "$@"; do + [ "$module" = settings ] && { echo 'Component { name: "QQmlSettings" }' >> "$work/qml/QtCore/plugins.qmltypes"; continue; } + folder=$work/qml/$(echo "$module" | tr . /) + mkdir -p "$folder"; : > "$folder/qmldir" + [ "$module" = QtCore ] && echo 'Component { name: "QQmlStandardPaths" }' > "$folder/plugins.qmltypes" + done + return 0 +} +check() { # desktop name; leaves what was said in said.txt and the exit status in $status + status=0 + env -i PATH="$tools" HOME="$work/home" XDG_CURRENT_DESKTOP="$1" DBUS_SESSION_BUS_ADDRESS=unix:path=/nowhere \ + TOKENMETER_QML_FOLDER="$work/qml" sh "$install" --check > "$work/said.txt" 2>&1 || status=$? +} +says() { grep -qF -- "$1" "$work/said.txt" || fail "$2"; } +says_not() { ! grep -qF -- "$1" "$work/said.txt" || fail "$2"; } +all="QtQuick QtQuick.Controls QtQuick.Layouts QtQuick.Templates QtQuick.Window QtQml.WorkerScript QtCore" + +# Ubuntu 24.04 with only Qt's qml tool installed (Qt 6.4, where Settings are still in Qt.labs.settings). +manager apt-get; watcher true; qt QtQuick QtCore +check ubuntu:GNOME +[ "$status" = 1 ] || fail "a desktop that lacks parts of Qt was reported as ready" +says "QtQuick.Controls, QtQuick.Layouts, QtQuick.Templates, QtQuick.Window, QtQml.WorkerScript, Qt.labs.settings" "the missing parts of Qt weren't named" +says "sudo apt install qml6-module-qtquick-controls qml6-module-qtquick-layouts qml6-module-qtquick-templates qml6-module-qtquick-window qml6-module-qtqml-workerscript qml6-module-qt-labs-settings" \ + "Ubuntu's packages for the missing parts weren't named" +says "shows app icons in its notification area" "Ubuntu's GNOME, which has the extension on, wasn't said to show app icons" +says "for Plasma 6 only" "the widget wasn't said to be Plasma's alone" + +# All of it there: nothing to install, on an old Qt (with Qt.labs.settings) and a new one (Settings in QtCore). +qt $all Qt.labs.settings +check ubuntu:GNOME +[ "$status" = 0 ] || fail "a desktop with all of Qt 6.4's parts was reported as lacking some" +says "Qt 6 has what it needs" "a complete Qt wasn't said to be complete" +says_not "apt install" "packages were asked for though nothing is missing" +qt $all settings +check KDE +[ "$status" = 0 ] || fail "Qt 6.5 and later, which need no Qt.labs.settings, were reported as lacking it" + +# Fedora's GNOME: Qt comes in one package, and nothing shows app icons until the extension is there. +manager dnf; watcher false; qt QtCore +check GNOME +[ "$status" = 1 ] || fail "GNOME without its extension was reported as ready" +says "sudo dnf install qt6-qtdeclarative-devel" "Fedora's package wasn't named" +says "AppIndicator and KStatusNotifierItem Support" "GNOME's extension wasn't named" +says "sudo dnf install gnome-shell-extension-appindicator" "Fedora's package for the extension wasn't named" + +# Another desktop with no tray on its panel, and an install over SSH (no session to ask). +manager pacman; qt $all settings +check XFCE +[ "$status" = 1 ] || fail "a desktop with no tray was reported as ready" +says "no notification area that shows app icons" "a desktop with no tray wasn't told so" +says_not "AppIndicator" "GNOME's extension was named on a desktop that isn't GNOME" +watcher none +check "" +[ "$status" = 0 ] || fail "with no session to ask, the check failed" +says "No desktop session to ask" "with no session to ask, the check didn't say so" + +echo "ok: the installer's check names the missing parts of Qt and their packages, GNOME's extension, and Plasma's widget" diff --git a/README.md b/README.md index 876afb73..a5fa30cd 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ It also hears from your coding agents (oh-my-pi, Claude Code, Codex, GitHub Copi Tokenmeter's service runs on every machine you want to see, and the services that belong together form a **mesh**: the window you open on any one of them shows them all. Machines on the same network find each other, a new one is installed over SSH from one that has it, and updates pass from machine to machine. -It runs on **macOS** (menu bar app) and **Linux** (KDE app and Plasma widget). A machine without a desktop, such as an inference server or an NVIDIA DGX Spark, runs the service alone. +It runs on **macOS** (menu bar app) and **Linux** (a window and a notification area icon on any desktop, plus a widget on KDE Plasma). A machine without a desktop, such as an inference server or an NVIDIA DGX Spark, runs the service alone. ![Tokenmeter's Monitor on a Mac](docs/images/mac-monitor.png) @@ -220,7 +220,7 @@ Your agents can ask it too: Tokenmeter is an [MCP server](docs/wiki/MCP-Server.m **macOS** (Apple silicon, macOS 14 or later): build it from a clone with `./build-library-app.sh`. There is no published release yet; once there is one, its DMG will be under [Releases](https://github.com/tokenmeter1/Tokenmeter/releases). The app installs Tokenmeter's service, which does the watching (counting, proxies, agent reports, MCP, alerts) whether the window is open or not, as on Linux. A Mac without a screen takes the service package alone. [More →](docs/wiki/Install-macOS.md) -**Linux** (KDE Plasma 6): run the installer from a clone (there is no published release yet; once there is one, its Flatpak will be under [Releases](https://github.com/tokenmeter1/Tokenmeter/releases)): +**Linux** (KDE Plasma 6; [other desktops](docs/wiki/Install-Linux.md#other-desktops-gnome-xfce-cinnamon-and-the-rest) get the window and the icon): run the installer from a clone (there is no published release yet; once there is one, its Flatpak will be under [Releases](https://github.com/tokenmeter1/Tokenmeter/releases)): ```sh git clone https://github.com/tokenmeter1/Tokenmeter.git diff --git a/build-library-app.sh b/build-library-app.sh index 2630871c..caae3818 100755 --- a/build-library-app.sh +++ b/build-library-app.sh @@ -18,7 +18,7 @@ for word in "$@"; do esac done app="$project_dir/Tokenmeter.app" -version=${APP_VERSION:-0.9.11} +version=${APP_VERSION:-0.9.12} build=${APP_BUILD:-1} # SwiftUI's @State is a compiler macro in the macOS 26 SDK. The Command Line Tools ship that SDK without diff --git a/docs/wiki/Install-Linux.md b/docs/wiki/Install-Linux.md index 218b2b9c..73e11d21 100644 --- a/docs/wiki/Install-Linux.md +++ b/docs/wiki/Install-Linux.md @@ -3,8 +3,8 @@ On Linux, Tokenmeter has four parts: - **The `tokenmeter` service** watches the servers, counts tokens and answers on `http://127.0.0.1:7733`. It runs as a systemd user unit and starts at login. -- **The app**, a window with the Monitor, Usage, Performance, Gizmo, Engines and Settings pages. It follows your Plasma colour scheme. -- **The notification area icon**, the gauge in the system tray, with a menu of the servers and their speed. It starts at login and works on any desktop with a StatusNotifierItem tray, not only Plasma. +- **The app**, a window with the Monitor, Usage, Performance, Gizmo, Engines and Settings pages. It wears the Machine Room's colours on every desktop. +- **The notification area icon**, the gauge in the system tray, with a menu of the servers and their speed. It starts at login and works on any desktop with a StatusNotifierItem tray, not only Plasma (see [Other desktops](#other-desktops-gnome-xfce-cinnamon-and-the-rest)). - **The Plasma 6 widget**, a gauge for the system tray or a panel, with a fuller popup (charts, GPU and memory, Gizmo). ![The Linux app](../images/linux-monitor.png) @@ -34,8 +34,16 @@ Flatpak fetches the KDE runtime from Flathub the first time. |---|---| | Fedora | `sudo dnf install qt6-qtdeclarative-devel` | | Arch, Manjaro | `sudo pacman -S qt6-declarative` | -| Debian, Ubuntu, KDE neon | `sudo apt install qml-qt6 qml6-module-qtquick-controls qml6-module-qtquick-layouts` | -| openSUSE | `sudo zypper install qt6-declarative-tools` | +| Debian, Ubuntu, KDE neon | `sudo apt install qml-qt6 qml6-module-qtquick qml6-module-qtquick-controls qml6-module-qtquick-layouts qml6-module-qtquick-templates qml6-module-qtquick-window qml6-module-qtqml-workerscript qml6-module-qtcore qml6-module-qt-labs-settings` | +| openSUSE | `sudo zypper install qt6-declarative-tools qt6-declarative-imports` | + +Plasma has most of this already; other desktops usually have none of it. Debian and Ubuntu split Qt into a package for each part, which is why their line is long. If you're not sure what your system has, ask the installer, which installs nothing with `--check`: + +```sh +Linux/install.sh --check +``` + +It names the parts of Qt that are missing with the command that installs them, and says whether your desktop shows app icons in its notification area. After a normal install it says the same when the window couldn't open yet. **For Tokenmeter's icon in the task bar,** also install CMake and a C++ compiler (`cmake gcc-c++` on Fedora, `cmake gcc` on Arch, `cmake g++ qt6-declarative-dev qt6-base-dev` on Debian and Ubuntu). `install.sh` then compiles a small Qt window that names itself after Tokenmeter's menu entry. Without them the window opens with Qt's `qml` tool, which works the same but shows a generic icon in the task bar. @@ -96,6 +104,17 @@ Or take the service package from [Releases](https://github.com/tokenmeter1/Token It keeps running after you log out, and other machines can read it right away (`--local-only` keeps it to itself). Then add the machine on the **Mesh** page of your Mac or desktop, or run `tokenmeter join
` on it and allow it there (see [The mesh](Mesh.md)). Release downloads come for `x86_64` and `aarch64`. A machine that already runs Tokenmeter can also do all of this for you over SSH: see [Installing on another machine](Mesh.md#installing-on-another-machine). +## Other desktops (GNOME, Xfce, Cinnamon and the rest) + +Tokenmeter is built on Plasma, but only the widget belongs to it. The service, the window and the notification area icon are plain Qt, so they run on other desktops with the packages above. + +- **The window** looks the same everywhere: it brings its own colours and controls. +- **The notification area icon** takes the widget's place. Xfce, Cinnamon, MATE, LXQt, Budgie and COSMIC show it once their panel has a tray (most do from the start). **GNOME** shows app icons in its top bar only with the *AppIndicator and KStatusNotifierItem Support* extension: Ubuntu has it switched on, while on Fedora, Debian and Arch you install `gnome-shell-extension-appindicator`, log out and in, and switch it on in the Extensions app. Then run `tokenmeter-app --tray`. The installer tells you when nothing shows the icon yet. +- **The Plasma widget** is not installed where there is no Plasma. +- **Alerts** arrive as the desktop's own notifications through `notify-send`. + +How far this has been tried: on Ubuntu 24.04 without Plasma, every page of the window opens with the packages above and Qt has no complaints. On a real GNOME, Xfce or COSMIC session nothing has been tried yet, so if something looks wrong there, [open an issue](https://github.com/tokenmeter1/Tokenmeter/issues) with what `Linux/install.sh --check` says. + ## After installing - **Open the app** from the application menu, or run `tokenmeter-app`. diff --git a/scripts/check.sh b/scripts/check.sh index 13ec55ba..00ac3bf8 100755 --- a/scripts/check.sh +++ b/scripts/check.sh @@ -29,7 +29,7 @@ project_dir=$(cd "$(dirname "$0")/.." && pwd) cd "$project_dir" # The service tests, in the workflow's order. `machines` reads a service this script starts for it. -service_tests="gpu machines mesh viewer phone-alerts alerts alert-channels alerts-remote targets-remote targets spend drills gizmo-guide tools mcp-proxy wait history-line history-store storage wire stream workload share bench other-engine models otlp" +service_tests="gpu machines mesh viewer phone-alerts alerts alert-channels alerts-remote targets-remote targets spend drills gizmo-guide tools mcp-proxy wait history-line history-store storage wire stream workload share bench other-engine models otlp desktops" quick_tests="wire storage history-store mesh" extra_tests="idle-budget drill-screens gizmo-screens" diff --git a/scripts/package-flatpak.sh b/scripts/package-flatpak.sh index a45e1691..d88ec2f7 100755 --- a/scripts/package-flatpak.sh +++ b/scripts/package-flatpak.sh @@ -7,7 +7,7 @@ # Needs flatpak and flatpak-builder; the KDE runtime and SDK are fetched from Flathub. set -eu project_dir=$(cd "$(dirname "$0")/.." && pwd) -version=${APP_VERSION:-0.9.11} +version=${APP_VERSION:-0.9.12} arch=$(uname -m) id=io.github.tokenmeter1.tokenmeter name="Tokenmeter-$version-linux-$arch" diff --git a/scripts/package-linux.sh b/scripts/package-linux.sh index 11b4f0d0..8457b48b 100755 --- a/scripts/package-linux.sh +++ b/scripts/package-linux.sh @@ -4,7 +4,7 @@ # and install.sh. Needs the Swift toolchain; run it on Linux. set -eu project_dir=$(cd "$(dirname "$0")/.." && pwd) -version=${APP_VERSION:-0.9.11} +version=${APP_VERSION:-0.9.12} arch=$(uname -m) name="Tokenmeter-$version-linux-$arch" diff --git a/scripts/package-service.sh b/scripts/package-service.sh index 0e100ffc..934d7e45 100755 --- a/scripts/package-service.sh +++ b/scripts/package-service.sh @@ -18,7 +18,7 @@ # On a Mac, SIGN_IDENTITY signs the program with a Developer ID; without it the program is ad-hoc signed. set -eu project_dir=$(cd "$(dirname "$0")/.." && pwd) -version=${APP_VERSION:-0.9.11} +version=${APP_VERSION:-0.9.12} case "$(uname -s)" in Darwin) os=macos ;; Linux) os=linux ;; diff --git a/scripts/package.sh b/scripts/package.sh index f1b5112b..7d86e718 100755 --- a/scripts/package.sh +++ b/scripts/package.sh @@ -16,7 +16,7 @@ set -euo pipefail project_dir=${0:A:h:h} app="$project_dir/Tokenmeter.app" dist="$project_dir/dist" -export APP_VERSION=${APP_VERSION:-0.9.11} +export APP_VERSION=${APP_VERSION:-0.9.12} identity=${SIGN_IDENTITY:-} profile=${NOTARY_PROFILE:-} From 9ced186b8c7c3b2411d2fa2c45a9aa71749c4e15 Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 1 Dec 2026 07:35:18 +0000 Subject: [PATCH 2/4] The installer the service carries for other machines, made again from Linux/install.sh Co-Authored-By: tokenmeter1 <358883051+tokenmeter1@users.noreply.github.com> Co-Authored-By: Claude Fable 5.2 Claude-Session: https://claude.ai/code/session_01EE8zW9xXDFNPa2ueA83i2x --- App/ServiceInstallerSources.swift | 151 ++++++++++++++++++++++++++++-- 1 file changed, 145 insertions(+), 6 deletions(-) diff --git a/App/ServiceInstallerSources.swift b/App/ServiceInstallerSources.swift index 0f8d212f..cfd079d0 100644 --- a/App/ServiceInstallerSources.swift +++ b/App/ServiceInstallerSources.swift @@ -13,6 +13,8 @@ enum ServiceInstallerSources { # Linux/install.sh --service-only only the service, for a machine without a desktop (a DGX Spark, a server): # it keeps running after you log out, and other machines' Tokenmeter can read it # Linux/install.sh --uninstall remove everything but the usage history +# Linux/install.sh --check install nothing: say what this desktop has for the window, the notification +# area icon, the widget and alerts, and which packages bring what is missing # # With --service-only, --local-only keeps the service to this machine (other machines can't read it). # @@ -54,15 +56,140 @@ service_only="" # Not $share, which is the data folder above: --service-only lets other machines read the service unless --local-only. let_others_read=yes uninstall="" +check="" for argument in "$@"; do case "$argument" in --uninstall) uninstall=yes ;; + --check) check=yes ;; --service-only|--headless) service_only=yes ;; --local-only) let_others_read="" ;; - *) echo "Unknown option $argument. Use --service-only, --local-only or --uninstall." >&2; exit 2 ;; + *) echo "Unknown option $argument. Use --service-only, --local-only, --check or --uninstall." >&2; exit 2 ;; esac done +# What the window needs of Qt 6, whatever the desktop (Plasma brings all of it; GNOME, Xfce and others bring little +# or none). Debian and Ubuntu split Qt's QML modules into a package each, so a missing one is named by its package. +# Sets $qml_tool (Qt's `qml` program, empty when there is none), $qml_folder (where Qt keeps its QML modules, empty +# when it can't be found) and $qt_missing (the modules that aren't there, by their import names). +# TOKENMETER_QML_FOLDER names the folder when Qt is somewhere this script does not look. +qt_modules="QtQuick QtQuick.Controls QtQuick.Layouts QtQuick.Templates QtQuick.Window QtQml.WorkerScript QtCore" +look_at_qt() { + qml_tool="" + for candidate in qml6 qml-qt6 /usr/lib/qt6/bin/qml /usr/lib64/qt6/bin/qml; do + if have "$candidate"; then qml_tool=$candidate; break; fi + done + qml_folder="" + asked="" + for tool in qtpaths6 qtpaths-qt6 /usr/lib/qt6/bin/qtpaths /usr/lib64/qt6/bin/qtpaths; do + if have "$tool"; then asked=$("$tool" --query QT_INSTALL_QML 2>/dev/null || true); break; fi + done + for folder in "${TOKENMETER_QML_FOLDER:-}" "$asked" /usr/lib/*/qt6/qml /usr/lib64/qt6/qml /usr/lib/qt6/qml; do + if [ -n "$folder" ] && [ -d "$folder" ]; then qml_folder=$folder; break; fi + done + qt_missing="" + if [ -z "$qml_folder" ]; then + # No folder of modules anywhere: with no `qml` tool either, Qt's QML isn't installed at all. + [ -n "$qml_tool" ] || qt_missing=$qt_modules + return 0 + fi + for module in $qt_modules; do + [ -f "$qml_folder/$(echo "$module" | tr . /)/qmldir" ] || qt_missing="$qt_missing $module" + done + # Settings moved into QtCore with Qt 6.5; an older Qt has them in Qt.labs.settings. + if [ -f "$qml_folder/QtCore/plugins.qmltypes" ] && ! grep -qs Settings "$qml_folder/QtCore/plugins.qmltypes" \ + && [ ! -f "$qml_folder/Qt/labs/settings/qmldir" ]; then + qt_missing="$qt_missing Qt.labs.settings" + fi + qt_missing=${qt_missing# } +} + +# The command that installs what `look_at_qt` found missing, for this distribution's package manager; empty when +# nothing is missing or the package manager is one this script does not know. +qt_install_line() { + [ -n "$qt_missing" ] || [ -z "$qml_tool" ] || return 0 + if have apt-get; then + packages="" + [ -n "$qml_tool" ] || packages="qml-qt6" + for module in $qt_missing; do + case "$module" in + Qt.labs.settings) packages="$packages qml6-module-qt-labs-settings" ;; + *) packages="$packages qml6-module-$(echo "$module" | tr 'A-Z' 'a-z' | sed 's/\./-/')" ;; + esac + done + echo "sudo apt install${packages:+ }${packages# }" + elif have dnf; then echo "sudo dnf install qt6-qtdeclarative-devel" + elif have pacman; then echo "sudo pacman -S --needed qt6-declarative" + elif have zypper; then echo "sudo zypper install qt6-declarative-tools qt6-declarative-imports" + fi +} + +# Whether this session has a notification area that shows app icons (a StatusNotifierItem host): "yes", "no", or +# "unknown" when there is no session to ask (an install over SSH). Plasma, Xfce, Cinnamon, MATE, LXQt and COSMIC +# have one; GNOME has one only with the AppIndicator extension, which Ubuntu switches on and Fedora does not. +tray_host() { + if [ -z "${DBUS_SESSION_BUS_ADDRESS:-}" ] && [ ! -S "${XDG_RUNTIME_DIR:-/nonexistent}/bus" ]; then echo unknown; return 0; fi + if have gdbus; then + answer=$(gdbus call --session --dest org.freedesktop.DBus --object-path /org/freedesktop/DBus \ + --method org.freedesktop.DBus.NameHasOwner org.kde.StatusNotifierWatcher 2>/dev/null || true) + elif have dbus-send; then + answer=$(dbus-send --session --print-reply --dest=org.freedesktop.DBus /org/freedesktop/DBus \ + org.freedesktop.DBus.NameHasOwner string:org.kde.StatusNotifierWatcher 2>/dev/null || true) + else + echo unknown; return 0 + fi + case "$answer" in *true*) echo yes ;; *false*) echo no ;; *) echo unknown ;; esac +} + +# What to do about a desktop with no notification area for app icons, by the desktop's own name. +tray_advice() { + case "${XDG_CURRENT_DESKTOP:-}" in + *GNOME*|*gnome*) + echo "GNOME shows app icons in its top bar only with the \"AppIndicator and KStatusNotifierItem Support\" extension." + if have dnf; then echo " Install it with: sudo dnf install gnome-shell-extension-appindicator" + elif have pacman; then echo " Install it with: sudo pacman -S --needed gnome-shell-extension-appindicator" + elif have apt-get; then echo " Install it with: sudo apt install gnome-shell-extension-appindicator" + elif have zypper; then echo " Install it from https://extensions.gnome.org/extension/615/appindicator-support/" + fi + echo " Then log out and in, switch it on in the Extensions app, and run: tokenmeter-app --tray" ;; + *) + echo "This desktop has no notification area that shows app icons (a StatusNotifierItem tray). Add one to a panel," + echo " then run: tokenmeter-app --tray" ;; + esac +} + +if [ -n "$check" ]; then + look_at_qt + wrong=0 + echo "Tokenmeter on this desktop (${XDG_CURRENT_DESKTOP:-no desktop named}):" + if [ -z "$qt_missing" ] && [ -n "$qml_folder" ]; then + echo " The window: Qt 6 has what it needs ($qml_folder)." + elif [ -z "$qt_missing" ]; then + echo " The window: Qt's qml tool is here ($qml_tool), but not where Qt keeps its modules, so they weren't checked." + else + wrong=1 + echo " The window: these parts of Qt 6 are missing: $(echo "$qt_missing" | sed 's/ /, /g')." + line=$(qt_install_line); [ -z "$line" ] || echo " $line" + fi + if [ -z "$qml_tool" ] && [ -z "$qt_missing" ]; then + echo " Qt's qml tool is not here; the window then has to be compiled (CMake, a C++ compiler, Qt 6's development files)." + fi + if have cmake && { have c++ || have g++ || have clang++; }; then + echo " The notification area icon: CMake and a C++ compiler are here, so install.sh compiles it." + else + echo " The notification area icon: needs CMake, a C++ compiler and Qt 6's development files to be compiled." + fi + case "$(tray_host)" in + yes) echo " This desktop shows app icons in its notification area." ;; + no) wrong=1; echo " $(tray_advice)" ;; + *) echo " No desktop session to ask whether it shows app icons (run this from a terminal on the desktop)." ;; + esac + if have kpackagetool6; then echo " The widget: Plasma 6 is here." + else echo " The widget: is for Plasma 6 only; on other desktops the notification area icon takes its place."; fi + if have notify-send; then echo " Alerts: notify-send is here." + else echo " Alerts: need notify-send (libnotify on Fedora and Arch, libnotify-bin on Debian and Ubuntu)."; fi + exit $wrong +fi + # The service package (scripts/package-service.sh) carries no app, so from there only the service is installed. if [ -x "$here/tokenmeter" ] && [ ! -d "$here/kde" ]; then service_only=yes; fi @@ -204,9 +331,12 @@ for qml in qml6 qml-qt6 /usr/lib/qt6/bin/qml /usr/lib64/qt6/bin/qml; do exec "\$qml" "$share/tokenmeter-kde/app/main.qml" -- "\$@" fi done -message="Tokenmeter needs Qt 6's QML runtime. Install qt6-declarative (Arch), qml-qt6 (Debian, Ubuntu, KDE neon), qt6-qtdeclarative-devel (Fedora) or qt6-declarative-tools (openSUSE)." +message="Tokenmeter needs Qt 6's QML runtime. Linux/install.sh --check says which packages bring it on this system." echo "\$message" >&2 -command -v kdialog >/dev/null 2>&1 && kdialog --title Tokenmeter --error "\$message" +if command -v kdialog >/dev/null 2>&1; then kdialog --title Tokenmeter --error "\$message" +elif command -v zenity >/dev/null 2>&1; then zenity --error --title Tokenmeter --text "\$message" +elif command -v notify-send >/dev/null 2>&1; then notify-send Tokenmeter "\$message" +fi exit 1 LAUNCHER chmod 755 "$bin/tokenmeter-app" @@ -225,7 +355,7 @@ else fi # The Plasma widget, with its own copy of the shared pages. -widget="No Plasma 6 found (kpackagetool6), so the tray widget was not installed." +widget="The widget is for Plasma 6, which is not here (no kpackagetool6); the notification area icon takes its place." if have kpackagetool6; then package=$(mktemp -d) cp -R "$here/kde/plasmoid/." "$package/" @@ -251,7 +381,7 @@ fi # The icon in the notification area, from the compiled window: started at login (unless it was turned off from # its menu, which leaves the entry with Hidden=true) and now. -tray="The notification area icon needs the compiled window (see below)." +tray="The notification area icon needs the compiled window (see above)." pkill -f "tokenmeter-window --tray" 2>/dev/null || true if [ -n "$window" ]; then autostart="$config/autostart/tokenmeter-tray.desktop" @@ -272,6 +402,8 @@ AUTOSTART tray="The notification area icon is turned off; start it with: tokenmeter-app --tray (then tick Show Icon at Login in its menu)." else tray="Tokenmeter's icon is in the notification area and comes back at login (untick Show Icon at Login in its menu to stop that)." + # A desktop that shows no app icons (GNOME without its extension) is told so, rather than promised an icon. + if [ "$(tray_host)" = no ]; then tray="Tokenmeter's icon is set to start at login, but nothing shows it yet. $(tray_advice)"; fi if [ -n "${WAYLAND_DISPLAY:-}${DISPLAY:-}" ]; then nohup "$bin/tokenmeter-app" --tray >/dev/null 2>&1 & fi @@ -281,7 +413,14 @@ fi echo echo "Tokenmeter is installed." echo " $started" -echo " Open the app from the menu, or run: tokenmeter-app" +look_at_qt +if [ -n "$qt_missing" ]; then + echo " The window will NOT open yet: these parts of Qt 6 are missing: $(echo "$qt_missing" | sed 's/ /, /g')." + line=$(qt_install_line); [ -z "$line" ] || echo " $line" + echo " After that, open the app from the menu, or run: tokenmeter-app" +else + echo " Open the app from the menu, or run: tokenmeter-app" +fi if [ -n "${window_failed:-}" ]; then # The tools are there but the window didn't compile: said loudly, since the app still opens (with Qt's qml tool) # and only its icon in the task bar and title bar is missing. From d738ac9af348fa089b40b986b3f715baf7b8d9cc Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 1 Dec 2026 07:59:48 +0000 Subject: [PATCH 3/4] Workflow: the browser walks get Node in the linux job's container The step never ran: until now an earlier step of the job failed first (Linux/tests/wait.sh, fixed in #150), and the container the job runs in has no npm. Co-Authored-By: tokenmeter1 <358883051+tokenmeter1@users.noreply.github.com> Co-Authored-By: Claude Fable 5.2 Claude-Session: https://claude.ai/code/session_01EE8zW9xXDFNPa2ueA83i2x --- .github/workflows/build.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 589410ba..f80d706a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -376,6 +376,8 @@ jobs: # The same in the web dashboard (/view/): pairs a browser, taps every building and machine of each drill's # Machine Room, opens its session, checks every figure is offered to pin, then pins a proof and solves it. run: | + # The job's container has Swift but no Node. + command -v npm >/dev/null || DEBIAN_FRONTEND=noninteractive apt-get install -y -qq nodejs npm > /dev/null mkdir -p /tmp/pw && (cd /tmp/pw && npm install --silent playwright@1.48.2 && npx playwright install --with-deps chromium >/dev/null) mkdir -p /tmp/drill-web env HOME=/tmp/drill-web TOKENMETER_NAME=drills .build/release/tokenmeter serve --port 7799 >/tmp/drill-web/service.log 2>&1 & From 33ecd88e878dc561ab91dd838d4933c7d37af4e8 Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 1 Dec 2026 08:00:31 +0000 Subject: [PATCH 4/4] Tests: desktops.sh gives the same answer on a machine without Qt Co-Authored-By: tokenmeter1 <358883051+tokenmeter1@users.noreply.github.com> Co-Authored-By: Claude Fable 5.2 Claude-Session: https://claude.ai/code/session_01EE8zW9xXDFNPa2ueA83i2x --- Linux/tests/desktops.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Linux/tests/desktops.sh b/Linux/tests/desktops.sh index 890701c3..d8acc681 100644 --- a/Linux/tests/desktops.sh +++ b/Linux/tests/desktops.sh @@ -16,6 +16,8 @@ fail() { echo "FAILED: $1" >&2; [ -f "$work/said.txt" ] && sed 's/^/ /' "$wor tools=$work/bin mkdir -p "$tools" for tool in sh dirname tr sed grep cat; do ln -s "$(command -v $tool)" "$tools/$tool"; done +# Qt's qml tool is a stand-in too, so the answer is the same whether or not this machine has Qt. +printf '#!/bin/sh\nexit 0\n' > "$tools/qml6"; chmod 755 "$tools/qml6" manager() { # the one package manager this "system" has rm -f "$tools/apt-get" "$tools/dnf" "$tools/pacman" "$tools/zypper" printf '#!/bin/sh\nexit 0\n' > "$tools/$1"; chmod 755 "$tools/$1"