Skip to content

hammunition-tray

KDE Plasma tray switches for parking and waking radio devices — the Hammunition family's own

  • Version recorded: 0.5.0
  • Categories: device-support
  • Upstream: https://github.com/Renegade-Penguin/hammunition-tray
  • Needs first: plasma-workspace, qml6-module-org-kde-plasma-plasma5support, qml6-module-org-kde-kirigami, qml6-module-org-kde-notifications, pkexec
  • Desktops: KDE Plasma only — read from the session files at plan time; deferred from a profile on a machine with none of them, refused by name (see desktops); elsewhere, hammunition-tray-qt

What it does

A KDE Plasma applet that puts a switch in the system tray for each catalogued device Hammunition can park that is plugged in -- a GPS receiver, a cellular modem, a Bluetooth controller or a camera. Turning a switch off detaches the device so the kernel drops it and its port can suspend; turning it on brings it back. Beside the devices it has a Services group (the GPS daemon, the clock, the GPS tether, the rig service: a running switch and a start-at-login box each) and a Radios group (mobile broadband, Wi-Fi, Bluetooth), the Controls panel. The tray icon is a penguin holding a handheld radio, and goes grey while anything is parked. A Time section (D-058, needs Hammunition 0.18.0 or later) shows what the clock follows and lets you choose one of the four GPS-time modes.

Why you would want it

Parking a GPS or a modem you are not using saves battery on a field laptop, and doing it from the tray is one click and one password prompt rather than a command line. It is a front end for hammunition hardware park and wake and hammunition services (D-056), so it does exactly what those do and nothing else; docs/guides/tray-controls.md says which switch asks for a password.

Before it will work

KDE Plasma 6. This unit installs the device helper and the polkit action the switches call (from the same release archive, D-056); the device and service lists it reads are written by hammunition hardware apply, which also hands over to this helper rather than writing its own. Without the lists the applet shows no switches; without the helper it says "Device control is not installed". A device only gets a switch when its catalog entry carries a power_control block and it is plugged in. The helper runs as root through the engine's own Python, so the engine's virtualenv must not be writable by any account but its owner: the install asks one yes that --yes cannot answer when it belongs to one account, and refuses when any account can write it.

How it installs

  • prebuilt tarball from https://github.com/Renegade-Penguin/hammunition-tray/archive/refs/tags/v0.5.0.tar.gz
  • Spreads the applet over /usr/share/plasma/plasmoids/com.chiefgyk3d.hammunition.devices and its icon into /usr/share/icons/hicolor (each file printed in the plan), and installs the device helper the switches call: the code under /usr/local/lib/hammunition-devctl, the wrapper at /usr/local/libexec/hammunition-devctl and the polkit action (the plan names the interpreter the wrapper runs as root, and says when another installer's helper is already there and is left alone). The applet runs nothing as root itself. Whether Plasma lists an applet placed this way without a .deb is unmeasured: a bench item, not yet run.

Known problems

KDE only. On a machine with no Plasma session, station defers it by name and installs the rest, and hammunition install hammunition-tray refuses, so a lightweight desktop is never handed the Plasma shell (D-060, docs/desktops.md). hammunition-tray-qt is the same switch for Xfce, LXQt, LXDE, MATE and Cinnamon; GNOME and COSMIC have none yet. Plasma keeps the old version of an applet loaded after an install or upgrade until systemctl --user restart plasma-plasmashell or a new login. A per-user copy installed from the repository's own install.sh (~/.local/share/plasma/plasmoids) shadows this system-wide one; run that repository's uninstall.sh once after switching to this package. After installing, add Hammunition Devices to the panel or set it to shown in the System Tray's settings: nothing places it for you.

Keeping it current

  • probe: github release (Renegade-Penguin/hammunition-tray)
  • strategy: reinstall
  • Tagged releases with a .deb and SHA256SUMS attached to each. A release is a new digest; re-pin both. The v0.5.0 release's .deb assets were not published when this was pinned, so the pin is the tag's own source archive.

Where to get help with the software itself

Issues on the GitHub repository. For "the switch does nothing", run hammunition hardware state first: the applet shows what that command reports.

Source: catalog/packages/hammunition-tray.yaml