From 0d90cafa7b000699ed3de8dac6e3a1aa9bbe5fda Mon Sep 17 00:00:00 2001 From: felixzsh Date: Sun, 21 Jun 2026 10:50:25 -0500 Subject: [PATCH 1/2] feat: user bindings override instead of append without this, the user could define the same default bindings and make duplicated actions on the same keybinding, this overrides default bindings in favor of user config bindings --- default/hypr/helpers.lua | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/default/hypr/helpers.lua b/default/hypr/helpers.lua index e744c87c20..7a27f45d6a 100644 --- a/default/hypr/helpers.lua +++ b/default/hypr/helpers.lua @@ -67,7 +67,14 @@ function o.preinstalled_bindings_enabled() return not file_exists((os.getenv("HOME") or "") .. "/.local/state/omarchy/preinstalls-removed") end +local bound_keys = {} + function o.bind(keys, description, dispatcher, options) + if bound_keys[keys] then + hl.unbind(keys) + end + bound_keys[keys] = true + local opts = options or {} if description then From d1048f953ac2a752aad440786b0f39411d272645 Mon Sep 17 00:00:00 2001 From: felixzsh Date: Sun, 21 Jun 2026 11:31:15 -0500 Subject: [PATCH 2/2] fix: override scope to launch commands only MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Restrict override to launch-command bindings so tiling duplicates (ALT+TAB → cycle_next + bring_to_top) and multi-event bindings (press + release on same key) are preserved. --- default/hypr/helpers.lua | 30 ++++++++++++++++++++++++------ 1 file changed, 24 insertions(+), 6 deletions(-) diff --git a/default/hypr/helpers.lua b/default/hypr/helpers.lua index 7a27f45d6a..6147140d2d 100644 --- a/default/hypr/helpers.lua +++ b/default/hypr/helpers.lua @@ -67,14 +67,24 @@ function o.preinstalled_bindings_enabled() return not file_exists((os.getenv("HOME") or "") .. "/.local/state/omarchy/preinstalls-removed") end -local bound_keys = {} +local function bind_dedup_key(keys, options) + if not options then + return keys + end -function o.bind(keys, description, dispatcher, options) - if bound_keys[keys] then - hl.unbind(keys) + -- Internal dedup key: same keys with a different event type + if options.release then + return keys .. "|r" + elseif options.long_press then + return keys .. "|l" end - bound_keys[keys] = true + return keys +end + +local registered = {} + +function o.bind(keys, description, dispatcher, options) local opts = options or {} if description then @@ -82,8 +92,16 @@ function o.bind(keys, description, dispatcher, options) end dispatcher = command_from(dispatcher, description) + local disp_is_launch = type(dispatcher) == "string" + local dedup = bind_dedup_key(keys, options) + + if registered[dedup] ~= nil and (disp_is_launch or registered[dedup]) then + hl.unbind(keys) + end + + registered[dedup] = disp_is_launch - if type(dispatcher) == "string" then + if disp_is_launch then dispatcher = hl.dsp.exec_cmd(dispatcher) end