Show/hide system tray with clicking #2954
Replies: 1 comment 5 replies
-
Very nice solution! Yeah there is no way to get any kind of runtime information out of polybar. If you don't care about preserving state between restarts, the entire toggle logic could just be a text module with Alternatively, if you are willing to drop the initial hidden state functionality. You could always display the arrow in the [module/tray_toggle]
type = custom/text
label = ">"
click-left = tray_toggle.sh And the But, if you both want the preservation of the state (and optionally different text depending on the state) and a configurable start state, I don't see any way to make it better or more compact than what you already have. |
Beta Was this translation helpful? Give feedback.
-
With the new system tray implementation, I wondered if there is a way to show/hide the system tray on click to keep things tidy.
There is! Combining different features including triggering actions, IPC, and sending signals to scripts.
The gist of my implementation is as follows:
Bar module
Tray Module
Tray toggling module
tray_toggle.sh
This then creates the following effect (I changed the icon in the scripts because github couldn't load the one in the GIF):
I may have overengineered due to the following reasons:
I'm posting here to gauge interest and see if anyone might have a better implementation of this.
Beta Was this translation helpful? Give feedback.
All reactions