在 i3wm 中禁用边框浮动 windows
Disable borders from floating windows in i3wm
我可以通过启用 hide_edge_borders both
来禁止边框不浮动 windows。但是当我打开像 lxterminal 这样的浮动 windows 时,我得到了 this borders to change window size。
我该怎么做才能禁用此边框,但不能禁用 window?
的标题
hide_edge_borders
仅隐藏与屏幕边缘相邻且仅在平铺层上的边框。这与受影响 windows.
的边框设置无关
您可以使用 new_window
和 new_float
设置为 windows 设置初始边框样式:
new_window none
new_window normal|pixel [<px>]
new_float none
new_float normal|pixel [<px>]
设置none
表示没有边框和标题栏。 normal
默认情况下,标题栏和边框为两个像素宽。可以使用可选的 <px>
设置更改边框宽度,0
设置保留标题栏但删除边框。 pixel
(也有可选宽度)在所有边上产生边框,但没有标题栏。
new_window
为 windows 设置从平铺层开始的样式,对于 i3 - 几乎每个 window 都是这样。 new_float
将 windows 的样式设置为浮动 windows,主要是对话框 windows。如果稍后更改浮动状态,这些设置不会影响边框样式。后来还包括
等设置
for_window [class="SOMECLASS"] floating enable
因为它们也仅在 window 已创建后才完成。
这给您留下了一些可能的解决方案
如果您不需要任何边框,解决方案非常简单。您可以设置:
new_window normal 0
new_float normal 0
这会删除所有边框,包括平铺 windows 之间的边框。然后您也可以删除 hide_edge_borders
设置,因为它不再需要了。
如果您想保持平铺层当前的状态 - windows 之间的边缘,而不是屏幕边缘 - 它会变得更加棘手。如上所述,new_float
设置仅影响最初浮动的 windows,但不会影响后来自动或手动设置为浮动的 windows。最简单的解决方案可能是为浮动和 un-floating a window(而不是仅仅切换)设置单独的命令,并根据需要将任何 for_window
设置扩展到 remove/add 边框.例如:
# New tiling windows with title bar and borders
new_window normal 2
# New floating windows with title bar and without borders
new_float normal 0
# Hide borders on edges
hide_edge_borders both
# Set variables for floating and un-floating commands
set $FLOAT floating enable, border normal 0
set $UNFLOAT floating disable, border normal 2
# Key bindings
# Switch between tiling and floating layer (Super+Space)
bindcode Mod4+65 focus mode_toggle
# Put windows on floating layer and remove borders (Super+Shift+Space)
bindcode Mod4+Shift+65 $FLOAT
# Make windows on tiling layer and add borders (Super+Control+Space)
bindcode Mod4+Control+65 $UNFLOAT
# Auto-float some windows
for_window [class="SomeClass"] $FLOAT
for_window [title="ThisTitle"] $FLOAT
# Auto-un-float some other windows
for_window [class="SomeOtherClass" window_type="dialog"] $UNFLOAT
for_window [title="ThatTitle"] $UNFLOAT
备注:
- 为 float 和 un-float 命令设置变量有助于提高可读性和可维护性。为边界类型设置变量没有多大意义,因为变量不是递归计算的。因此,不可能为边框样式设置变量并在 float/un-float 命令的变量设置中重复使用它。
- 我用的是
bindcode
,因为我找不到组合Super+Control+Space 和 bindsym
在我的系统上。当然,这只是一个示例,您的系统可能不需要它。
- 如果你想保持当前布局但又想用一个快捷键切换 window 的浮动状态,你将不得不使用 i3's IPC interface。使用 IPC,您可以检查焦点 window 的当前状态。然后你可以 float/un-float 和 window 改变它的边框样式。
我可以通过启用 hide_edge_borders both
来禁止边框不浮动 windows。但是当我打开像 lxterminal 这样的浮动 windows 时,我得到了 this borders to change window size。
我该怎么做才能禁用此边框,但不能禁用 window?
hide_edge_borders
仅隐藏与屏幕边缘相邻且仅在平铺层上的边框。这与受影响 windows.
您可以使用 new_window
和 new_float
设置为 windows 设置初始边框样式:
new_window none
new_window normal|pixel [<px>]
new_float none
new_float normal|pixel [<px>]
设置none
表示没有边框和标题栏。 normal
默认情况下,标题栏和边框为两个像素宽。可以使用可选的 <px>
设置更改边框宽度,0
设置保留标题栏但删除边框。 pixel
(也有可选宽度)在所有边上产生边框,但没有标题栏。
new_window
为 windows 设置从平铺层开始的样式,对于 i3 - 几乎每个 window 都是这样。 new_float
将 windows 的样式设置为浮动 windows,主要是对话框 windows。如果稍后更改浮动状态,这些设置不会影响边框样式。后来还包括
for_window [class="SOMECLASS"] floating enable
因为它们也仅在 window 已创建后才完成。
这给您留下了一些可能的解决方案
如果您不需要任何边框,解决方案非常简单。您可以设置:
new_window normal 0 new_float normal 0
这会删除所有边框,包括平铺 windows 之间的边框。然后您也可以删除
hide_edge_borders
设置,因为它不再需要了。
如果您想保持平铺层当前的状态 - windows 之间的边缘,而不是屏幕边缘 - 它会变得更加棘手。如上所述,
new_float
设置仅影响最初浮动的 windows,但不会影响后来自动或手动设置为浮动的 windows。最简单的解决方案可能是为浮动和 un-floating a window(而不是仅仅切换)设置单独的命令,并根据需要将任何for_window
设置扩展到 remove/add 边框.例如:# New tiling windows with title bar and borders new_window normal 2 # New floating windows with title bar and without borders new_float normal 0 # Hide borders on edges hide_edge_borders both # Set variables for floating and un-floating commands set $FLOAT floating enable, border normal 0 set $UNFLOAT floating disable, border normal 2 # Key bindings # Switch between tiling and floating layer (Super+Space) bindcode Mod4+65 focus mode_toggle # Put windows on floating layer and remove borders (Super+Shift+Space) bindcode Mod4+Shift+65 $FLOAT # Make windows on tiling layer and add borders (Super+Control+Space) bindcode Mod4+Control+65 $UNFLOAT # Auto-float some windows for_window [class="SomeClass"] $FLOAT for_window [title="ThisTitle"] $FLOAT # Auto-un-float some other windows for_window [class="SomeOtherClass" window_type="dialog"] $UNFLOAT for_window [title="ThatTitle"] $UNFLOAT
备注:
- 为 float 和 un-float 命令设置变量有助于提高可读性和可维护性。为边界类型设置变量没有多大意义,因为变量不是递归计算的。因此,不可能为边框样式设置变量并在 float/un-float 命令的变量设置中重复使用它。
- 我用的是
bindcode
,因为我找不到组合Super+Control+Space 和bindsym
在我的系统上。当然,这只是一个示例,您的系统可能不需要它。
- 如果你想保持当前布局但又想用一个快捷键切换 window 的浮动状态,你将不得不使用 i3's IPC interface。使用 IPC,您可以检查焦点 window 的当前状态。然后你可以 float/un-float 和 window 改变它的边框样式。