Make a window rule fire when an app renames its own title
The cause is exactly right and is the wiki's own warning: 'It is not possible to float (or any other static rule) a window based on a change in the title after the window has been created. This applies to all static effects listed here. Instead, use a dispatch triggered by an event listener.' The record's static list (float, tile, fullscreen, maximize, move, size, center, pseudo, monitor, workspace, pin, group, no_initial_focus) is a correct subset of the wiki's static table, and its dynamic examples (opacity, border_color, no_blur, max_size, tag) are all in the dynamic table. The Lua listener is valid: window.title is a documented event, hl.dsp.window.float({action, window}) is a documented dispatcher, action = "on" is a documented value (the action param type is toggle/enable|on/disable|off), and address:0x... is a documented window selector. The match:initial_title advice is right. The bash/socat fallback is the problem. It is broken in two independent ways and floats windows it should not.
Symptom
A rule like 'float any window whose title becomes "Save As"' or 'float the Zoom meeting window once it renames itself' never triggers, even though hyprctl clients clearly shows that title. Rules that use opacity or border_color on the same match work fine.
Cause
Hyprland splits rule effects into static and dynamic. Static effects (float, tile, fullscreen, maximize, move, size, center, pseudo, monitor, workspace, pin, group, no_initial_focus) are evaluated exactly once, at window open, and at that moment only initialTitle/initialClass are known. A later title change cannot retroactively float the window. Dynamic effects (opacity, border_color, no_blur, max_size, tag, ...) are re-evaluated on every property change, which is why those appear to work.
Fix
The Lua listener and the initial_title advice are correct as written. Replace the socat fallback, which as written floats EVERY window whose title changes (it has no title filter at all, despite the stated goal of matching 'Save As') and also misfires on windowtitlev2.
Per the IPC wiki, windowtitle>> carries only WINDOWADDRESS while windowtitlev2>> carries WINDOWADDRESS,WINDOWTITLE. The record's windowtitle* glob matches BOTH, so on a v2 event it builds address:0x<ADDR>,<TITLE> and the dispatch fails. Use v2 so you actually have the title to test:
socat -U - "UNIX-CONNECT:$XDG_RUNTIME_DIR/hypr/$HYPRLAND_INSTANCE_SIGNATURE/.socket2.sock" |
while read -r line; do
case "$line" in
windowtitlev2\>\>*)
payload=${line#*>>}
addr=${payload%%,*}
title=${payload#*,}
case "$title" in
"Save As"*) hyprctl dispatch setfloating "address:0x${addr}" ;;
esac
;;
esac
done
(setfloating is the hyprlang-era dispatcher name, correct for <= 0.54. On 0.55+ prefer the Lua listener shown above.)
Verify
Trigger the title change. hyprctl clients shows floating: 1 for that address.