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

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



> $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.
>
>> # set PATH so it includes user's private bin if it exists
>> if [ -d "$HOME/bin" ] ; then
>>     PATH="$HOME/bin:$PATH"
>> fi
>>
>>
>> PATH=$PATH:$HOME/.rvm/bin # Add RVM to PATH for scripting
>
> It's possible you may want different paths on the console and in X.
>
> 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.
>
>> And then I used ~/.xsesionrc to source ~/.profile. Here are the contents of
>> .xsessionrc:
>>
>> #! /bin/sh
>>
>> if [ -f "$HOME/.profile" ]; then
>>     . "$HOME/.profile"
>> fi
>
> 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.
>
> 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?

My entry is an environment variable. So you suggest that I should
use .xsessionrc to export my $PATH by not my .profile?

>
>> I am the only user of my laptop, but I would love to be an administrator one
>> day and learn how things work in such an environment!
>
> There are many users on your laptop. Have you met 'nobody' yet? A bit
> shy but she can do a lot for you.
>
> You are the administrator of your machine. You are also a user. You have
> two personalities. This "only user of my laptop" is a cop out because it
> places the user's requirements as more important than the system's.
>
I still need to learn those user and groups concepts in linux yet.
It should be next on my to-do list. :)

-- 
Regards,
Anubhav Yadav
Imperial College of Engineering and Research,
Pune.


Reply to: