Qelxiros / lazybar

A lightweight X11 status bar written in Rust. The spiritual successor to polybar, with some inspiration from cnx.
MIT License
6 stars 2 forks source link

Multi Monitor setup #12

Closed Gh0stGames closed 1 month ago

Gh0stGames commented 1 month ago

I cannot figure out how to make the bar appear on both monitors, any ideas how to do so? I've read through all the documentation and customization options, and haven't had any luck.

Qelxiros commented 1 month ago

Multi-monitor configuration is relatively new, and the documentation needs some work. At the moment, a bar can only exist on one monitor, but you can have multiple bars. You can add monitor = <monitor name> under [bar.name] to specify which monitor the bar should use. If you're using a cargo installation, you might have some issues until the next release. If possible, I'd recommend compiling from source using the latest commit. Let me know if you have any questions, and close the issue once you have it working the way you want.

Gh0stGames commented 1 month ago

Okay I uninstalled lazybar and compiled from source, got both bars showing but the right monitor isn't functioning as expected. Windows aren't respecting the margin beneath it. 2024-07-29_07-49

It's possible it could be a Picom issue as well, so I'll investigate that..

Also getting some warnings:

2024-07-29T11:48:47.407Z WARN  [lazybar_core::builders] Error produced by left panel at index 1: X11 error X11Error { error_kind: Window, error_code: 3, sequence: 133, bad_value: 4294967295, minor_opcode: 0, major_opcode: 2, extension_name: None, request_name: Some("ChangeWindowAttributes") }

2024-07-29T11:49:00.802Z WARN  [lazybar_core::builders] Error produced by left panel at index 1: X11 error X11Error { error_kind: Window, error_code: 3, sequence: 148, bad_value: 4294967295, minor_opcode: 0, major_opcode: 20, extension_name: None, request_name: Some("GetProperty") }

2024-07-29T11:49:01.002Z WARN  [lazybar_core::builders] Error produced by left panel at index 1: X11 error X11Error { error_kind: Window, error_code: 3, sequence: 150, bad_value: 4294967295, minor_opcode: 0, major_opcode: 20, extension_name: None, request_name: Some("GetProperty") }

2024-07-29T11:51:12.755Z WARN  [lazybar_core::builders] Error produced by left panel at index 1: X11 error X11Error { error_kind: Window, error_code: 3, sequence: 244, bad_value: 4294967295, minor_opcode: 0, major_opcode: 20, extension_name: None, request_name: Some("GetProperty") }

2024-07-29T11:54:45.033Z WARN  [lazybar_core::builders] Error produced by left panel at index 1: X11 error X11Error { error_kind: Window, error_code: 3, sequence: 322, bad_value: 4294967295, minor_opcode: 0, major_opcode: 20, extension_name: None, request_name: Some("GetProperty") }

And this one when I launch the bar, the bar still shows and functions though:

2024-07-29T12:19:13.678Z ERROR [lazybar_core::parser] Connection refused (os error 111)
Qelxiros commented 1 month ago

Can you send your lazybar config file? What window manager are you using?

Gh0stGames commented 1 month ago

Can you send your lazybar config file? What window manager are you using?

WM: LeftWM and using Picom

Config:

[bars.leftwm_left]
#monitor = "DP-3"
position = ["top"]
height = 36
transparent = true
bg = "#0000"
default_attrs = "default"
margin_left = 2
margin_internal = 50
margin_right = 2
panels_left = ["xworkspaces", "xwindow"]
panels_center = ["clock", "mpd"]
panels_right = ["pulseaudio", "cpu", "memory", "network"]
#ipc = true

[bars.leftwm_right]
monitor = "DP-1"
position = ["top"]
height = 36
transparent = true
bg = "#0000"
default_attrs = "default"
margin_left = 2
margin_internal = 50
margin_right = 2
panels_left = ["xworkspaces", "xwindow"]
panels_center = ["clock", "mpd"]
panels_right = ["pulseaudio", "cpu", "memory", "network"]
#ipc = true

[attrs.default]
bg = "default"
fg = "#ccc"
font = "FiraCode Nerd Font 10"

