[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: [i3]Not able to get the reboot/suspend script work.



On Wed 02 Apr 2014 at 02:16:59 +0300, Andrei POPESCU wrote:

> On Ma, 01 apr 14, 20:37:40, Brian wrote:
> > 
> > $HOME/.bashrc is executed when you log into X. Then its contents are
> > sourced once agiain in your .xsessionrc. A double invocation seems a
> > trifle inelegant.
>  
> Could you please provide a reference for the double invocation? As far 
> as I remember this is not the case with most DMs (and is quite easy to 
> test).

I'll back down on that. ~/.profile tests for $BASH_VERSION, which is
empty. Therefore $HOME/.bashrc isn't sourced through ~/.xsessionrc.
Is this because dash is the shell being used, I wonder?

> > It's possible you may want different paths on the console and in X.
> 
> And it's also possible one might not ;)

It's something to be aware of though.
 
> > It's also possible that portions of your customised .profile relate
> > only to things relevant to the console and which are not needed or
> > wanted in X.
> 
> Which would that be?

An environment variable, a command such a 'mail -s test someone', for
example. It was a general point which was less about what exactly was
extracted and used but a relection on doing something which had no
purpose.  Getting the path from ~/.profile is surely the one and only
reason for sourcing ~/.profile in ~/.xsessionrc. What need is there to
pull in anything else?

> > Four lines. Compare with the single line
> > 
> >   export PATH=$HOME/bin:$PATH
> > 
> > in ~/.xsessionrc. The configuration is aimed exactly at the target. It
> > gives you what you want without having to reuse an existing file which
> > has a different purpose.
>  
> Which purpose is that?

It's described in bash(1). But the point could be made that the path
could be put in ~/.mypathforx and that file sourced from /.xsessionrc.
This would negate the previous points. But then one would have to ask
why bother sourcing a file when the path could be put directly into
~/.xsessionrc.

> > And, if we read /etc/X11/Xsession.d/40x11-common_xsessionrc we see
> > 
> >   #Source user defined xsessionrc (locales and other environment variables)
> > 
> > Is your entry a locale or an environment variable?
> 
> I didn't know it was forbidden to use that file for anything else :)

It is not forbidden to start a window manager from it either but it is
highly inadvisable to do so. For other commands - caveat emptor. :)

It would be good if the benefits of sourcing .profile from .xesessionrc
compared to putting the path into .xesessionrc were explained.


Reply to: