Re: Need help with PATH variable (i3/debian buster)

2020-07-30 Thread tomas
On Thu, Jul 30, 2020 at 08:46:24AM -0400, Greg Wooledge wrote:
> On Thu, Jul 30, 2020 at 11:56:27AM +0200, to...@tuxteam.de wrote:
> > Sigh. It /used/ to be simple.
> 
> Honestly, it never was [...]

C'm on. At least there was a finite set back then. These days, the
set is infinite, or at least its cardinality is in the realm where
Peano arithmetic isn't contradiction-free anymore ;-P

Cheers
-- t


signature.asc
Description: Digital signature


Re: Need help with PATH variable (i3/debian buster)

2020-07-30 Thread Klaus Singvogel
Greg Wooledge wrote:
> Every type of login follows a completely different set of steps for
> configuring your environment.  Reconciling these and achieving a uniform
> environment across all possible login types is *extremely* difficult,
> if not impossible.

It's more or less a layer model with different entry points into different
layers.

A GUI login performs a login type with more graphical features. Therefore,
when starting a shell is a subprocess of an already performed login, and a
.*login isn't required anymore.

Login on console instead executes the login shell.

Same is for a remote login like SSH (and for the old men: rsh).

And: a .profile (or .rc) is always executed, as it isn't related to
the circumstance, if it's a login process or a subprocess of a login.

Note: I'm starting a tcsh not a bash as my (login) shell. Therefore I'm
writing the file names in a more abstract way to fit for both.

Regards,
Klaus.
-- 
Klaus Singvogel
GnuPG-Key-ID: 1024R/5068792D  1994-06-27



Re: Need help with PATH variable (i3/debian buster)

2020-07-30 Thread Greg Wooledge
On Thu, Jul 30, 2020 at 11:56:27AM +0200, to...@tuxteam.de wrote:
> Sigh. It /used/ to be simple.

Honestly, it never was.  Even in the old days, users had different login
shell options, so if you wanted a consistent environment for csh and sh
users, for example, you had to write two different sets of changes.  And
then there were xdm logins, and remote shell logins, and so on.



Re: Need help with PATH variable (i3/debian buster)

2020-07-30 Thread Greg Wooledge
On Thu, Jul 30, 2020 at 11:21:54AM +0200, Benedikt Tuchen wrote:
> When I use no display manager like lightdm, I start i3 via startx in
> the console. If I do this dmenu and rofi are using my personal $PATH
> variable. For example it includes "$HOME/.local/bin". But when I
> use a display manager, dmenu and rofi do no longer have my personal
> $PATH entries. How can I change this behavior?

Every type of login follows a completely different set of steps for
configuring your environment.  Reconciling these and achieving a uniform
environment across all possible login types is *extremely* difficult,
if not impossible.

With a console login, your session consists of a login shell, with some
variables pre-populated by the login program, and by PAM.  The login
shell then reads various configuration files (in the case of bash, these
include /etc/profile and ~/.profile or possibly others; for other shells,
other files are read).

With a "regular" Display Manager login (lightdm, xdm, and so on), your
session is *not* a login shell, nor does it ever at any time include
a login shell, so files like /etc/profile and ~/.profile are never read.
At all.

With a GNOME (gdm3) login, you have *two* different session types: Wayland
or X11.  When gdm3 runs an X11 session, it's similar to the "regular" DM
from the previous paragraph.  However, when it runs a Wayland session,
a whole different set of configs is used.  I've never run Wayland in my
life, but people have said that the Debian Wayland session reads login
shell config files.  I don't know whether that's true, or which shell is
reading them, at what time, or anything.  You'll have to figure that out.

But you said lightdm and i3, not GNOME.  So we can skip all of the GNOME
horror for now.  And please believe me, there are *more* layers of GNOME
horror that I'm omitting here.  It's so much worse than you thought.

A lightdm login running a standard Debian X session reads one additional
file that is unique to Debian: ~/.xsessionrc .  You can configure
environment variables like PATH here, and they will be read and respected
by anything that runs a standard Debian X session.

See also .


Now, after all of that, you still need to consider what your Desktop
Environment does to your environment.  You may go through all of these
steps to set your environment *just* how you like it, only to find out
that in the end, your DE takes over, wipes out some variables, and
changes others.

I suspect i3 is much more traditional and hands-off about it, but I've
never used i3, so I can't say for sure.  You may be totally fine with
just the knowledge contained in this post.  But if you find that some
variables work and others simply do not, it might be because i3 is
resetting them.  It's just a thing to keep in mind.



Re: Need help with PATH variable (i3/debian buster)

2020-07-30 Thread tomas
On Thu, Jul 30, 2020 at 11:21:54AM +0200, Benedikt Tuchen wrote:
> Hello,
> 
> I got some strange behavior with my PATH variable and maybe somebody
> here can help me with this.
> 
> When I use no display manager like lightdm, I start i3 via startx in
> the console. If I do this dmenu and rofi are using my personal $PATH
> variable. For example it includes "$HOME/.local/bin". But when I
> use a display manager, dmenu and rofi do no longer have my personal
> $PATH entries. How can I change this behavior?
> 
> I've tried to find a solution for this but didn't found one. Maybe
> someone here know exactly what to do.

The short (but sometimes inaccurate) answer: ~/.xsession --  this is
(very roughly) the X Session equivalent to your ~/.profile and its
ilk.

The longer answer: man Xsession (5). Depending on whether you use a
desktop environment (and on how badly it has brutalised your X setup),
you'll have to find out what is missing where.

Look around /etc/X11/Xsession.options and /etc/X11/Xsession.d/* --
there is the machinery which decides whether and how to load your
personal X session stuff in ~/.xsession.

Sigh. It /used/ to be simple.

Cheers
-- t


signature.asc
Description: Digital signature


Need help with PATH variable (i3/debian buster)

2020-07-30 Thread Benedikt Tuchen
Hello,

I got some strange behavior with my PATH variable and maybe somebody
here can help me with this.

When I use no display manager like lightdm, I start i3 via startx in
the console. If I do this dmenu and rofi are using my personal $PATH
variable. For example it includes "$HOME/.local/bin". But when I
use a display manager, dmenu and rofi do no longer have my personal
$PATH entries. How can I change this behavior?

I've tried to find a solution for this but didn't found one. Maybe
someone here know exactly what to do.

Greetings,

Benedikt


signature.asc
Description: PGP signature