[openbox] autostart.sh and bashrc

Anthony Thyssen A.Thyssen at griffith.edu.au
Fri Jun 29 00:54:32 EDT 2012


On Thu, 28 Jun 2012 21:18:27 -0700
Ian Zimmerman <itz at buug.org> wrote:
| 
| jimmy> As a general principle, environment variables should go in
| jimmy> ~/.profile or a similar file, while .bashrc is for bash-specific
| jimmy> non-environment related things like setting aliases, prompts,
| jimmy> shell options, etc.
| 
| jimmy> Move your environment variables (i.e. the ones you have to
| jimmy> export) to .profile, keeping the syntax portable as more shells
| jimmy> than just bash read it, and see if that works.
| 
| This thread went a bit off-topic, but anyway what I do is keep a
| separate file ~/.environment, and source it from multiple places:
| 
| ~/.profile
| ~/.bash_profile
| ~/.xsession
| 
| also, I link to it from ~/.ssh/environment which means I get the vars
| even when I work remotely ...
| 

That only works if you do not need to 'figure out' or 'program' the
environment.  Environments are not static. They change with time!

Also .profiles and .bashrc do a lot more than just set environment
variables and shell specific variables.

Command aliases (yuck) or wrapper functions (better).
checks on network, disk space.
home and cache file cleanup
mail checks,
etc etc etc.


PS: I also use a environment file to set most of my fixed environment
variables.

Though the filename I use includes the hostname as sometimes the home
is a shared mount across multiple machines, OR was copied from some
other machine, (or virtual server).  And yes I have seen all these
things! Multi-machine shared homes can very difficult to handle!

I also create this file using a personal "set_environment" script, and
re-create it automatically when the script is newer or file does not exist.

BUT as I mentioned it does not set everything.
Some env variables are also 'where am i' dependant, rather than fixed.
For example: set what printer to use.


  Anthony Thyssen ( System Programmer )    <A.Thyssen at griffith.edu.au>
 --------------------------------------------------------------------------
    "The avalanche has already started.
     It is too late for the pebbles to vote."    -- Ambassador Kosh
 --------------------------------------------------------------------------
   Anthony's Castle     http://www.ict.griffith.edu.au/anthony/


More information about the openbox mailing list