[openbox] autostart.sh and bashrc

jimmy.wants.no.spam at gmail.com jimmy.wants.no.spam at gmail.com
Tue Jun 12 22:32:38 EDT 2012


On Wed, 13 Jun 2012, 10:10+0800, Ashi <ashi08104 at gmail.com> wrote:
> I add the emacs daemon in the autostart.sh to speed up emacs. However, I
> found the environment variables setted in my bashrc is still not setted in
> the emacs(emacs would get all current environment variables when it
> started). So I guess add the needed environment variables to autostart.sh
> would solve this problem(I've tested, it works). But this solution is a
> little ugly, I want all setting are kept in one place(such as bashrc). Is
> there anyway to get this? 

As a general principle, environment variables should go in ~/.profile or 
a similar file, while .bashrc is for bash-specific non-environment 
related things like setting aliases, prompts, shell options, etc.

Move your environment variables (i.e. the ones you have to export) to 
.profile, keeping the syntax portable as more shells than just bash read 
it, and see if that works.

Emacs-specific settings should go in an emacs-specific configuration 
file and not in bashrc, of course.


More information about the openbox mailing list