From d9bc38a926c41555352fb4adb187c4f4b8cec553 Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Wed, 5 Aug 2026 15:56:01 -0500 Subject: [PATCH] Apply the terminal tag to Omarchy's own terminal windows (#6561) * Apply the terminal tag to Omarchy's own terminal windows Omarchy launches TUIs and its own terminal windows under dedicated app-ids (org.omarchy.btop, org.omarchy.terminal, TUI.float, ...), so the class never matched the terminal that drew the window and those windows went untagged. Also drop the tag's opacity rule, which stripped default-opacity only to re-apply the identical value. Themes still override through the tag. Co-Authored-By: Claude Opus 5 (1M context) * Match terminals by tag for universal clipboard shortcuts The binding kept its own list of terminal classes, so SUPER + C in a TUI window sent CTRL + C instead of CTRL + Insert. Read the terminal tag instead of duplicating the definition. Co-Authored-By: Claude Opus 5 (1M context) --------- Co-authored-by: Claude Opus 5 (1M context) --- default/hypr/apps/terminals.lua | 10 +++++++--- default/hypr/bindings/clipboard.lua | 20 ++++++++++---------- 2 files changed, 17 insertions(+), 13 deletions(-) diff --git a/default/hypr/apps/terminals.lua b/default/hypr/apps/terminals.lua index e87ad35c..0a46d3dc 100644 --- a/default/hypr/apps/terminals.lua +++ b/default/hypr/apps/terminals.lua @@ -1,3 +1,7 @@ --- Define terminal tag to style them uniformly. -o.window("(Alacritty|kitty|com.mitchellh.ghostty|foot|wezterm)", { tag = "+terminal" }) -o.window({ tag = "terminal" }, { tag = "-default-opacity", opacity = "0.985 0.96" }) +-- Define terminal tag so themes and bindings can single terminals out. Omarchy +-- launches TUIs and its own terminal windows under dedicated app-ids +-- (org.omarchy.btop, org.omarchy.terminal, TUI.float, ...), so match those too. +o.window( + "(Alacritty|kitty|com.mitchellh.ghostty|foot|wezterm|org\\.omarchy\\..*|TUI\\..*)", + { tag = "+terminal" } +) diff --git a/default/hypr/bindings/clipboard.lua b/default/hypr/bindings/clipboard.lua index ce70fe46..f095ea5c 100644 --- a/default/hypr/bindings/clipboard.lua +++ b/default/hypr/bindings/clipboard.lua @@ -15,21 +15,21 @@ local function send_shortcut_once(mods, key) end end -local terminal_classes = { - alacritty = true, - ["com.mitchellh.ghostty"] = true, - foot = true, - kitty = true, - wezterm = true, -} - +-- Lean on the terminal tag from default/hypr/apps/terminals.lua so there's one +-- definition of what counts as a terminal. Dynamic tags carry a trailing "*". local function active_window_is_terminal() local window = hl.get_active_window() - if not window or not window.class then + if not window then return false end - return terminal_classes[window.class:lower()] == true + for _, tag in ipairs(window.tags or {}) do + if tag:gsub("%*$", "") == "terminal" then + return true + end + end + + return false end local function universal_clipboard_shortcut(default_mods, default_key, terminal_mods, terminal_key)