Make the theme picker open instantly (#13403)

* Run menu summon actions in-process

A menu action that only summons another shell plugin spawned bash and a
qs ipc client to ask this same shell to do it, about 60ms of the path.
Call shell.summon directly instead, and fall back to bash when the call
is refused or the action is anything more than a bare summon.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Open the theme picker from rows held in the shell

Opening the theme picker ran omarchy-theme-switcher to rebuild its index
and then made a second IPC call, about 170ms before the picker mapped.
The picker now holds the theme rows itself, opens from them at once, and
refreshes them behind the open via omarchy-theme-switcher --print-rows.
It applies the chosen theme with omarchy-theme-set directly, so
omarchy-theme-set no longer preloads the picker.

From the keybinding to the overlay mapped drops from ~245ms to ~83ms.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Keep the image picker surface mapped between opens

Each open mapped a fresh surface, which rendered its first frames before
Hyprland sent its fractional scale: the pixel ratio stepped 2, 1, then
1.6, so the picker flashed blurry for ~130ms and re-uploaded every
thumbnail texture. Keep the surface and park it transparent and
input-less on the bottom layer while closed, since anything on the
overlay layer blocks direct scanout for fullscreen apps. It follows the
focused monitor on each open.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
David Heinemeier HanssonandClaude Opus 5.5 authored and GitHub committed 2026-09-27 15:10:49 +02:00
1 parent e558224acf
commit 24f1243120
14 files changed
+232 -27

No files matched your search

+11
View File
@@ -490,8 +490,19 @@ function guardScript(items) {
return guards ? guardPrelude(guards) + guards : ""
}
// An action that only asks this shell to summon one of its own plugins can be
// run in-process, skipping the bash and qs ipc spawns. Anything more than the
// bare call, such as a second command or a shell-expanded payload, is left to
// bash.
function summonAction(action) {
var match = /^omarchy-shell shell summon ([A-Za-z0-9._-]+)(?: '([^']*)')?$/.exec(String(action || ""))
if (!match) return null
return { id: match[1], payload: match[2] || "{}" }
}
if (typeof module !== "undefined") {
module.exports = {
summonAction: summonAction,
guardReaders: GUARD_READERS,
guardScript: guardScript,
stripJsonc: stripJsonc,