Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.user > #224213

Re: Systemd user environment variables not picked up for me

From Greg Wooledge <wooledg@eeg.ccf.org>
Newsgroups linux.debian.user
Subject Re: Systemd user environment variables not picked up for me
Date 2020-06-29 22:20 +0200
Message-ID <An8pX-F0-1@gated-at.bofh.it> (permalink)
References <AmYTD-3nX-1@gated-at.bofh.it> <An430-6nE-21@gated-at.bofh.it> <An4w1-6MV-5@gated-at.bofh.it> <An86C-jn-9@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Mon, Jun 29, 2020 at 10:37:49PM +0300, Andrei POPESCU wrote:
> So far I've settled to the snippet below in *both* ~/.profile and 
> ~/.xsessionrc (inspired by a similar snippet in /etc/profile):
> 
> 
> if [ -d "$HOME"/.config/environment.d ]; then
>   for i in "$HOME"/.config/environment.d/*.sh; do
>     if [ -r "$i" ]; then
>       set -a
>       . "$i"
>       set +a
>     fi
>   done
> fi
> 
> 
> (improvements welcome)

You can drop the [ -d ] check.  If the directory doesn't exist, the glob
won't expand, and then the [ -r ] check will fail, so nothing will happen.

Back to linux.debian.user | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Systemd user environment variables not picked up for me Thomas Pircher <thp+debian@p5r.uk> - 2020-06-29 12:10 +0200
  Re: Systemd user environment variables not picked up for me Thomas Pircher <thp+debian@p5r.uk> - 2020-06-29 13:10 +0200
  Re: Systemd user environment variables not picked up for me Greg Wooledge <wooledg@eeg.ccf.org> - 2020-06-29 15:40 +0200
    Re: Systemd user environment variables not picked up for me Thomas Pircher <thp+debian@p5r.uk> - 2020-06-29 19:10 +0200
  Re: Systemd user environment variables not picked up for me l0f4r0@tuta.io - 2020-06-29 17:40 +0200
    Re: Systemd user environment variables not picked up for me Greg Wooledge <wooledg@eeg.ccf.org> - 2020-06-29 18:10 +0200
      Re: Systemd user environment variables not picked up for me Thomas Pircher <thp+debian@p5r.uk> - 2020-06-29 19:10 +0200
      Re: Systemd user environment variables not picked up for me Andrei POPESCU <andreimpopescu@gmail.com> - 2020-06-29 22:00 +0200
        Re: Systemd user environment variables not picked up for me Greg Wooledge <wooledg@eeg.ccf.org> - 2020-06-29 22:20 +0200
      Re: Systemd user environment variables not picked up for me l0f4r0@tuta.io - 2020-06-30 08:40 +0200
        Re: Systemd user environment variables not picked up for me Greg Wooledge <wooledg@eeg.ccf.org> - 2020-06-30 14:30 +0200

csiph-web