我在 Ubuntu 23.10、x64 机器上,一切都是最新的并且使用 Wayland。
我非常喜欢 waybar,通过配置我设法获得了两个不同的栏,一个在顶部,一个在底部。
问题是:顶部的窗口避开了窗口(即,最大化窗口不会覆盖它),而底部的窗口却没有避开窗口(即,最大化窗口会完全覆盖它)。
我的 waybar 配置如下:
[
{
// Basic infos
"name": "header",
"layer": "top",
// Disposition
"modules-left": [
"custom/launcher",
"cpu",
"memory",
"custom/media",
"network"
],
"modules-center": [
"tray"
],
"modules-right": [
"backlight",
"pulseaudio",
"clock",
"battery"
],
// Built-in modules
"pulseaudio": {
"tooltip": false,
"scroll-step": 5,
"format": "{icon} {volume}%",
"format-muted": "{icon} {volume}%",
"format-icons": {
"default": [
"",
"",
""
]
}
},
"network": {
"tooltip": false,
"format-wifi": " {essid}",
"format-ethernet": "",
"on-click": "/usr/bin/systemsettings kcm_networkmanagement"
},
"backlight": {
"tooltip": false,
"format": " {}%",
"interval": 1,
"on-scroll-up": "light -A 5",
"on-scroll-down": "light -U 5"
},
"battery": {
"states": {
"good": 95,
"warning": 30,
"critical": 20
},
"format": "{icon} {capacity}%",
"format-charging": " {capacity}%",
"format-plugged": " {capacity}%",
"format-alt": "{time} {icon}",
"format-icons": [
"",
"",
"",
"",
""
]
},
"tray": {
"icon-size": 21,
"spacing": 10
},
"clock": {
"format": "{: %I:%M %p %d/%m/%Y}",
"on-click": "/usr/bin/plasmawindowed org.kde.plasma.calendar"
},
"cpu": {
"interval": 2,
"format": " {}%",
"max-length": 10,
"on-click": "konsole -e btop"
},
"memory": {
"interval": 2,
"format": " {}%",
"max-length": 10,
"on-click": "konsole -e btop"
},
// Custom modules (some of them courtesy of River WM + modifications)
"custom/launcher": {
"format": " ",
"on-click": "albert show",
"on-click-right": "rofi -show drun"
},
},
{
// Basic infos
"name": "footer",
"position": "bottom",
"height": 32,
"margin-right": 10,
"margin-bottom": 10,
// Disposition
"modules-left": [
"custom/tuitext",
"custom/tuipt",
"custom/stui",
"custom/gpgtui",
"custom/dockertui",
"custom/gitui",
"custom/bandtui"
],
"modules-center": [],
"modules-right": [
"disk",
"bluetooth"
],
// Custom modules
"custom/bandtui": {
"format": "",
"on-click": "konsole -e 'sudo bandwhich'"
},
"custom/gitui": {
"format": "",
"on-click": "konsole -e lazygit"
},
"custom/dockertui": {
"format": "",
"on-click": "konsole -e lazydocker"
},
"custom/gpgtui": {
"format": "",
"on-click": "konsole -e gpg-tui"
},
"custom/stui": {
"format": "",
"on-click": "konsole -e s-tui"
},
"custom/tuipt": {
"format": "",
"on-click": "konsole -e tptable"
},
"custom/tuitext": {
"format": "",
"on-click": "konsole -e lvim"
},
// Integrated modules
"bluetooth": {
"on-click": "plasma-open-settings kcm_bluetooth"
},
"disk": {
"format": "{path} {percentage_used}%",
"on-click": "pcmanfm-qt"
}
// Modules below this line are not yet added and should be considered WIP
}
]
我遗漏了什么?我还尝试添加“独占”和“层”选项,但没有任何结果
我尝试用“exclusive”和“layer”搜索并编辑该文件。我希望底部栏也能避开窗口。
答案1
我使用两个 Waybar 进行了一些测试,我认为您还需要将其插入"layer": top
到与底部栏相关的配置部分,而不仅仅是顶部栏。目前,它假设您没有将选项传递"layer"
给第二个栏。