Programmable buttons in the menu bar panel #21

Merged
erdoar merged 3 commits from claude/menu-bar-buttons into main 2026-10-10 16:58:54 +00:00
erdoar commented 2026-10-10 16:27:01 +00:00 (Migrated from github.com)

Stacked on #20 (web page); merge that first.

Anyone can add their own buttons to the menu bar panel and set them up in Plug > Settings… (⌘,) or Edit Buttons… in the panel.

What a button can do

  • Plug control: Start or Stop, Start, Stop, recall a preset, set the master level (or mute), bypass an effect by name.
  • Send MIDI: a control change, note (on, then off 150 ms later) or program change, on any channel, to one named MIDI output or all of them.
  • Run command: zsh from the home folder, as a login shell.
  • Run shortcut: shortcuts run <name>.
  • Open: a web address, file, folder or app.
  • Ask Claude: claude -p <prompt> with the person's own Claude Code sign-in. Plug stores no key. It looks in the usual install folders and falls back to the login shell's PATH.

How it works

  • Output window: what a command printed, or Claude's reply, can open in a window with a Copy button. This is on by default for Claude.
  • Errors: failures always open the window. If Claude Code isn't installed, the window says so.
  • Stopping: clicking a running button stops it. It shows a spinner while it runs.
  • Prompts and names are safe: they are passed as process arguments, never pasted into command text, so quotes or ; in a prompt can't run anything.
  • Storage: buttons are saved in ~/Library/Application Support/Plug/buttons.json, separate from presets. A button the app can't read is skipped, and the rest still load.

Files

  • PlugCore/QuickButtons.swift: the format, MIDI words and process arguments.
  • PlugEngine/MIDIOutput.swift: sends MIDI.
  • Plug/QuickButtonsModel.swift: runs the buttons.
  • Plug/ButtonOutputWindows.swift: the result window.
  • Plug/UI/ButtonsSettings.swift: the config panel.
  • The menu bar panel shows the buttons in a two-column grid.
  • MANUAL.md, manual.html, README and the home page all mention buttons.
  • CLAUDE.md now says to give the Mac build steps after every push.

Tested

  • swift test on Linux: 46 tests pass, 8 of them new. They cover a round trip of every kind, lenient loading, the MIDI words, clamping, arguments and validation.
  • On the owner's Mac mini (M4): swift test and scripts/bundle.sh work.
  • An Ask Claude button replied, using Claude Code 2.1.296 installed in ~/.local/bin.
  • Plug controls, MIDI, command, shortcut and open buttons have not been tried on the Mac yet.

🤖 Generated with Claude Code

https://claude.ai/code/session_011C96TJ2L7nzVMFTH7raNu5

Stacked on #20 (web page); merge that first. Anyone can add their own buttons to the menu bar panel and set them up in **Plug > Settings…** (⌘,) or **Edit Buttons…** in the panel. **What a button can do** - **Plug control:** Start or Stop, Start, Stop, recall a preset, set the master level (or mute), bypass an effect by name. - **Send MIDI:** a control change, note (on, then off 150 ms later) or program change, on any channel, to one named MIDI output or all of them. - **Run command:** zsh from the home folder, as a login shell. - **Run shortcut:** `shortcuts run <name>`. - **Open:** a web address, file, folder or app. - **Ask Claude:** `claude -p <prompt>` with the person's own Claude Code sign-in. Plug stores no key. It looks in the usual install folders and falls back to the login shell's PATH. **How it works** - **Output window:** what a command printed, or Claude's reply, can open in a window with a Copy button. This is on by default for Claude. - **Errors:** failures always open the window. If Claude Code isn't installed, the window says so. - **Stopping:** clicking a running button stops it. It shows a spinner while it runs. - **Prompts and names are safe:** they are passed as process arguments, never pasted into command text, so quotes or `;` in a prompt can't run anything. - **Storage:** buttons are saved in `~/Library/Application Support/Plug/buttons.json`, separate from presets. A button the app can't read is skipped, and the rest still load. **Files** - `PlugCore/QuickButtons.swift`: the format, MIDI words and process arguments. - `PlugEngine/MIDIOutput.swift`: sends MIDI. - `Plug/QuickButtonsModel.swift`: runs the buttons. - `Plug/ButtonOutputWindows.swift`: the result window. - `Plug/UI/ButtonsSettings.swift`: the config panel. - The menu bar panel shows the buttons in a two-column grid. - MANUAL.md, manual.html, README and the home page all mention buttons. - CLAUDE.md now says to give the Mac build steps after every push. **Tested** - `swift test` on Linux: 46 tests pass, 8 of them new. They cover a round trip of every kind, lenient loading, the MIDI words, clamping, arguments and validation. - On the owner's Mac mini (M4): `swift test` and `scripts/bundle.sh` work. - An Ask Claude button replied, using Claude Code 2.1.296 installed in `~/.local/bin`. - Plug controls, MIDI, command, shortcut and open buttons have not been tried on the Mac yet. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_011C96TJ2L7nzVMFTH7raNu5
Sign in to join this conversation.
No description provided.