Xmonad:浮动窗口时,移动或调整其大小
我更喜欢使用键盘来浮动或下沉窗口。不幸的是,当浮动时,窗口不会移动或调整大小,因此几乎没有视觉迹象表明它们尚未平铺。理想情况下,在转移到浮动层后,我会让它们移动到屏幕中心和/或调整大小。
最好的解决方案将与下面的功能(或类似的功能)一起使用,我用键绑定调用它 - 我希望通过鼠标单击浮动以仍然正常工作。
toggleFloat = withFocused (\windowId -> do
{ floats <- gets (W.floating . windowset);
if windowId `M.member` floats
then withFocused $ windows . W.sink
else float windowId })
(代码被盗,我仍然没有掌握Haskell:c)
编辑:下面修改后的代码中的keysMoveWindowTo内容实际上可以替换“float windowId”,这使得它变得多余。
I prefer to use the keyboard to float or sink windows. Unfortunately, when floated, windows aren't moved or resized, so there is little visual indication that they aren't still tiled. Ideally, upon shifting to the float layer, I'd have them move to the center of the screen and/or resize.
The best solution would work together with the function below (or something similar), which I call with a keybind -- I'd like floating via mouse click to still work normally.
toggleFloat = withFocused (\windowId -> do
{ floats <- gets (W.floating . windowset);
if windowId `M.member` floats
then withFocused $ windows . W.sink
else float windowId })
(Code stolen, I still have no grasp of Haskell :c)
Edit: the keysMoveWindowTo stuff in the modified code below can actually just replace "float windowId", which it makes superfluous.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我想您已经安装了
xmonad-contrib
软件包。那么你应该看看 XMonad.Actions.FloatKeys将是:
我猜修改后的函数
x
,y
,dx
,dy
,gx1
,gy1< /code>,
gx2
,gy2
是您的设置。文档中提到的运算符
%
来自于Data.Ratio
;a % b
表示分子a
和分母b
的有理数。如果你想使用它,你必须导入:I suppose you've
xmonad-contrib
package installed. Then you should take a look at XMonad.Actions.FloatKeysI guess modified function will be:
where
x
,y
,dx
,dy
,gx1
,gy1
,gx2
,gy2
are your settings.Operator
%
mentioned in docs is fromData.Ratio
;a % b
means rational number with numeratora
and denominatorb
. You have to import if you want to use it:使用 mod+左拖动浮动窗口,使用 mod+右拖动调整其大小。
Float window with mod+left dragging, resize it with mod+right dragging.