简体   繁体   English

"仅从全屏浮动窗口中删除边框(XMonad 配置)"

[英]Remove border from fullscreen floating windows only (XMonad configuration)

I would like to我想

  1. remove borders (only) from floating windows covering the full screen (like mplayer), and (仅)从覆盖全屏的浮动窗口(如 mplayer)中删除边框,以及<\/li>
  2. use a different border color (normalBorderColor) when there is only one window in a workspace.当工作区中只有一个窗口时,使用不同的边框颜色 (normalBorderColor)。<\/li><\/ol>

    Currently, I am using smartBorders from XMonad.Layout.NoBorders to remove the border from mplayer, and to remove the border of a window when that window is the only window in a workspace.目前,我正在使用 XMonad.Layout.NoBorders 中的 smartBorders 从 mplayer 中删除边框,并在该窗口是工作区中唯一的窗口时删除该窗口的边框。 However, when I switch between two workspaces which both have a single non-floating window (regardless of mode (tall\/mirror\/full)), then I see the window (in the workspace I am changing into) "jump" a bit, as its border is drawn, and then removed a brief moment thereafter (the effect is more visible if you set your borderWidth to a large number).但是,当我在两个都具有单个非浮动窗口(无论模式(高\/镜像\/全))的工作区之间切换时,我会看到窗口(在我要更改的工作区中)“跳跃”了一下,当它的边框被绘制时,然后在此后片刻被移除(如果你将你的borderWidth设置为一个很大的数字,效果会更明显)。

    The relevant part of my ~\/.xmonad\/xmonad.hs is given below.下面给出了我的 ~\/.xmonad\/xmonad.hs 的相关部分。

     import XMonad.Hooks.ManageDocks import XMonad.Layout.NoBorders myLayout = tiled ||| Mirror tiled ||| Full where tiled = Tall 1 (3\/100) (3\/5) main = xmonad $ defaultConfig { layoutHook = avoidStruts $ smartBorders $ myLayout , borderWidth = 4 , normalBorderColor = "#000000" -- black , focusedBorderColor = "#ff3f3f" -- reddish }<\/code><\/pre>

    Do you folks know how I achieve this effect?你们知道我是如何达到这个效果的吗? (is part 2. even possible?) Suggestions and pointers to extensions and\/or existing configurations that achieve a similar effect greatly appreciated. (第 2 部分甚至可能吗?)非常感谢对实现类似效果的扩展和\/或现有配置的建议和指针。

    "

I solved pt. 我解决了pt。 1 using the Ambiguity constructor named OnlyFloat from XMonad.Layout.NoBorders. 1使用来自XMonad.Layout.NoBorders的名为OnlyFloat的Ambiguity构造函数。

import XMonad.Hooks.ManageDocks
import XMonad.Layout.NoBorders
myLayout = tiled ||| Mirror tiled ||| Full
  where
    tiled   = Tall 1 (3/100) (3/5)                                 
main = xmonad $ defaultConfig 
                 { layoutHook = lessBorders OnlyFloat $ avoidStruts $ myLayout 
                 , borderWidth = 4
                 , normalBorderColor  = "#000000" -- black
                 , focusedBorderColor = "#ff3f3f" -- reddish
                 }

I haven't addressed pt. 我没有解决过这个问题。 2. Furthermore, when I switch into a workspace, the border color of the focused window "flickers", since initially, the window is not focused (an thus its border is colored as per normalBorderColor), whereafter the window becomes focused (and thus its border gets the color focusedBorderColor). 2.此外,当我切换到工作区时,聚焦窗口的边框颜色“闪烁”,因为最初,窗口没有聚焦(因此其边框按照normalBorderColor着色),此后窗口变得聚焦(因此它的边框得到颜色focusedBorderColor)。

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

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