Re: The same environment variables everywhere
- Date: Mon, 27 Feb 2017 10:56:55 -0600
- From: David Wright <deblis@xxxxxxxxxxxxxxxxx>
- Subject: Re: The same environment variables everywhere
On Mon 27 Feb 2017 at 15:19:27 (+0200), Teemu Likonen wrote:
> tomas@xxxxxxxxxx [2017-02-27 09:12:28+01] wrote:
> > On Mon, Feb 27, 2017 at 09:07:19AM +0100, deloptes wrote:
> >> So I do distinguish between settings for X session and for not X
> >> session - at least two places for the variables. Further more there
> >> are global and user specific ... etc
> > Yes, all of those! But I don't see how that's an answer to the OP's
> > legitimate question: how to keep things that belong together in one
> > place, instead of repeating it in every bit of config?
> Yes. I know ~/.profile, ~/.xsession, systemd units' "Environment=...",
> "systemctl --user import-enviroment" and various other things. I can
> manage. I'm just asking for other ideas on how to handle things
> mentioned in my original post.
> Well, here's the idea of my current setup (not exact copy):
> # Set the usual environment:
> export PATH=...
> export EDITOR=...
> systemctl --user import-enviroment
Is that typo actually in the file?
> . ~/.profile
My profile has side effects. Calling it from ~/.xsession
would repeat them, which would be undesirable.
I would be loath to just chuck everything in one place.
Unpicking an undesirable effect could be very tedious.
> # Start various systemd services:
> systemctl --user start graphical-session.target
> systemctl --user stop graphical-session.target
> Description=The Emacs Operating System
Have you tried putting an EnvironmentFile= in here
(man 5 systemd.service)? You could source the file from
elsewhere if required so that you only need one set of
> ExecStart=/usr/bin/emacs --daemon