yabai icon indicating copy to clipboard operation
yabai copied to clipboard

Matching on title with spaces for emacs popup windows

Open webframp opened this issue 2 years ago • 2 comments

Hey all,

With emacs on macOS, some popup windows when using lsp have the same app, role and subrole and only really differ on title. I'm looking for suggestions for a rule to unmanage these types of windows, I know emacs can be notoriously tricky on mac.

I can't seem to get a regex to work to match windows that have a title like this: "title":" — (92 × 46)", I've tried these with no success:

yabai -m rule --add label="EmacsPopup" title='^ — \(.*\)$' manage=off

I also tried an inverted rule to unmanage any of the non main windows.

yabai -m rule --add label="EmacsPopup" app=Emacs title!="^.+Doom Emacs.+" manage=off

Here's the query output for the windows in question, one main emacs window id 14903 and the popup id 14969:

[{
	"id":14969,
	"pid":78913,
	"app":"Emacs",
	"title":"  —  (92 × 46)",
	"frame":{
		"x":841.0000,
		"y":27.0000,
		"w":838.0000,
		"h":1022.0000
	},
	"level":0,
	"role":"AXWindow",
	"subrole":"AXStandardWindow",
	"movable":1,
	"resizable":1,
	"display":1,
	"space":2,
	"visible":0,
	"focused":0,
	"split":"vertical",
	"floating":0,
	"sticky":0,
	"minimized":0,
	"topmost":0,
	"opacity":1.0000,
	"shadow":1,
	"border":0,
	"stack-index":0,
	"zoom-parent":0,
	"zoom-fullscreen":0,
	"native-fullscreen":0
},{
	"id":14903,
	"pid":78913,
	"app":"Emacs",
	"title":".yabairc – Doom Emacs  —  (91 × 46)",
	"frame":{
		"x":1.0000,
		"y":27.0000,
		"w":838.0000,
		"h":1022.0000
	},
	"level":0,
	"role":"AXWindow",
	"subrole":"AXStandardWindow",
	"movable":1,
	"resizable":1,
	"display":1,
	"space":2,
	"visible":0,
	"focused":0,
	"split":"vertical",
	"floating":0,
	"sticky":0,
	"minimized":0,
	"topmost":0,
	"opacity":1.0000,
	"shadow":1,
	"border":0,
	"stack-index":0,
	"zoom-parent":0,
	"zoom-fullscreen":0,
	"native-fullscreen":0
}]

webframp avatar Nov 25 '21 20:11 webframp

bump. Still curious on this one if anyone has ideas

webframp avatar Feb 02 '22 23:02 webframp

@webframp thats two space

"title":"  —  (92 × 46)",

yqrashawn avatar May 12 '22 09:05 yqrashawn