From 36f6ee0ac91db387dcaf37696855f19208caa0c0 Mon Sep 17 00:00:00 2001 From: Neil Chudleigh <5580824+nchudleigh@users.noreply.github.com> Date: Tue, 3 Nov 2026 12:04:47 -0500 Subject: [PATCH] Add a rootFilter config key to hide the root search filter The All / Applications / Commands button takes header room some people never use. "rootFilter": false in config.json hides it and its Ctrl+P shortcut; the default keeps it. Co-Authored-By: Claude Opus 5.5 --- README.md | 3 +++ core/Schema.js | 5 ++++- tests/migrate.test.js | 3 +++ ui/LauncherWindow.qml | 4 ++-- 4 files changed, 12 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 5900ced..8da6bd7 100644 --- a/README.md +++ b/README.md @@ -132,6 +132,9 @@ the old plugin link and `~/.local/bin/oma-cast`, and `omacast setup hyprland` mo | `Esc` / `Shift+Esc` | Back / back to root | | `Ctrl +` / `Ctrl −` / `Ctrl 0` | Zoom | +The All / Applications / Commands filter beside the root search is optional: set `"rootFilter": false` in +`~/.config/omacast/config.json` to hide it and its shortcut. + ## CLI ```sh diff --git a/core/Schema.js b/core/Schema.js index cdac573..68b0164 100644 --- a/core/Schema.js +++ b/core/Schema.js @@ -73,7 +73,10 @@ var configDefaults = { remToPxRate: 16, workHoursPerDay: 8, // "auto" follows the Qt locale; "12h" or "24h" forces a clock. [D] - clockFormat: "auto" + clockFormat: "auto", + // The All / Applications / Commands filter button (Ctrl+P) beside the root + // search; false hides it and leaves every result in one list. [D] + rootFilter: true } // Values a config key or general setting may take, beyond its type. diff --git a/tests/migrate.test.js b/tests/migrate.test.js index 0e27640..cc59991 100644 --- a/tests/migrate.test.js +++ b/tests/migrate.test.js @@ -93,5 +93,8 @@ test("config rejects out-of-range calculator values and unknown choices", () => assert.equal(c.workHoursPerDay, 8, "zero hours falls back to the default") assert.equal(c.clockFormat, "24h") assert.equal(Schema.withConfigDefaults({ clockFormat: "36h" }).clockFormat, "auto") + assert.equal(Schema.withConfigDefaults({}).rootFilter, true) + assert.equal(Schema.withConfigDefaults({ rootFilter: false }).rootFilter, false) + assert.equal(Schema.withConfigDefaults({ rootFilter: "no" }).rootFilter, true) assert.deepEqual(Schema.generalChoices.navigationBindings, ["emacs", "vim-motions"]) }) diff --git a/ui/LauncherWindow.qml b/ui/LauncherWindow.qml index 618a8ad..f8e9a4a 100644 --- a/ui/LauncherWindow.qml +++ b/ui/LauncherWindow.qml @@ -360,7 +360,7 @@ PanelWindow { } function toggleDropdown() { - if (window.dropdownOpen || !window.atRoot) { window.dropdownOpen = false; return } + if (window.dropdownOpen || !window.atRoot || !window.backend.config.rootFilter) { window.dropdownOpen = false; return } window.dropdownOpen = true dropdown.item.filter = "" var at = RootSearch.FILTERS.map(function(f) { return f.id }).indexOf(window.rootFilter) @@ -812,7 +812,7 @@ PanelWindow { Rectangle { id: filterButton - visible: window.atRoot && !window.compact + visible: window.atRoot && !window.compact && window.backend.config.rootFilter anchors.right: parent.right anchors.rightMargin: window.px(16) anchors.verticalCenter: parent.verticalCenter