Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Using Environment Variables in Openbox Keybindings
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Desktop Environments
View previous topic :: View next topic  
Author Message
Xander314
n00b
n00b


Joined: 16 Apr 2012
Posts: 48

PostPosted: Sat Mar 01, 2014 1:43 pm    Post subject: Using Environment Variables in Openbox Keybindings Reply with quote

I am setting up keybindings for openbox, several of which will run Chrome (browser as well as mail, calendar etc as webapps). But down the line I might want to change my browser, so I tried setting a BROWSER environment variable and then putting this in rc.xml:
Code:

<keybind ...>
  <action name="Execute">
    <command>$BROWSER</command>
  </action>
</keybind>


But Openbox complains at this, saying that it can't execute the command "$BROWSER". I have checked that the variable is non empty, so it seems the problem is that OpenBox doesn't accept environment variables in keybind commands. Is there some way I can make Openbox interpret the environment variable correctly?

EDIT: I'm using the following workaround, but surely there's a better way...
Code:

<keybind ...>
  <action name="Execute">
    <command>~/bin/env-launch.sh "BROWSER"</command>
  </action>
</keybind>

env-launch.sh:
Code:

eval command=\$$1
$command
Back to top
View user's profile Send private message
BitJam
Advocate
Advocate


Joined: 12 Aug 2003
Posts: 2455
Location: Silver City, NM

PostPosted: Sat Mar 08, 2014 1:47 am    Post subject: Reply with quote

This post suggests you set the environment variables in ~/.config/openbox/environment. I don't know if this will work for you and if it does work I don't know if it will solve your problem.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Desktop Environments All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum