简体   繁体   English

awesome-wm:如何更改系统托盘形状

[英]awesome-wm: How to change systray shape

Is there any way to change the systray shape to rounded rectangle in AwesomeWM window manager? 有什么办法可以在AwesomeWM窗口管理器中将系统托盘形状更改为圆角矩形? I've searched docs for "wibox.widget.systray" class but it doesn't have option to change it's shape. 我已经在文档中搜索了“ wibox.widget.systray”类,但没有选择更改其形状的选项。 I tried to put systray to container and set the shape there but it didn't work: 我试图将systray放到容器中并在那里设置形状,但是没有用:

s.mysystray = wibox.widget.systray()
local systray_container = wibox.container.background(s.mysystray, beautiful.bg_systray, gears.shape.rounded_rect)
local systray_margin = wibox.container.margin(systray_container, 0, 0, 5, 5)
local systray = wibox.container.place(systray_margin, {
    halign = "center",
    fill_vertical = true,
})

I would like to unify systray with tasklist selection just like in the picture below: https://imgur.com/a/5m8RZNh 我想用任务列表选择统一系统托盘,如下图: https : //imgur.com/a/5m8RZNh

You can! 您可以! To achieve this, you must use the Awesome "container" pattern and wrap it into a wibox.container.background . 为此,必须使用Awesome的“容器”模式并将其包装到wibox.container.background

-- the systray has its own internal background because of X11 limitations
beautiful.bg_systray = "#ff0000"
beautiful.systray_icon_spacing = 10

local my_round_systray = wibox.widget {
    {
        wibox.widget.systray(),
        left   = 10,
        top    = 2,
        bottom = 2,
        right  = 10,
        widget = wibox.container.margin,
    },
    bg         = "#ff0000",
    shape      = gears.shape.rounded_rect,
    shape_clip = true,
    widget     = wibox.container.background,
}

Please note that background handling within the systray widget is limited. 请注意,系统托盘小部件内的后台处理受到限制。 It cannot be a gradient or a transparent color. 它不能是渐变色或透明色。 This is due to X11 limitations. 这是由于X11的限制。 Awesome doesn't have an internal compositing manager and instead rely on external ones such as Compton. Awesome没有内部合成管理器,而是依赖于诸如Compton之类的外部合成器。 One of the downside of doing this is the systray. 这样做的缺点之一是系统托盘。 The upside is, well, everything else. 好的方面是,其他所有方面。 Also, both Qt and GTK apps keep regressing their systray background support. 同样,Qt和GTK应用程序都在不断降低对系统托盘后台的支持。 The bug is on their side and cannot be mitigated for non-compositing WMs without implementing non-standard-compliant hacks, which AwesomeWM will not do. 该错误就在他们身边,如果不实施非标准的hacks,AwesomeWM 不会这么做,因此对于非复合WM来说无法消除该bug。 So you end up with: 因此,您最终得到:

在此处输入图片说明

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

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