joewing / jwm

Joe's Window Manager
http://joewing.net/projects/jwm
MIT License
514 stars 84 forks source link

Q: Using local variables in .jwmrc config file #552

Open maoamid opened 2 years ago

maoamid commented 2 years ago

What is the recommended way to save / reuse local / environment variables in .jwmrc config file ? (I need it to define some custom commands /scripts, theme color palette etc. and reuse it inside all over config file)

joewing commented 2 years ago

I don't believe it's currently possible to set environment variables inside a config file, but it is possible to reference them. So you might be able to just define some from .xinitrc or whatever starts JWM. Adding the ability to set environment variables shouldn't be too hard. I think it would just be a matter of adding a new tag and then having JWM do setenv.

joewing commented 2 years ago

I just wanted to update this since I recently looked into it again. It turns out that environment variables are currently only supported in specific places in the configuration (anything that is a file path). It should be possible to support this in more places without too much work. If that would be useful for anyone I can look into it some more.