Alexays / Waybar

Highly customizable Wayland bar for Sway and Wlroots based compositors. :v: :tada:
MIT License
6.69k stars 709 forks source link

bug(sway/workspaces): workspace buttons not showing #3163

Open haug1 opened 6 months ago

haug1 commented 6 months ago

Sometimes workspaces are not showing on the monitor it belongs to. For some reason it only consistently happens on one of my monitors in my home office setup where 2 monitors are connected through a thunderbolt dock. Also for some reason, when I use way-displays to handle my displays, there is no problem on the same setup. If I use kanshi, the problem occurs.

For reference, here is my kanshi and way-displays configuration for said setup, I'm guessing it could have something to do with positioning:

kanshi:

profile dock {
  output eDP-1 disable
  output "LG Electronics LG HDR 4K 0x00074879" {
    enable
    scale 1.7
    position -2259,0
  }
  output "ASUSTek COMPUTER INC ROG PG27V K3LMQS069452" {
    enable
    scale 1.2
    position 0,0
  }
} 

way-displays:

ARRANGE: ROW
ALIGN: LEFT
AUTO_SCALE_MAX: 1.7
ORDER:
  - "LG HDR 4K"
  - "ROG PG27V"
VRR_OFF:
  - "LG HDR 4K"
  - "ROG PG27V"
LOG_THRESHOLD: INFO
DISABLED:
  #- "ROG PG27V"
  #- "LG HDR 4K"
  - eDP-1
haug1 commented 6 months ago

After a little more experimentation, I'm pretty sure I've pinned down the problem to relate to the negative positioning on X axis of my one monitor. With these changes the problem is no longer occuring:

+++ b/stow/.config/kanshi/config
@@ -1,31 +1,31 @@
 profile dock {
   output eDP-1 disable
   output "LG Electronics LG HDR 4K 0x00074879" {
     enable
     scale 1.7
-    position -2259,0
+    position 0,0
   }
   output "ASUSTek COMPUTER INC ROG PG27V K3LMQS069452" {
     enable
     scale 1.2
-    position 0,0
+    position 2258,0
   }
 }

UPDATE: Now I think it's not related to negative positioning. Suddenly the issue is happening again after config change. It has still only happened while using kanshi and not way-displays, but I don't know anymore, maybe even that is just coincidental.

spikespaz commented 6 months ago

This is now happening to me on Hyprland after an update yesterday. I have no workspace buttons, under any condition; they're just gone.

TheSunCat commented 6 months ago

This seems related to Hyprland moving its socket directory, at least from the Waybar logs:

Hyprland IPC: Couldn't connect to /tmp/hypr/62ae2b3f40ffce99e1d94384800e9eba6638f447_1714723806_1223999769/.socket.sock.

Hyprland now uses $XDG_RUNTIME_DIR/hypr rather than /tmp/hypr (if the dir exists). See this commit: https://github.com/hyprwm/Hyprland/commit/a5a648091760ac002120fab18247e5292b6482de

haug1 commented 6 months ago

Your issue is probably unrelated to this one.

TheSunCat commented 6 months ago

You're right, my bad! I'll open a separate issue for this.

apiraino commented 5 months ago

Confimed on Sway with Waybar v0.10.3 and kanshi 1.5.1. I'm pretty sure it depends on kanshi rearranging windows after a monitor setup change.

Relevant kanshi config

``` profile two_monitors { output "WOR TERRA LED2211 22129TB000514" position 0,0 mode 1920x1080 output "LG Display 0x0521 Unknown" position 320,1080 mode 1920x1080 exec swaymsg workspace 2, move workspace to '"WOR TERRA LED2211 22129TB000514"' } profile single { output "LG Display 0x0521 Unknown" position 0,0 mode 1920x1080 } ```

I kind of can reproduce this with:

  1. Starting situation:
    • laptop single monitor
    • one window in workspace 2
    • no other active Waybar workspaces
  2. Plug an external monitor
    • workspace 1 is created on laptop monitor and stays empty (correct)
    • kanshi moves the window to workspace 2 (correct)
    • workspace 2 has no number indicator (bug)

Notes:

I think the culprit here is the kanshi directive move workspace happening slightly after the monitor setup change. For some reason Waybar does not "see" this change. No idea why, must be some Sway machinery :shrug:

bruceblore commented 5 months ago

I'm not sure if my issue is related, but for me, the workspace buttons are consistently shown as configured on workspaces with no windows, and disappear once the workspace isn't empty. That seems to be the only factor with my setup

apiraino commented 5 months ago

cc @Alexays if you have insights to share here (thanks!)

nordewal commented 1 month ago

I am experiencing the exact same issue and was wondering whether this is still on the radar?

kanshi 1.7.0-1
sway 1:1.9-5
waybar 0.11.0-3