简体   繁体   English

xmonad:移动新的浮动窗口

[英]xmonad: move new floating windows

As described in this and this issue, my floating windows are sometimes rendered behind other windows when using xmonad together with compton. 正如描述的这个这个问题,我的浮动窗口有时会落后于其他窗口一起使用xmonad与康普顿时呈现。 One possible workaround I want to try is to make xmonad move new floating windows slightly, which should render them above other windows. 我想尝试的一种可能的解决方法是使xmonad稍微移动新的浮动窗口,这应该将它们渲染到其他窗口之上。 However, being new to xmonad and Haskell, I have no idea how to achieve this. 但是,作为xmonad和Haskell的新手,我不知道如何实现这一目标。

How do I tell xmonad "When a new floating window is created, move it one pixel to the right"? 如何告诉xmonad“当创建一个新的浮动窗口时,向右移动一个像素”?

(xmonad-0.10 and xmonad-contrib-0.10) (xmonad-0.10和xmonad-contrib-0.10)

For people coming here who really want to shift a window, here is how you do it: 对于那些真正想要转移窗口的人来说,这是你如何做到的:

In your $HOME/.xmonad.xmonad.hs: 在$ HOME / .xmonad.xmonad.hs中:

Add some imports (you can skip existing, note the qualified import of Xmonad.StackSet and the "W.shift" below, you will have to adjust the name if you imported it under another name) 添加一些导入(您可以跳过现有的,请注意下面的Xmonad.StackSet和“W.shift”的限定导入,如果您使用其他名称导入名称,则必须调整名称)

import XMonad.Hooks.XPropManage
import qualified XMonad.StackSet as W
import XMonad.Actions.TagWindows
import Data.List

And add 并添加

manageHook = xPropManageHook xPropMatches

xPropMatches :: [XPropMatch]
xPropMatches = [ ( [(wM_CLASS, any (const True))], (return (W.shift "2"))) ]

that should work for all windows. 这适用于所有窗户。 If you want to control the matching, 如果要控制匹配,

(const True)

can be replaced with anything that has the type 可以用任何具有该类型的东西替换

String -> Bool

eg 例如

("Vimperator" `isInfixOf`)

etc 等等

Source: XPropManage 资料来源: XPropManage

问题已修复 ,不再需要此解决方法。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM