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) <noreply@anthropic.com> * 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) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5
parent
0269fe0031
commit
d9bc38a926
@@ -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" }
|
||||
)
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user