Repository navigation
feat(linux): add desktop launcher actions - #35
Merged
melonamin merged 2 commits intoSep 3, 2026
Merged
Conversation
melonamin
force-pushed
the
feat/linux-desktop-actions
branch
from
September 3, 2026 02:14
dc2aae7 to
ef0c871
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
The Linux packages currently install a valid freedesktop desktop entry, but it exposes only the primary
Exec=agterm-linuxlaunch. Right-clicking a pinned or running agterm icon therefore has no product actions, even though upstream macOS exposes New Session, New Window, Quick Terminal, Dashboard, Recent Sessions, and Sessions Needing Attention from its Dock menu.This PR adds the native Linux equivalent through freedesktop Desktop Entry Actions. Cinnamon 6.6 (Linux Mint 22.3), GNOME Shell/Ubuntu Dock, and KDE Plasma can render these standard actions in the launcher's context menu; launchers that ignore the optional
Actions=key keep the ordinary launch unchanged.The four static operations drive the frontmost GTK window directly. The static Recent and Attention entries open live in-app GTK palettes because the desktop-entry format cannot publish dynamic session identities or nested runtime submenus.
Cause
packaging/linux/io.github.melonamin.agterm.desktophad noActions=key or[Desktop Action …]groups. The LinuxGApplicationalso used onlyG_APPLICATION_HANDLES_OPEN, so an action implemented asExec=agterm-linux --desktop-action=…had no path to forward that argument from a short-lived secondary process into the live primary instance.The personal installer had a related packaging trap: its broad
sedreplacement rewrote every futureExec=line to the bare absolute binary path, which would silently remove every action argument.Minimal reproduction
scripts/install-linux.sh.Expected (native Linux parity): launcher entries for New Session, New Window, Quick Terminal, Dashboard, Recent Sessions, and Sessions Needing Attention. Actual before this PR: only shell-owned generic items such as pin/unpin and close are present because agterm declares no actions.
Change
Commit
feat(linux): add desktop launcher actions:packaging/linux/io.github.melonamin.agterm.desktop— declares six standard Desktop Entry Actions with packaged symbolic icons and explicit--desktop-action=…arguments.Sources/AgtermLinux/LinuxDesktopActions.swift— adds the pure action catalog and command-line classifier. Ordinary activation, multiple path opens, and---escaped paths retain their existing shapes; unknown or mixed action invocations fail closed.Sources/AgtermLinux/App.swift— enablesG_APPLICATION_HANDLES_COMMAND_LINE, forwards every cold/warm invocation to the primary instance, reusesg_application_activate()/g_application_open()for the existing lifecycle, and routes actions to the frontmostAppController.Sources/AgtermLinux/Palette.swift— adds a live MRU palette for the static Recent Sessions launcher entry. Attention reuses the existing ranked attention palette.scripts/install-linux.sh— rewrites every installed launcherExec=to the absolute personal binary while preserving its action arguments.Tests/AgtermLinuxTests/LinuxDesktopActionsTests.swift— covers all action arguments, ordinary activation/path opening, escaped leading-dash paths, and invalid/mixed invocations.tests/atspi_desktop_actions.py+tests/atspi_smoke.py— parse the packaged desktop entry through GIO and exercise cold New Session plus warm Quick Terminal, Dashboard, Recent, Attention, and New Window delivery against the real single-instance GTK app.README.md— documents launcher support, dynamic-palette adaptation, and the fallback for launchers that ignore actions.Scope note
Linux launcher integration only. No shared
agtermCorebehavior, persisted model, keymap syntax, notification policy, terminal protocol, or macOS target changes.Desktop Entry Actions are intentionally static. This PR does not add Cinnamon/GNOME/KDE-specific extensions for dynamic nested menus; Recent and Attention resolve current state only after entering the app, which keeps the downstream delta portable and reviewable.
Keep-in-sync
Control API exempt: every underlying capability already has its existing GUI/control path (
session new,window new,quick,dashboard, tree/status read-back). This PR adds an OS launcher adapter, not a new mutable product capability. Recent and Attention are interactive selection surfaces, matching the existing popover/palette exemption.The keymap format and window/workspace/session/pane model are unchanged, so the bundled agent skill command catalog needs no update.
README.mdis updated for the new user-facing launcher surface;CHANGELOG.mdremains release-only and is intentionally unchanged.Testing
All verification ran inside a purpose-built
swift:6.3.2-nobleDocker image with the CI GTK4/libadwaita, software GL, AT-SPI, Xvfb/Openbox, desktop-file-utils, Zig 0.16.0, and SwiftLint 0.65.0 dependencies. The main checkout and feature worktree were mounted at their original absolute paths so the worktree.gitpointer remained valid.swift test --filter LinuxDesktopActionsTests: 3 tests / 1 suite passed.AGTERM_ATSPI_SCENARIO=desktop-actions scripts/test-linux-ui.sh: GIO desktop-entry parse plus cold/warm action routing passed.agtermCorewith CI-like 4-CPU parallelism: 2570 tests / 97 suites passed; the OpenCode plugin suite remained dependency-skipped because the CI image has no qualifying Node.js.swiftlint lint --strict --quiet— clean.swift buildandswift build -c releaseinagterm-linux— succeeded.desktop-actionsscenario — PASS.scripts/check-linux-core-boundary.sh,scripts/check-linux-cli-drift.sh,scripts/test-linux-architecture.sh,scripts/test-linux-resources.sh,scripts/test-published-linux-release.sh, andscripts/verify-linux-vendor-cache.sh— passed.scripts/stage-linux.sh— staged the release payload successfully.desktop-file-validate— passed for the source entry, staged package entry, and simulated personal-install entry.Exec=plus all 6 absolute-path--desktop-action=…arguments.git diff --checkandgit diff --check upstream/linux-port...HEAD— clean.Files (9)
README.mdagterm-linux/Sources/AgtermLinux/App.swiftagterm-linux/Sources/AgtermLinux/LinuxDesktopActions.swiftagterm-linux/Sources/AgtermLinux/Palette.swiftagterm-linux/Tests/AgtermLinuxTests/LinuxDesktopActionsTests.swiftagterm-linux/tests/atspi_desktop_actions.pyagterm-linux/tests/atspi_smoke.pypackaging/linux/io.github.melonamin.agterm.desktopscripts/install-linux.sh