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

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



On Tue 01 Apr 2014 at 17:53:38 +0530, Anubhav Yadav wrote:

> I used my ~/.profile to export path variable. Here are the contents of
> my ~/.profile:
> 
> 
> # if running bash
> if [ -n "$BASH_VERSION" ]; then
>     # include .bashrc if it exists
>     if [ -f "$HOME/.bashrc" ]; then
>         . "$HOME/.bashrc"
>     fi
> fi

$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?

> 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.


Reply to: