LemonBoy/bar

[Feature Request] Allow docking stalonetray into lemonbar

Closed this issue · 6 comments

orbea commented

Would it be possible to make it so that stalonetray (Or another suitable tray if there are any others?) could dock directly into lemonbar so that users could effectively have tray support?

I use a window manager with poor support for most stand alone bars and trays (Spectrwm-3.0.1), lemonbar is one of the few exceptions with the -d flag and it would be rather useful if I could combine it with a tray.

Personally, I run trayer with --expand true, use xprop (to watch for size changes in the trayer window), and use the O formatting command to insert empty space to make room for trayer.

Full trayer command: trayer --edge top --align right --widthtype request --height 18 --tint 0x292b2e --transparent true --expand true --SetDockType true --alpha 0

Full xprop command: xprop -name panel -f WM_SIZE_HINTS 32i ' $5\n' -spy WM_NORMAL_HINTS (prints out WM_NORMAL_HINTS(WM_SIZE_HINTS) <width> whenever <width> changes.

My only problem with this is getting trayer and bar to consistently stack correctly...

orbea commented

Last time I tried trayer I had significant issues with it, but that seems to no longer be the case...

Can you elaborate on what you mean by inserting empty space to make room for trayer? No matter what I try lemonbar always overlaps the trayer window and this does not solve the issue of the tray being on only one workspace since trayer also is not capable of docking into lemonbar or spectrwm.

No matter what I try lemonbar always overlaps the trayer window

They overlap but you can ask bar to put empty space under the trayer window. That is:

⬐begin bar                 ⬐end bar
|...bar...stuff.....|trayer|
       begin trayer⬏       ⬑end trayer

this does not solve the issue of the tray being on only one workspace since trayer also is not capable of docking into lemonbar or spectrwm.

This sounds like you need to either tell your window manger to not manage the trayer window or to make it sticky.

orbea commented

I would suggest you give spectrwm a try so you can understand this a little better, its more minimal than most window managers and there is no where for trayer to dock into. That bar can force itself to do so is a rather unusual feature, but doing so makes it so that it does not play well with a tray that has been reduced to a small floating window. Sure I can change the width of bar, but that doesn't really solve this.

Bar isn't "forcing" anything. It's setting the _NET_WM_WINDOW_TYPE_DOCK hint and relying on the window manager to support EWMH (spectrwm has EWMH support). If you add the --SetDockType true to the trayer command line, it should do the same.

Thank you for this workaround using trayer. I am using it now with i3. However, I had to set --SetDockType to false, or else trayer would be running in an extra line below or above bar. The problem if you set it to false is that trayer sometimes captures the focus, which gives unwanted results. I solved it by using xprop -name panel -f _NET_WM_WINDOW_TYPE 32a -set _NET_WM_WINDOW_TYPE _NET_WM_WINDOW_TYPE_DOCK to make trayer a dock again after it is started.