[attrs.manual]
bg = "manual"

[bgs.default]
style = "bubble_prop"
radius = 0
color = "#000"

[bgs.manual]
style = "bubble"
border = 8
radius = 15
color = "#000"

[panels.xworkspaces]
type = "xworkspaces"
max_width = 100
height = 40
color = "#0095b6"
radius = 0

[panels.xwindow]
type = "xwindow"
attrs = "manual"
max_width = 100

[panels.pulseaudio]
type = "pulseaudio"
attrs = "manual"
ramp = "pa"
ramp_muted = "pa_muted"

[panels.cpu]
type = "cpu"
attrs = "manual"
format = "CPU: %percentage% %"
interval = 10
path = "/proc/stat"

[panels.memory]
type = "memory"
attrs = "manual"
format = "RAM: U:%gb_used%/F:%gb_free%/T:%gb_total%"
interval = 10
path = "/proc/meminfo"

[panels.network]
type = "network"
attrs = "manual"
#if_name = "wlan0"
if_name = "eno1"
format_connected = "<span foreground='#0ff'>%ifname%</span> %essid% %local_ip%"
format_disconnected = "<span foreground='#0ff'>%ifname%</span> <span foreground='#888'>disconnected</span>"

[panels.mpd]
type = "mpd"
progress_bar = true
max_width = 30
strategy = "scroll"
scroll_interval = 1000

[panels.battery]
type = "battery"

[panels.clock]
type = "clock"
attrs = "manual"
precision = "seconds"
formats = ["<span foreground='#0ff'>%Y-%m-%d %T</span>", "<span foreground='#f00'>%Y-%m-%d %T</span>"]
click-left = "cycle"

[panels.separator]
type = "separator"
format = "<span font='FiraCode Nerd Font Mono 13' foreground='#666'>  //  </span>"
dependence = "right"

[panels.first_separator]
type = "separator"
format = "<span font='FiraCode Nerd Font Mono 13' foreground='#666'>  //  </span>"
dependence = "both"

[ramps.pa]
0 = "<span font_size='25pt' rise='-7.5pt'>󰕿</span> "
1 = "<span font_size='25pt' rise='-7.5pt'>󰖀</span> "
2 = "<span font_size='25pt' rise='-7.5pt'>󰕾</span> "

[ramps.pa_muted]
0 = "<span font_size='25pt' rise='-7.5pt'>󰸈</span> "
1 = "<span font_size='25pt' rise='-7.5pt'>󰖁</span> "
Qelxiros commented 1 month ago

I can't reproduce the bug locally (i3), which means that it's probably related to LeftWM. I found a bug with the way I set _NET_WM_STRUT_PARTIAL (fixed in the latest commit), which LeftWM might honor more than i3 does. I'm not sure what's causing your errors; could you send the output of lazybar -b <whatever> -vvv if they persist in the latest version? Thanks!

Qelxiros commented 1 month ago

A few more thoughts:

Gh0stGames commented 1 month ago

I can't reproduce the bug locally (i3), which means that it's probably related to LeftWM. I found a bug with the way I set _NET_WM_STRUT_PARTIAL (fixed in the latest commit), which LeftWM might honor more than i3 does. I'm not sure what's causing your errors; could you send the output of lazybar -b <whatever> -vvv if they persist in the latest version? Thanks!

Okay, it seems to be working on the most recent commit! I also made the bar position a string instead of an array which removed some error messages. Thanks for the support!

Qelxiros commented 1 month ago

No problem! Let me know if you run into any other issues, or if you find yourself wishing for functionality that isn't currently present.

Gh0stGames commented 1 month ago

No problem! Let me know if you run into any other issues, or if you find yourself wishing for functionality that isn't currently present.

One idea would be adding an example on how to configure xworkspaces to the examples/Cargo.toml file. I've got my workspaces setup but struggling a tiny bit to figure out how to put a gray highlight over the non-empty inactive workspaces, so I can tell where I've got windows at. Just been playing around with it for awhile trying every possible config option to get it to work lol

Qelxiros commented 1 month ago

See #13