Sorry to resurrect and old post, but this was the first result on Google when searching for this problem.
It's true that environment variables won't work in Openbox's XML configuration files (like rc.xml and menu.xml). You can invoke scripts and use environment variables inside those scripts, but it's unfortunate that you must get a third file involved.
A pseudo-work-around is to use aliases instead of environment variables. As an example, in Openbox's environment file (~/.config/openbox/environment), I defined this alias:
Code: Select all
alias volumectl="pactl set-sink-volume $(pactl list short | grep RUNNING | sed -e 's,^\([0-9][0-9]*\)[^0-9].*,\1,')"
...and now from within rc.xml I can use the commands "volumectl +1%" and "volumectl -1%" to change the volume on the active sink.
So if you can re-think your problem in a way that can use aliases instead of environment variables, you can achieve the same behaviour.
For this particular user, they could define "alias browser=firefox" in the environment file (or whichever browser they wish to run) and just use the "browser" command in rc.xml.