dot

vizie's NixOS desktop: Hyprland, CachyOS kernel and gaming tweaks

0f5f57e

Hide WowUp's login window again

By Gustaf Granström

WowUp's window class is "wowupcf" on NixOS rather than CachyOS's
"WowUpCf", so the startup rule that hides and closes its window never
matched. Match it case-insensitively, and keep the rule up past
Overwolf's consent popup until the main window opens.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

1 file changed +12 −7

@@ -39,13 +39,16 @@
3939 end, { timeout = 120000, type = "oneshot" })
4040
4141 -- WowUp can't start hidden, so the window it opens at login is sent to a hidden
42- -- workspace and closed again, which leaves it in the tray. That rule must not
43- -- outlive the one window: it is dropped as soon as the window has opened (or
44- -- after a minute if none came), so opening WowUp yourself right after login
45- -- lands on your workspace like any other window.
42+ -- workspace and closed again, which leaves it in the tray. Its class is
43+ -- "wowupcf" on NixOS ("WowUpCf" on CachyOS), so both are matched. Before that
44+ -- window it can open Overwolf's consent popup (same class, titled "WowUpCf"),
45+ -- which is hidden and closed the same way. The rule must not outlive the main window:
46+ -- it is dropped as soon as that has opened (or after a minute if none came),
47+ -- so opening WowUp yourself right after login lands on your workspace like any
48+ -- other window.
4649 local wowup_rule = hl.window_rule({
4750 name = "startup-wowup",
48- match = { class = "^WowUpCf$" },
51+ match = { class = "(?i)^wowupcf$" },
4952 workspace = "special:autostart silent",
5053 })
5154 local wowup_pending = true
@@ -54,8 +57,10 @@
5457 wowup_rule:set_enabled(false)
5558 end
5659 hl.on("window.open", function(window)
57- if wowup_pending and window.class == "WowUpCf" then
58- wowup_done()
60+ if wowup_pending and window.class:lower() == "wowupcf" then
61+ if window.title ~= "" and window.title ~= "WowUpCf" then
62+ wowup_done()
63+ end
5964 -- closing it from inside the open event is too early and gets ignored
6065 local address = window.address
6166 hl.timer(function()