hyprland: match Element scratchpad Wayland class
This commit is contained in:
@@ -43,7 +43,8 @@ local scratchpads = {
|
|||||||
},
|
},
|
||||||
element = {
|
element = {
|
||||||
command = "element-desktop",
|
command = "element-desktop",
|
||||||
class = "Element",
|
classes = { "Element", "electron" },
|
||||||
|
title = "Element",
|
||||||
},
|
},
|
||||||
slack = {
|
slack = {
|
||||||
command = "slack",
|
command = "slack",
|
||||||
@@ -261,9 +262,22 @@ local function lower_contains(value, needle)
|
|||||||
return value:find(needle, 1, true) ~= nil
|
return value:find(needle, 1, true) ~= nil
|
||||||
end
|
end
|
||||||
|
|
||||||
|
local function lower_contains_any(value, needles)
|
||||||
|
if type(needles) ~= "table" then
|
||||||
|
return lower_contains(value, needles)
|
||||||
|
end
|
||||||
|
|
||||||
|
for _, needle in ipairs(needles) do
|
||||||
|
if lower_contains(value, needle) then
|
||||||
|
return true
|
||||||
|
end
|
||||||
|
end
|
||||||
|
return false
|
||||||
|
end
|
||||||
|
|
||||||
local function scratchpad_window_matches(window, def)
|
local function scratchpad_window_matches(window, def)
|
||||||
return window
|
return window
|
||||||
and lower_contains(window.class, def.class)
|
and lower_contains_any(window.class, def.classes or def.class)
|
||||||
and lower_contains(window.title, def.title)
|
and lower_contains(window.title, def.title)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user