Open ModProg opened 10 months ago
Did you have a look at commit 0ea5143? This adds the output name in env var WAYBAR_OUTPUT_NAME when you use the exec command, at first glance at least in image and custom module.
It does not look like it's present for exec-if, although I have not tried that and could be mistaken. But you could check against it in your exec script, and perhaps just output nothing if it doesn't match?
@RobertMueller2 That env var doesn't seem to work, when I have a custom module exec a script to dump env > /tmp/envlog
there are no WAYBAR_*
env vars defined.
@jgarvin it does work for me with the config below.
Might be a bit hard to see, but the script just echos the WAYBAR_TEST_OUTPUT on each of the screens.
{
"layer": "top", // Waybar at top layer
"position": "top", // Waybar position (top|bottom|left|right)
"height" : 50,
"modules-center": ["custom/env"],
"custom/env": {
"format": "env:: {}",
"format-alt": "env: {}",
"exec": "/tmp/test-output.sh",
"exec-on-event": false
},
}
But I can't say if it's working with all possible configs. Would you mind sharing yours?
And which version you are using? This commit mentioned above is not included in 0.9.24 or earlier.
Ah I'm in 0.9.24, since new Ubuntu was released super recently I assumed it would be more up to date, my bad.
This looks very useful and works in exec
. However, I notice that this variable is not set in on-click
etc, it would help if it's also available there.
You can build from 7163752aa07f145e5951e2388b7693e19fc5d446 with this patch if you want on-click
, on-scroll-x
etc. to have WAYBAR_OUTPUT_NAME
.
Thanks!
I want to display a “Sharing Screen!” message on the screen I am currently sharing.
I have set up the necessary code to display a message when I'm sharing any screen, but I'd like to be able to only show it for the screen the current instance of waybar is displayed on (compare “sway/workspaces” for a similar behavior).
Could we have a variable one can use in
custom.exec
andcustom.exec-if
that contains the monitor of the waybar?