Window rule ignored for firefox openned window #15029
-
|
Hello. I have this window rule in my But it seems this rule isn't applied after Why doesn't Hyprland apply that rule? Did I miss something? |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 8 replies
-
The regex. EDIT: hl.window_rule({
name = "noscript-ff",
match = { title = "Extension: (NoScript).*" },
fullscreen = false,
fullscreen_state = "0 0",
float = true,
size = "800 600"
}) |
Beta Was this translation helpful? Give feedback.
-
|
if you look closely you will see that initial_class and initial_title are different AND the rules you want to apply are STATIC, which means they apply only when window is spawned and match'ed against initial's this is a browsers problem in general, nothing you can do. maybe yell at some devs |
Beta Was this translation helpful? Give feedback.
-
Well I use neither Firefox nor noscript, but wanted to see if this was possible. Was a frikken chore but finally got it. hl.on("window.open", function(w)
if w.class ~= "firefox" then return end
if w.initial_title ~= "Mozilla Firefox" then return end
local ff_windows = hl.get_windows({ class = "firefox" })
if #ff_windows <= 1 then return end
hl.dispatch(hl.dsp.window.float({ action = "set", window = w }))
local sub
sub = hl.on("window.title", function(tw)
if tw.address ~= w.address then return end
if tw.title == ""
or tw.title == "Mozilla Firefox"
or tw.title == "about:blank"
or tw.title:match("^about:.*Mozilla Firefox$") then return end
sub:remove()
if tw.title:match("^Extension: %(NoScript%)") then
hl.dispatch(hl.dsp.window.resize({ x = 800, y = 600, window = tw }))
hl.dispatch(hl.dsp.window.center({ window = tw }))
hl.dispatch(hl.dsp.focus({ window = tw }))
else
hl.dispatch(hl.dsp.window.float({ action = "unset", window = tw }))
end
end)
end)For whatever reason that stupid window disappears when the cursor is moved outside of it's bounds. Once I finally got the damn thing to float the cursor was elsewhere, requiring it to be focused as well. |
Beta Was this translation helpful? Give feedback.
one thing you can do is:
on title change check if title has extension name and class is firefox - float it