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)