XMonad: start program floating based on window title

假如想象 提交于 2020-01-23 21:44:10

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!