You are not logged in.

#1 2019-12-17 10:30:04

vanrael
Member
Registered: 2019-12-17
Posts: 7

[SOLVED] System tray menu for polybar in bspwm

So I recently decided to try out Arch (I have bspwm as my wm) and have spent quite a considerable amount of time trying to set up my desktop; for the most part, it's coming along nicely. One part i'm currently stuck at is polybar. I have managed to set up a bar with different modules that technically "work." But it all just seems so hacky.. there must be better solutions. For example, my wlan module is as follows

[module/wlan]
interface = wlp0s20f3
interval = 5
label-connected = %{A1:nm-connection-editor:} [icon] %{A}
label-disconnected = %{A1:nm-connection-editor:} [icon] Not Connected%{A}

which brings up nm-connection-editor on left-click. So, this works fine.. but I don't like the fact that it brings up a window rather than just a drop-down menu. So I then came across Stalonetray and it generates some icons that do produce a drop-down menu like I want. Problem is, it doesn't exactly (seem to) integrate at all with polybar. I was wondering if there was anything that perhaps I'm not aware of that would give me the ability to either produce drop-down menus or integrate it with polybar. Or perhaps there's a way to spawn a drop-down list on left-click on a polybar module (similar to calling a script but perhaps spawns a drop-down list)?

Ultimately what I'm after is a drop-down menu for wlan, dropbox, volume, power, etc. And the rest of my modules I'm perfectly happy with. I really like polybars highly customization aspect, so if possible I'd like to stick with it.

Your help is greatly appreciated smile

Last edited by vanrael (2019-12-31 11:48:59)

Offline

#2 2019-12-17 17:26:00

Steef435
Member
Registered: 2013-08-29
Posts: 577
Website

Re: [SOLVED] System tray menu for polybar in bspwm

Welcome to the forums!

Stalonetray is a system tray provider: other applications can populate the tray, it does not provide menus by itself. Polybar should have a builtin system tray as well: see tray-position in the wiki. If you use that instead of stalonetray, polybar should handle positioning properly.

I'm not sure about creating these menus using polybar as I don't use it, maybe someone else does.

Offline

#3 2019-12-17 18:02:24

patrickziegler
Member
From: ::1
Registered: 2018-11-02
Posts: 29
Website

Re: [SOLVED] System tray menu for polybar in bspwm

Polybar has no built-in support for context/drop-down menus inside modules.
It seems what you are looking for are the drop-down menus provided by different applications (network manager, dropbox ...), those are generally available through a tray icon (which polybar can display)

If you are looking for menus that require more manual work to create, have a look at the menu module. Many people also use rofi for drop-down-like menus. For these you will need to specify each entry and the command associated with it yourself

Offline

Board footer

Powered by FluxBB