![](/img/trans.png)
[英]Xmonad shift window to another screen and focus on it with one keybinding
[英]How to run a hook on a Xmonad Window via keybinding
我正在寻找一种将我的doCenterFloat
中doCenterFloat 的行为复制到键绑定的方法。 我想保持 windows 的“自然”尺寸。 For example, when i create an OpenGL window with size 800x600, I would manually have to add the title of the window to my XMonad config, otherwise it would be tiled and the contents of the window would be stretched.
这是我试图复制到键绑定的代码
myManageHook = composeAll
[ title =? "OpenGL" --> doCenterFloat ]
上述代码使 window 正确显示。 我已经尝试过切换普通浮点数(不是 centerFloat)的函数,但它们以平铺大小显示,例如Xmonad:Float and resize windows to its “natural size
任何帮助深表感谢
runQuery :: Query a -> Window -> X a
http://hackage.haskell.org/package/xmonad-contrib-0.16/docs/XMonad-Config-Prime.html#v:runQuery
withFocused :: (Window -> X ()) -> X ()
http://hackage.haskell.org/package/xmonad-contrib-0.16/docs/XMonad-Config-Prime.html#v:withFocused
使用上述两个函数,其中myQuery
将设置您的Query
(如doCenterFloat
)。
myQuery = undefined :: Query
withFocused (\window -> runQuery myQuery window)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.