Skip to content
Open
300 changes: 298 additions & 2 deletions Backend.qml

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ Works:
- **Ctrl+P** opens the root dropdown (All / Applications / Commands); emacs Ctrl+P = up only works inside popups.
- **Ctrl+T** opens the toast's actions (Copy Error Message on failures, Undo after Disable Command). **Ctrl+Shift+K** opens the About panel for the selected row.
- **Argument pills:** "Search Google" / "Search DuckDuckGo" take a query in a pill after the search text (Tab in, Shift+Tab out).
- **Alerts:** Shut Down, Restart, Log Out and Delete All Entries ask first (↵ confirms, Esc cancels). `omacast run` skips the alert.
- **Alerts:** Shut Down, Restart, Log Out, Delete All Entries and Delete Quicklink ask first (↵ confirms, Esc cancels). `omacast run` skips the alert.
- **Feedback:** toasts in the footer and a HUD through Omarchy's OSD when the window closes; static footer "Loading…" appears only after 500 ms of visible loading, yields to toasts and resets on hide. The header divider stays still.
- **Window behaviour:**
- The `escapeKeyBehavior` setting works both ways.
Expand All @@ -158,6 +158,7 @@ Works:
- **Clipboard History** (Phase 3, SPEC §5.3/§8.2, `core/ClipboardHistory.js`, `builtin:clipboard-history`, global shortcut `omacast:clipboard`): `services/ClipboardWatcher.qml` runs one `wl-paste --watch` whose constant bash script skips `CLIPBOARD_STATE != data` and `x-kde-passwordManagerHint`, prefers an `image/*` offer, keeps `text/uri-list` for `file://` copies, and prints one JSON line per copy. Images and text ≥ 30,720 bytes go to `~/.local/share/omacast/clipboard/` by MD5; short text travels in the JSON line. The backend adds the source (`ToplevelManager.activeToplevel` + `DesktopEntries.heuristicLookup`), drops disabled apps (`clipboardDisabledApplications`), dedups by hash (copy count, last copied), and prunes by `clipboardHistoryDuration` (default `P1W`, pins kept) plus a 1000-unpinned cap [D], deleting orphaned files. The first line after the watcher starts is skipped if already known, and our own writes from the history (5 s hash window) don't count as copies. UI: 40/60 list/detail (`ui/DetailPane.qml`: text, image or colour swatch, then Information rows), sections Pinned/Today/Yesterday/Earlier [I], type dropdown on Ctrl+P. Actions: Paste (↵, via `ClipboardWriter.copyFile` for files), Copy (Ctrl+↵), Open link/file (Ctrl+O), Pin (Ctrl+Shift+P), Delete (Ctrl+D), Delete All unpinned (Ctrl+Shift+D, confirmed). RPC: `clipboard.getAll|getDetail|copy|paste|pin|unpin|delete|deleteAll`. Not done: OCR, Paste Sequentially, rich-text representations (only plain text, URI lists and one image type are kept), edit/rename, Save as Snippet, moving pins, image dimensions. `omacast:clipboard` toggles: a second press closes the view.
- **Switch Theme** (`builtin:switch-theme`, `core/Themes.js`, `services/ThemeSource.qml`; Raycast's command name, Omarchy's themes [D]): the list is Omarchy's own picker rows (`omarchy-theme-switcher --print-rows`, "<preview>\t<thumbnail>", ~40 ms), reloaded on each push; the current theme is the watched `~/.local/state/omarchy/current/theme.name`. List/detail layout with the preview image (a video preview falls back to its thumbnail), opens on the current theme, ↵ runs `omarchy-theme-set <slug>`. Rows have no icon (`iconless` in ResultRow). BUILTINS `supersedes: ["omarchy:appearance.theme"]` drops Omarchy's theme picker from the candidates. Global shortcut `omacast:theme` toggles it (README shows binding it to Super+Ctrl+T in place of Omarchy's theme menu). RPC: `themes.getAll|getDetail`. Not done: live preview while moving through the list, palette swatches.
- **Script Commands** (SPEC §9.9, `core/ScriptCommands.js`): `services/ScriptCommandSource.qml` scans `~/.config/omacast/script-commands` on every open (executable, ≤ 2 MB, no `.template.`, first 60 lines), and `services/ScriptRunner.qml` runs each one under `bash -lc` from its `currentDirectoryPath`. Text, password and dropdown arguments are pills (`←`/`→` cycle a dropdown). `silent` closes and shows a HUD with the last output line; `compact` shows "Running…" then a toast (a HUD if the window closed). `needsConfirmation` uses the alert. Not yet: the `fullOutput` output view and `inline` refresh (both run as `compact`), image icons (emoji only), a settings list of folders, Create/Reload commands.
- **Quicklinks** (SPEC §8.4): Create / Search / Import / Export Quicklinks, Create Quicklink or Open in Browser for a typed web address, arguments in the same pills as the web searches (Tab into them, ↑/↓ steps an option, ↵ opens), Create Quicklink filled from a URL or path on the clipboard, Open With from installed apps, and Edit (Ctrl+E), Copy Link (Ctrl+Shift+C) and Delete (Ctrl+D, the Linux key in SPEC §10.3, confirmed through the alert) actions. Placeholders follow SPEC §8.3 except clipboard history, snippets and the calculator.
- **Latency:** show → mapped in 59–66 ms, hide in 24–42 ms on Omarchy 4.0.6 (`tests/smoke.sh`; it was 37–44 ms on the old `OverlayWindow`).
- **Tests:** root search, calculator and privacy coverage (`node --test tests/*.test.js`).

Expand Down
4 changes: 4 additions & 0 deletions Launcher.qml
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,10 @@ Item {
root.show()
launcher.popToRoot()
launcher.push(outcome.push)
} else if (outcome.arguments) {
root.show()
launcher.popToRoot()
launcher.promptArguments(outcome.arguments)
} else if (outcome.close) {
root.hide()
if (outcome.hud) launcher.hud(outcome.hud)
Expand Down
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -226,9 +226,10 @@ monitor-input-cycle "$1" && echo "Switching display"
| `Ctrl+↑` / `Ctrl+↓` | Jump between sections |
| `↑` on an empty search | Search history |
| `Ctrl+P` | Filter dropdown (All / Applications / Commands; types in Clipboard History) |
| `Tab` / `Shift+Tab` | Into and out of an argument pill |
| `Tab` / `Shift+Tab` | Into and out of an argument pill, and between a quicklink's arguments |
| `Ctrl+Shift+F` | Add to or remove from favorites (`Ctrl+Alt+↑↓` to reorder) |
| `Ctrl+Shift+C` | Copy (the command, desktop id, answer or name) |
| `Ctrl+E` / `Ctrl+D` | Edit / delete a quicklink |
| `Alt+Shift+D` | Disable a command |
| `Ctrl+T` | Actions for the current toast (Undo, Copy Error Message) |
| `Ctrl+Shift+K` | About the selected result |
Expand Down Expand Up @@ -349,6 +350,7 @@ Done:
- [x] Emoji & Symbols
- [x] Switch Theme
- [x] Script Commands (arguments, confirmation)
- [x] Quicklinks

Next:

Expand All @@ -358,7 +360,6 @@ Next:

Later:

- [ ] Quicklinks
- [ ] Snippets and text expansion
- [ ] Running Raycast extensions built from the open-source [`raycast/extensions`](https://github.com/raycast/extensions) repo
- [ ] Window management and a window switcher
Expand Down
3 changes: 2 additions & 1 deletion SPEC.md
Original file line number Diff line number Diff line change
Expand Up @@ -520,6 +520,7 @@ Grammar: `{keyword opt="v" opt2='v' | modifier | modifier}`. Quotes accepted: `"
- Shown in root search with inline argument pills. Can be a fallback command.
- Settings: Show Link Previews, Pass Selected Text as Argument.
- **Import/Export** JSON: `[{name, link, openWith?}]` [I, keep compatible with Raycast's documented format].
- Quickshell build [D, 2026-10-20]: `db/quicklinks.json`, `core/Quicklinks.js`. Arguments use the same argument pills as the web-search builtins (§12 Phase 1 leftovers): a quicklink candidate's `arguments` carry `{name, placeholder, required}` plus `defaultValue` and `options`; an argument with a default is optional and shows the default as its placeholder; an option argument steps through its options with ↑/↓ [D]. Delete Quicklink goes through the confirm alert. Web links open through `omarchy-launch-browser`, other links through `xdg-open`, a chosen app through `gtk-launch`. Create Quicklink fills an untouched form from a URL or path on the clipboard. localhost, loopback and private IPv4 hosts open as http. Values in a file-path link (`/…`, `~/…`) are not encoded. `{selection}` is the primary selection. `{clipboard offset=N}` waits for clipboard history; `{browser-tab}` is refused. No favicons, tags or link previews yet. Export writes `~/Downloads/omacast-quicklinks-<date>.json` and copies it; import reads a file path or the clipboard.

### 8.5 Window management maths [O command list, I geometry]
- Work area = monitor geometry minus reserved space (Hyprland `monitors -j` `reserved`; KDE/X11 `_NET_WORKAREA`).
Expand Down Expand Up @@ -799,7 +800,7 @@ Repo layout [D]:
- **Ctrl+P dropdown.** Ctrl+P is always `toggleFilter`, so emacs Ctrl+P = up is dropped in the list (it still moves up inside popups). Raycast's root has no dropdown; ours filters root search by type (All / Applications / Commands, `RootSearch.FILTERS`), hides the Calculator and fallback sections while filtered, and resets on pop-to-root.
- **Ctrl+T** opens the toast's actions. Failure toasts offer "Copy Error Message"; "Disable Command" offers "Undo".
- **Ctrl+Shift+K** About panel: `rootSearch.getItemInfo` → `RootSearch.aboutFor`.
- **Argument pills.** Builtins may declare `arguments` (`{name, placeholder, required}`). "Search Google" and "Search DuckDuckGo" are root commands with a `query` argument. Tab enters the pills, Shift+Tab / Backspace on an empty pill goes back, ↵ with an empty required argument focuses it.
- **Argument pills.** Builtins and quicklinks may declare `arguments` (`{name, placeholder, required}`). "Search Google" and "Search DuckDuckGo" are root commands with a `query` argument. Tab enters the pills, Shift+Tab / Backspace on an empty pill goes back, ↵ with an empty required argument focuses it.
- **Alerts.** `rootSearch.performAction` returns `{confirm}` for Shut Down / Restart / Log Out and Delete All Entries until called with `confirmed: true`. `omacast run` is explicit and skips it.
- **Keystroke buffering: won't do.** A parked surface conflicts with Omarchy's remap-on-open design (note above).
- **"fir" → Firefox:** on a list where another title starts with "Fire", the literal port ties at score 8 and the collator decides until Firefox has been launched once (`tests/ranker.test.js`).
Expand Down
Loading