tools/activity-browser: Go user-session service that sets the default browser per KDE Activity (Edge for Work, Chrome for Personal) using busctl CurrentActivityChanged plus a 30 s fallback, verifies each change and retries at login. No third-party dependencies, tests pass, ships a systemd user unit and install/rollback notes. Built and tested on arceus; the live Deck install still needs to verify its desktop IDs. config/mise: add bun, which the agent MCP wrapper in bin/mcp-wiki-remote requires.
KDE Activity browser
A small Go user-session service that selects Edge for Work and Chrome for Personal. It changes the default browser without opening windows, reading browser data, switching Activities, or touching the immutable SteamOS root. Other Activities retain the existing default.
The helper listens for KDE CurrentActivityChanged signals with busctl, queries the current Activity name and calls xdg-settings. It verifies changes and retries errors at login or after Activity Manager restarts. A 30-second fallback also handles missed signals or renamed Activities. It requires busctl, xdg-settings, and the installed browsers' desktop files.
Build and check
mise exec -- go test ./...
CGO_ENABLED=0 mise exec -- go build -trimpath -o activity-browser .
Use the existing development environment, not system packages on SteamOS. This project has no third-party Go dependencies.
Install on the Deck
First verify the actual browser desktop IDs (Flatpak defaults are com.microsoft.Edge.desktop and com.google.Chrome.desktop). Do not assume these if the browser was exported from Distrobox. Record the existing default (xdg-settings get default-web-browser) and back up the relevant user MIME/KDE configuration before installation.
Install the binary as ~/.local/bin/activity-browser, the service as ~/.config/systemd/user/activity-browser.service, then:
~/.local/bin/activity-browser --once --dry-run
systemctl --user daemon-reload
systemctl --user enable --now activity-browser.service
If necessary, override ExecStart with --work DESKTOP_ID --personal DESKTOP_ID. Browser choice depends on the Activity active when a link is opened; it does not isolate browser profiles or move existing browser windows. Apps with a hard-coded browser bypass the desktop default.
Verify both Activities manually by switching in KDE and checking xdg-settings get default-web-browser and the HTTP/HTTPS associations. Restore the original Activity after a remote test; do not unexpectedly move the user's desktop without coordinating.
Rollback
systemctl --user disable --now activity-browser.service
xdg-settings set default-web-browser ORIGINAL_DESKTOP_ID
Restore saved MIME/KDE configuration only if needed, without overwriting subsequent unrelated changes. Current delivery status: built and locally tested on arceus; live Deck installation awaits its SSH tunnel.