问题
I use this truly excellent Firefox add-on: https://github.com/docwhat/itsalltext/
Hit ctrl-e
to edit any textarea in Vim.
However vim starts up tiled. My browser workspaces are single-window tabbed, so a fullscreen editor is overkill. Here's what I tried to make it start as a floating window:
-- This works, but matches any vim instance, not just itsalltext instances:
-- , className =? "Gvim" --> doFloat
-- This does nothing:
, fmap (isInfixOf "itsalltext") title --> doFloat
xprop
shows this for the window that is created:
WM_CLASS(STRING) = "gvim", "Gvim"
WM_ICON_NAME(STRING) = "mail.google.com.3c1b1v2w21.txt (~/.mozilla/firefox/3waevusx.default/itsalltext) - GVIM1"
_NET_WM_ICON_NAME(UTF8_STRING) = "mail.google.com.3c1b1v2w21.txt (~/.mozilla/firefox/3waevusx.default/itsalltext) - GVIM1"
WM_NAME(STRING) = "mail.google.com.3c1b1v2w21.txt (~/.mozilla/firefox/3waevusx.default/itsalltext) - GVIM1"
_NET_WM_NAME(UTF8_STRING) = "mail.google.com.3c1b1v2w21.txt (~/.mozilla/firefox/3waevusx.default/itsalltext) - GVIM1"
Bonus question: doFloat
works, but I'd really like to specify how to float. For scratchpads, this works:
customFloating $ W.RationalRect (1/6) (1/6) (2/3) (2/3)
But I couldn't figure out how to use customFloating
for a window that's not a scratchpad.
来源:https://stackoverflow.com/questions/19973641/xmonad-start-program-floating-based-on-window-title