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

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



> The basic problem is that lightdm in Debian hard-codes the path
>
>   https://launchpadlibrarian.net/94971962/01_set-default-path.patch

Yes now I know why this is happening. Thanks!
>
> and there appears to be no system-wide way to alter it from within
> lightdm. It doesn't matter what WM is used - a *user* has little choice
> but to alter $PATH by employing the facilities provided by X.

Here are some settings that I found in lightdm.conf that may be of
interest here?

# General configuration
#
# start-default-seat = True to always start one seat if none are
defined in the configuration
# greeter-user = User to run greeter as
# minimum-display-number = Minimum display number to use for X servers
# minimum-vt = First VT to run displays on
# user-authority-in-system-dir = True if session authority should be
in the system location
# guest-account-script = Script to be run to setup guest account
# log-directory = Directory to log information to
# run-directory = Directory to put running state in
# cache-directory = Directory to cache to
# xsessions-directory = Directory to find X sessions
# xgreeters-directory = Directory to find X greeters

Anything that can help me? I am interested in the xsessions-directory line

> Personally I would follow the suggestion given in
>
>   https://lists.debian.org/debian-user/2014/03/msg01691.html

Yes that helped me, I am able to now use the script thanks to xsessionrc.

> to use .xsessionrc to hold 'export PATH=$HOME/bin:$PATH' because it is
> an environment variable. Please see Xsession(5)

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

# 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

And then I used ~/.xsesionrc to source ~/.profile. Here are the contents of
.xsessionrc:

#! /bin/sh

if [ -f "$HOME/.profile" ]; then
    . "$HOME/.profile"
fi

> There is another approach: If it was decided by the *administrator* that
> *all* users were to have access to suspending, shutting down etc the
> machine then the script could reside in /usr/local/bin.

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!


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


Reply to: