Skip to content

Instantly share code, notes, and snippets.

@dluciv
Forked from b0o/popup-detect.js
Last active August 21, 2025 11:26
Show Gist options
  • Save dluciv/592c630211fe77624d174ce6bd6a9e55 to your computer and use it in GitHub Desktop.
Save dluciv/592c630211fe77624d174ce6bd6a9e55 to your computer and use it in GitHub Desktop.
Sway browser pop-up window float hack
// ==UserScript==
// @name Sway Popup Window Detector
// @namespace https://dluciv.name/
// @version 0.1
// @description Detect "pop-up" windows because for some reason Wayland doesn't have a built-in way to do it??!
// @author Maddison Hellstrom <github.com/b0o>
// @author Dmitry Luciv <github.com/dluciv>
// @include /^.*$/
// @grant none
// @run-at document-start
// ==/UserScript==
(function() {
if ((window.titlebar && window.titlebar.visible === false)
|| (window.menubar && window.menubar.visible === false)) {
document.title = `🗨 ${document.title}`
}
})()
for_window {
[title="^🗨 "] {
floating enable
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment