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

2014-04-04 Thread Brian
On Thu 03 Apr 2014 at 00:19:50 +0100, Brian wrote:

 The interesting aspect is that ~/.xsessionrc is sourced by Xsession
 before 50x11-common_determine-startup is sourced. I'd interpret that as
 having the environment set up before X starts.

As to why we have 40x11-common_xsessionrc; it started life with #411639:

  https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=411639

 Apparently, there is no file at all where a number of environment
 variables can be exported (e.g. PATH) and which will retain their value
 during the whole X session.
 ~/.xsession is not a good option since it requires e.g. exec startkde
 to be there at the end, while the choice of DE is already taken care of
 by e.g. gdm (login manager), and more  specifically /etc/gdm/Xsession.
 ~/.bashrc or ~/.bash_profile don't work either, since all shells in
 which the Xsession scripts run seem to be sh shells. ~/.profile isn't an
 option since the shells aren't login shells.
 It seems to me that an extra file similar to 
/etc/X11/Xsession.d/30x11-common_xresources
 would be an interesting  option. This file should source a certain file
 in the user's home dir (e.g. ~/.xprofile ?) in such a way that all
 variable declarations there are exported to the whole X session which
 shall be launched by another Xsession.d script.

The arguments involving ~/.xsession, ~/.bashrc, ~/.bash_profile and
~/.profile deserve some thought.

Having settled the question on what the purpose of ~/.xessionrc is there
is another interesting aspect arising from its existence. I'm a bit
concerned that it is indeed not forbidden to put other things in it.
Leaving aside bugs which might arise and using startx

  xrdb -merge $HOME/.Xresources

or

  exec /usr/bin/fvwm

seem innocent enough. But are they? Xsession.options(5).


-- 
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: https://lists.debian.org/20140404114953.gw3...@copernicus.demon.co.uk



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

2014-04-02 Thread Brian
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.


-- 
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: https://lists.debian.org/20140402162604.gq3...@copernicus.demon.co.uk



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

2014-04-02 Thread Anubhav Yadav
 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?


echo $BASH_VERSION
4.2.37(1)-release

So it's not empty.


-- 
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: 
https://lists.debian.org/ca+jf9agntdyetqf0a_vyxhtzsmmymx5yvjxc6m13atqwy3v...@mail.gmail.com



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

2014-04-02 Thread Brian
On Wed 02 Apr 2014 at 23:30:10 +0530, Anubhav Yadav wrote:

  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?
 
 
 echo $BASH_VERSION
 4.2.37(1)-release
 
 So it's not empty.

It is when ~/.profile is sourced from ~/.xsessionrc. The testing
procedure is available on request but any response from me may be
very slow to arrive due to the deep thought I am giving as to why
'export PATH=$HOME/bin:$PATH' in ~/.xsessionrc should not be the
the definitive, untroublesome, uncomplicated and trustworthy way
of getting a path set with lightdm.

If you or anyone else have any thoughts on this it would be most
welcome.


-- 
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: https://lists.debian.org/20140402183346.gs3...@copernicus.demon.co.uk



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

2014-04-02 Thread Andrei POPESCU
On Mi, 02 apr 14, 17:26:04, Brian wrote:

   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.
  
Sure, otherwise I might end with different paths on the console and in X 
and I don't want that ;)

   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?
 
There is not much more in the default ~/.profile and if I put something 
there I expect to have it in any environment I may find myself working.

 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.
 
Because whenever you need changes relevant for both the console and X 
you have to edit two files instead of one?
 
 It would be good if the benefits of sourcing .profile from .xesessionrc
 compared to putting the path into .xesessionrc were explained.
 
As far as I know there is no canonical way, method, etc. Personally I'm 
using ~/.xsessionrc to source ~/.profile because:

 * the DM is not doing it
 * I don't want to duplicate what ~/.profile already does

Hope this helps,
Andrei
-- 
http://wiki.debian.org/FAQsFromDebianUser
Offtopic discussions among Debian users and developers:
http://lists.alioth.debian.org/mailman/listinfo/d-community-offtopic
http://nuvreauspam.ro/gpg-transition.txt


signature.asc
Description: Digital signature


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

2014-04-02 Thread Anubhav Yadav
On Thu, Apr 3, 2014 at 12:03 AM, Brian a...@cityscape.co.uk wrote:
 On Wed 02 Apr 2014 at 23:30:10 +0530, Anubhav Yadav wrote:

  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?
 

 echo $BASH_VERSION
 4.2.37(1)-release

 So it's not empty.

 It is when ~/.profile is sourced from ~/.xsessionrc. The testing
 procedure is available on request but any response from me may be
 very slow to arrive due to the deep thought I am giving as to why
 'export PATH=$HOME/bin:$PATH' in ~/.xsessionrc should not be the
 the definitive, untroublesome, uncomplicated and trustworthy way
 of getting a path set with lightdm.

 If you or anyone else have any thoughts on this it would be most
 welcome.


No I got no problems with your solution, I only wanted to ask you that
should I let this part:

# set PATH so it includes user's private bin if it exists
if [ -d $HOME/bin ] ; then
PATH=$HOME/bin:$PATH
fi

Still be in .profile or should I delete it from it? If I am already
exporting my PATH in .xsessionrc
in one single line using export command just as you said.

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


-- 
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: 
https://lists.debian.org/CA+Jf9AHn0EM-zz7=f+eujdg-zwgzmq+czl5p7gnm-dpmsam...@mail.gmail.com



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

2014-04-02 Thread Brian
On Wed 02 Apr 2014 at 22:59:18 +0300, Andrei POPESCU wrote:

 As far as I know there is no canonical way, method, etc. Personally I'm 
 using ~/.xsessionrc to source ~/.profile because:
 
  * the DM is not doing it
  * I don't want to duplicate what ~/.profile already does

The interesting aspect is that ~/.xsessionrc is sourced by Xsession
before 50x11-common_determine-startup is sourced. I'd interpret that as
having the environment set up before X starts.

Now /etc/X11/Xsession.d/40x11-common_xsessionrc has

 #Source user defined xsessionrc (locales and other environment variables)

for the intended file usage but it does not specify how the environment
variables are obtained. Looked at it in that light

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

would be ok. I'm happy that seems to reconcile our apparently different
conceptions of what ~/.xsessionrc is used for.

With a default ~/.profile there should be no problems with this but
users are entitled to alter the file. This would be the bit I'd still be
unhappy with. However, this method, although I cannot see myself using
it, does compensate for what the DM is not doing.

If we kept in mind that X is just another program which can be run I
think I would rather rely on telling it directly what to do than rely on
whatever vagaries may lurk in another file.


  



-- 
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: https://lists.debian.org/20140402231950.gu3...@copernicus.demon.co.uk



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

2014-04-02 Thread Brian
On Thu 03 Apr 2014 at 02:12:25 +0530, Anubhav Yadav wrote:

 No I got no problems with your solution, I only wanted to ask you that
 should I let this part:
 
 # set PATH so it includes user's private bin if it exists
 if [ -d $HOME/bin ] ; then
 PATH=$HOME/bin:$PATH
 fi
 
 Still be in .profile or should I delete it from it? If I am already
 exporting my PATH in .xsessionrc
 in one single line using export command just as you said.

Leave it. Do not delete it.


-- 
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: 
https://lists.debian.org/03042014002035.9f494f9d2...@desktop.copernicus.demon.co.uk



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

2014-04-02 Thread Anubhav Yadav
 Leave it. Do not delete it.

Thanks! Mission accomplished.



 --
 To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org
 with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
 Archive: 
 https://lists.debian.org/03042014002035.9f494f9d2...@desktop.copernicus.demon.co.uk




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


-- 
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: 
https://lists.debian.org/ca+jf9aer-21uesrqapgh6orp1xyowq5zolwoefyrdwcteqi...@mail.gmail.com



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

2014-04-01 Thread Brian
On Tue 01 Apr 2014 at 01:45:59 +0530, Anubhav Yadav wrote:

  Lightdm also uses /etc/X11/Xsession, which does a lot more than starting
  a window manager. However, it does source ~/.xsession.
 
 I created an .xsession and the contents were as follows:
 
 #!/bin/bash
 # Set PATH
 PATH=$HOME/bin:$PATH

The basic problem is that lightdm in Debian hard-codes the path

  https://launchpadlibrarian.net/94971962/01_set-default-path.patch

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.

If line above is the only line in your .xsession you would be very lucky
to get any WM up and running.

A working .xsession (after reverting all you have done in /etc/lightdm
and elsewhere) is executable and would contain

  export PATH=$HOME/bin:$PATH
  xterm 
  exec /usr/bin/i3

Personally I would follow the suggestion given in

  https://lists.debian.org/debian-user/2014/03/msg01691.html

to use .xsessionrc to hold 'export PATH=$HOME/bin:$PATH' because it is
an environment variable. Please see Xsession(5)
 
 Yet I am not able to call my i3exit script ( which I have stored in
 ~/bin directory)
 from i3. Because somehow the PATH variable is not set according to either i3
 or according to lightdm. I also have other problems with lightdm, which I 
 would
 like to discuss but lets stay on the topic for now.

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.


-- 
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: https://lists.debian.org/20140401090410.gl3...@copernicus.demon.co.uk



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

2014-04-01 Thread Anubhav Yadav
 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.


-- 
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: 
https://lists.debian.org/CA+Jf9AH6TJ9QMzF4gXn3itHXko_bZSmRd22YMM=bko1mvzm...@mail.gmail.com



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

2014-04-01 Thread Brian
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.


-- 
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: https://lists.debian.org/20140401193740.go3...@copernicus.demon.co.uk



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

2014-04-01 Thread Anubhav Yadav
 $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.


-- 
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: 
https://lists.debian.org/ca+jf9afdmvgiedfui5znmcw0l2usra_bpyj8baug_oud1us...@mail.gmail.com



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

2014-04-01 Thread Brian
On Wed 02 Apr 2014 at 03:30:20 +0530, Anubhav Yadav wrote:

  Is your entry a locale or an environment variable?
 
 My entry is an environment variable. So you suggest that I should

It is neither. Environment variables look like this

  SOMETHING=

 use .xsessionrc to export my $PATH by not my .profile?

At the risk of overstating the argument:

Problem: lightdm hard-codes a path which does not include ~/bin.

Solution No. 1: Source ~/.profile in ~/.xsessionrc.
Solution No. 2: Put 'export PATH=$HOME/bin:$PATH' in ~/.xsessionrc.

The first solution gives a path including ~/bin. It also reloads an
already loaded file, which is a waste of time, and loads other things
which may or not be wanted. It achieves its ends with a scattergun
approach. It works but that is about all which can said of it.

The second solution also gives a path including ~/bin but its technique
is surgical. It does exactly one thing and does it well. There are no
side effects and the outcome is completely predictable.

What you choose is up to you.


-- 
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: https://lists.debian.org/20140401223320.gp3...@copernicus.demon.co.uk



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

2014-04-01 Thread Anubhav Yadav
 Solution No. 1: Source ~/.profile in ~/.xsessionrc.
 Solution No. 2: Put 'export PATH=$HOME/bin:$PATH' in ~/.xsessionrc.

 The first solution gives a path including ~/bin. It also reloads an
 already loaded file, which is a waste of time, and loads other things
 which may or not be wanted. It achieves its ends with a scattergun
 approach. It works but that is about all which can said of it.

 The second solution also gives a path including ~/bin but its technique
 is surgical. It does exactly one thing and does it well. There are no
 side effects and the outcome is completely predictable.

 What you choose is up to you.

I got you, just one last question, Should I modify my .profile?
More precisely, should I remove the exporting of PATH in .profile?

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


-- 
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: 
https://lists.debian.org/CA+Jf9AFB3j8sCRBM=S73Et==tpnaeph9kydgztvnwmbufqa...@mail.gmail.com



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

2014-04-01 Thread Andrei POPESCU
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).

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

And it's also possible one might not ;)

 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?

  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.
 
Which purpose is that?

 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 :)

Kind regards,
Andrei
-- 
http://wiki.debian.org/FAQsFromDebianUser
Offtopic discussions among Debian users and developers:
http://lists.alioth.debian.org/mailman/listinfo/d-community-offtopic
http://nuvreauspam.ro/gpg-transition.txt


signature.asc
Description: Digital signature


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

2014-03-31 Thread Anubhav Yadav
 Okay, I got you.

 First of all, if you want your i3wm to have the right PATH variable, you
 should set it before him to run, i.e. in ~/.xsession file. Here's my

Right now I have lightdm installed. In my lightdm.conf file I have this
setting:
user-session: i3

And lightdm starts my i3.

So If I make a .~/.xsession will it clash with my setup right now?

I will try your method and report again! Thanks!



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


-- 
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: 
https://lists.debian.org/ca+jf9ahdtuxk19_rp0v37kzuo98jcuyan4bzhugvaead8nh...@mail.gmail.com



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

2014-03-31 Thread Dmitrii Kashin
Anubhav Yadav anubhav1...@gmail.com writes:

 Okay, I got you.

 First of all, if you want your i3wm to have the right PATH variable, you
 should set it before him to run, i.e. in ~/.xsession file. Here's my

 Right now I have lightdm installed. In my lightdm.conf file I have this
 setting:
 user-session: i3

 And lightdm starts my i3.

 So If I make a .~/.xsession will it clash with my setup right now?

No. In case of lightdm the situation seems to be a bit different.

I'm using XDM which uses an old-style variant of loading a graphical
environment. XDM just executes /etc/X11/Xsession script that aims to
start your window manager. In order to do it, it loads different files
From user's home directory. One of them is ~/.xsession.

But lightdm uses the system of profiles that it calls (also)
sessions. If you want to use my solution with lightdm display manager,
you should add a new profile which will execute /etc/X11/Xsession
script.

It will be some kind of this:

-- /usr/share/xsessions/user-defined.desktop --
[Desktop Entry]
Name=user defined session
Exec=/etc/X11/Xsession
---



pgpi9TN0rgZYr.pgp
Description: PGP signature


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

2014-03-31 Thread Brian
On Mon 31 Mar 2014 at 13:56:35 +0400, Dmitrii Kashin wrote:

 Anubhav Yadav anubhav1...@gmail.com writes:
 
  Right now I have lightdm installed. In my lightdm.conf file I have this
  setting:
  user-session: i3
 
  And lightdm starts my i3.
 
  So If I make a .~/.xsession will it clash with my setup right now?
 
 No. In case of lightdm the situation seems to be a bit different.
 
 I'm using XDM which uses an old-style variant of loading a graphical
 environment. XDM just executes /etc/X11/Xsession script that aims to
 start your window manager. In order to do it, it loads different files
 From user's home directory. One of them is ~/.xsession.

Lightdm also uses /etc/X11/Xsession, which does a lot more than starting
a window manager. However, it does source ~/.xsession.

 But lightdm uses the system of profiles that it calls (also)
 sessions. If you want to use my solution with lightdm display manager,
 you should add a new profile which will execute /etc/X11/Xsession
 script.
 
 It will be some kind of this:
 
 -- /usr/share/xsessions/user-defined.desktop --
 [Desktop Entry]
 Name=user defined session
 Exec=/etc/X11/Xsession
 ---

Once you feel you have to alter a system file to do something (which WM
to use?) which affects only one user you have lost it. Your ~/.xsession
is perfectly alright. Adding to /usr/share/xsessions or altering
lightdm.conf are not actions to be taken as a matter of course and are
usually not warranted.

May I suggest though that any mention of .Xdefaults in Debian should be
eradicated. The file name to use is .Xresources. Your stanza works but
it can be deleted because /etc/X11/Xsession loads .Xresources.


-- 
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: https://lists.debian.org/20140331183538.gj3...@copernicus.demon.co.uk



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

2014-03-31 Thread Anubhav Yadav
 Lightdm also uses /etc/X11/Xsession, which does a lot more than starting
 a window manager. However, it does source ~/.xsession.

I created an .xsession and the contents were as follows:

#!/bin/bash
# Set PATH
PATH=$HOME/bin:$PATH

Yet I am not able to call my i3exit script ( which I have stored in
~/bin directory)
from i3. Because somehow the PATH variable is not set according to either i3
or according to lightdm. I also have other problems with lightdm, which I would
like to discuss but lets stay on the topic for now.

 Once you feel you have to alter a system file to do something (which WM
 to use?) which affects only one user you have lost it. Your ~/.xsession
 is perfectly alright. Adding to /usr/share/xsessions or altering
 lightdm.conf are not actions to be taken as a matter of course and are
 usually not warranted.

Yes that's the lesson you taught me when I messed up with my global
.Xresources directory. ( Remember ) :)

I somehow need to get /home/neo1691/bin into my PATH variable before
starting i3, or before starting lightdm.

Thanks for hearing me out!

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


-- 
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: 
https://lists.debian.org/CA+Jf9AHjWfLV2DrpiwZ0jc=y41guk5cc+xyg11z4r0hs5ar...@mail.gmail.com



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

2014-03-30 Thread Dmitrii Kashin

That's my configuration. I suppose it can be useful.

 ~/.i3/config 
# power-mode
mode power {
bindsym s exec sudo /usr/sbin/pm-suspend
bindsym h exec sudo /usr/sbin/pm-hibernate

# back to normal: Enter or Escape
bindsym Return mode default
bindsym Escape mode default
}
--

 /etc/sudoers 
%sudo   ALL=(ALL:ALL) ALL, NOPASSWD: /usr/sbin/pm-hibernate
 /etc/sudoers 


pgp_9lMUH9l7t.pgp
Description: PGP signature


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

2014-03-30 Thread Anubhav Yadav
On Sun, Mar 30, 2014 at 10:34 PM, Dmitrii Kashin free...@freehck.ru wrote:

 That's my configuration. I suppose it can be useful.

  ~/.i3/config 
 # power-mode
 mode power {
 bindsym s exec sudo /usr/sbin/pm-suspend
 bindsym h exec sudo /usr/sbin/pm-hibernate

 # back to normal: Enter or Escape
 bindsym Return mode default
 bindsym Escape mode default
 }
 --

  /etc/sudoers 
 %sudo   ALL=(ALL:ALL) ALL, NOPASSWD: /usr/sbin/pm-hibernate
  /etc/sudoers 

Yes that worked. I mean I am able to open a prompt and type
i3exit suspend
and I am not asked for a password, so the /etc/sudoers thing
worked.

However I am not able to get it work from i3config.

Here is my .i3/config

set $mode_system System (l) lock, (e) logout, (s) suspend, (h)
hibernate, (r) reboot, (Shift+s) shutdown
mode $mode_system {
bindsym l exec --no-startup-id i3exit lock, mode default
bindsym e exec --no-startup-id i3exit logout, mode default
bindsym s exec --no-startup-id i3exit suspend, mode default
bindsym h exec --no-startup-id i3exit hibernate, mode default
bindsym r exec --no-startup-id i3exit reboot, mode default
bindsym Shift+s exec --no-startup-id i3exit shutdown, mode default

# back to normal: Enter or Escape
bindsym Return mode default
bindsym Escape mode default
}
bindsym $mod+Pause mode $mode_system

If I open up a terminal and 'echo $PATH' i get the directory
/home/neo1691/bin in my path.

But if I run this particular command( I got this on the irc)
`tr '\0' '\n' /proc/$(pidof i3)/environ | grep PATH`
I get this:

XDG_SEAT_PATH=/org/freedesktop/DisplayManager/Seat0
PATH=/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games
XDG_SESSION_PATH=/org/freedesktop/DisplayManager/Session0

So I think I need to setup my PATH variable properly so that it i3
can also access it?

I have exported my PATH variable like this in my ~/.bashrc
export PATH=${PATH}:/home/neo1691/bin

However I installed rvm and maybe it installed ~/.profile
which contains this:
# set PATH so it includes user's private bin if it exists
if [ -d $HOME/bin ] ; then
PATH=$HOME/bin:$PATH
fi

And here is my actual $PATH in a terminal session:



-- 
/home/neo1691/bin:/home/neo1691/.rvm/gems/ruby-2.0.0-p451@railstutorial_rails_4_0/bin:/home/neo1691/.rvm/gems/ruby-2.0.0-p451@global/bin:/home/neo1691/.rvm/rubies/ruby-2.0.0-p451/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games:/home/neo1691/.rvm/bin:/home/neo1691/.rvm/bin:/home/neo1691/bin:/home/neo1691/.rvm/bin

As you can see there are almost three occurrences of
/home/neo1691/bin, as well as many duplications of rvm!


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


--
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: 
https://lists.debian.org/ca+jf9ahqp87pcwx6edumwy6ueaao5m3gkyrqv6zeouumrnr...@mail.gmail.com



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

2014-03-30 Thread Dmitrii Kashin
Anubhav Yadav anubhav1...@gmail.com writes:

 So I think I need to setup my PATH variable properly so that it i3
 can also access it?

Okay, I got you.

First of all, if you want your i3wm to have the right PATH variable, you
should set it before him to run, i.e. in ~/.xsession file. Here's my
example:

 
#!/bin/bash

# Set PATH
PATH=$HOME/bin:$PATH

# Load .Xdefaults
if [ -f $HOME/.Xdefaults ]; then
  xrdb -merge $HOME/.Xdefaults
fi

# Start GnuPG daemon
eval $(gpg-agent --daemon)

# Prevent blanking and turning monitor off
xset -dpms
xset s off

# Hide pointer in 5 seconds of idle
unclutter -idle 5 -root 

# Start Window Manager
/usr/bin/i3  wmpid=$!

# Return to XDM when Window Manager has been finished
wait $wmpid


Secondly, you could just use an absolute path to i3exit script in your
i3wm config file.



pgpWQzMhRpk75.pgp
Description: PGP signature


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

2014-03-25 Thread Linux-Fan
On 03/24/2014 03:07 AM, Anubhav Yadav wrote:
 I'm using i3 on debian sid i686.
 Simply I use a shortchut to show the system
 power dailog by i3-nagbar and use mouse to choose the button.
 Beacuse of systemd, when poweroff/suspend the machine, there is no need
 to enter password for a normal user.
 That works for me.
 
 Hi thanks for replying me. But systemd is only implemented completely and not 
 in
 wheezy!
 So I am not looking at systemd unless it gets merged with stable!

What do you mean with systemd is only implemented completely?

As far as I can tell, systemd is available in Debian Wheezy (stable):

[ 0] MAEM ~$ apt-cache policy systemd
systemd:
  Installed: (none)
  Candidate: 44-11+deb7u4
  Version table:
 44-11+deb7u4 0
500 http://ftp.de.debian.org/debian/ wheezy/main amd64 Packages
500 http://security.debian.org/ wheezy/updates/main amd64 Packages

What does the command show on your system?

HTH
Linux-Fan

-- 
http://masysma.ohost.de/



signature.asc
Description: OpenPGP digital signature


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

2014-03-25 Thread Anubhav Yadav
 What do you mean with systemd is only implemented completely?

 As far as I can tell, systemd is available in Debian Wheezy (stable):

 [ 0] MAEM ~$ apt-cache policy systemd
 systemd:
   Installed: (none)
   Candidate: 44-11+deb7u4
   Version table:
  44-11+deb7u4 0
 500 http://ftp.de.debian.org/debian/ wheezy/main amd64 Packages
 500 http://security.debian.org/ wheezy/updates/main amd64 Packages

 What does the command show on your system?

True the package systemd is found on wheezy, however, the point it that it is
introduced in wheezy just for introduction (From what I heard on irc).
It lacks many functionalities like hibernate! I already have given that a try!

Even If I get that to work, only the script would change, not the fact that
i3 is not able to get the script working.


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


-- 
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: 
https://lists.debian.org/CA+Jf9AETs5tZQen3D2LszggZbDjYMPpk1vS2rp31-04=jid...@mail.gmail.com



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

2014-03-25 Thread Linux-Fan
On 03/23/2014 02:44 PM, Anubhav Yadav wrote:
 Hi, I am using debian 64 bit. I use lightdm to start i3. I am trying
 to get the reboot/suspend script work from i3 control mode as follows.
 I have created a script called i3exit , and placed it in ~/bin/
 directory, this directory is my PATH.

[...]

 But when I press $mod+pause the control mod popups appears on the
 i3statusbar and if I press l (lock) nothing happens and the dialogue
 box disappears!
 
 If I open up a terminal and `echo $PATH`, then my folder, ~/bin is seen there.
 But if I run this specific command:
  `tr '\0' '\n' /proc/$(pidof i3)/environ | grep PATH` then the $PATH
 doesn't have the concerned folder.

That might be the source of the problem. Have you tried to tell i3 the
exact path of your script? It might be that i3 is not using the same
$PATH, because your bashrc (like most) possibly begins with

[ -z $PS1 ]  return

to prevent non-interactive evaluation. Should that be the case, you
could add a PATH=$PATH:$HOME/bin before the i3-command which starts your
window manager when you login. It should then appear in
/proc/.../environ properly.

 Also, will adding this line :
 `neo1691 ALL=(ALL) ALL, NOPASSWD: /home/neo1691/bin/i3exit` will stop
 asking passwords if I run i3exit. I just want to make sure of the
 syntax!

I am never really sure of this myself. Last time I tried it, I was
unable to setup sudo to do this directly. Instead, I had to configure an
alias -- my /etc/sudoers.d/50-masysma-mahalt looks like this:

Cmnd_Alias  SHUTDOWN = /usr/bin/mahalt
linux-fan   ALL=NOPASSWD: SHUTDOWN

Be aware, however, that if you make a script you can edit with your
normal user permissions runnable with sudo and no password, you are
effectively removing any security provided by sudo: If anyone gains
control of your account, the script could be edited to just invoke a
root /bin/bash.

 Any ideas will be appreciated. Thanks

I apologize for my previous post, which, reading the actual question,
was not really helpful. I hope this is more informative.

Linux-Fan

-- 
http://masysma.ohost.de/



signature.asc
Description: OpenPGP digital signature


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

2014-03-25 Thread Michael Biebl
Am 25.03.2014 21:43, schrieb Anubhav Yadav:
 What do you mean with systemd is only implemented completely?

 As far as I can tell, systemd is available in Debian Wheezy (stable):

 [ 0] MAEM ~$ apt-cache policy systemd
 systemd:
   Installed: (none)
   Candidate: 44-11+deb7u4
   Version table:
  44-11+deb7u4 0
 500 http://ftp.de.debian.org/debian/ wheezy/main amd64 Packages
 500 http://security.debian.org/ wheezy/updates/main amd64 Packages

 What does the command show on your system?
 
 True the package systemd is found on wheezy, however, the point it that it is
 introduced in wheezy just for introduction (From what I heard on irc).

It's integration is incomplete, that is true and more like a tech-preview.

 It lacks many functionalities like hibernate! I already have given that a try!

That certainly isn't true.


-- 
Why is it that all of the instruments seeking intelligent life in the
universe are pointed away from Earth?



signature.asc
Description: OpenPGP digital signature


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

2014-03-23 Thread iijima yoshino
于 Sun, 23 Mar 2014 19:14:13 +0530
Anubhav Yadav anubhav1...@gmail.com 写道:

 Hi, I am using debian 64 bit. I use lightdm to start i3. I am trying
 to get the reboot/suspend script work from i3 control mode as follows.
 I have created a script called i3exit , and placed it in ~/bin/
 directory, this directory is my PATH.
 
 Here are the contents of the script.
 
 #!/bin/sh
 lock() {
 i3lock
 }
 
 case $1 in
 lock)
 i3lock -d -i /home/neo1691/.i3/i3lock_screen.png -n
 ;;
 logout)
 i3-msg exit
 ;;
 suspend)
 sudo pm-suspend
 ;;
 hibernate)
 sudo pm-hibernate
 ;;
 reboot)
 sudo reboot
 ;;
 shutdown)
 sudo halt
 ;;
 *)
 echo Usage: $0
 {lock|logout|suspend|hibernate|reboot|shutdown} exit 2Not able to
 get the reboot/suspend script work. esac
 
 Next in .i3/config I have added these lines,
 
  set $mode_system System (l) lock, (e) logout, (s) suspend, (h)
 hibernate, (r) reboot, (Shift+s) shutdown
 mode $mode_system {
 bindsym l exec --no-startup-id i3exit lock, mode default
 bindsym e exec --no-startup-id i3exit logout, mode default
 bindsym s exec --no-startup-id i3exit suspend, mode default
 bindsym h exec --no-startup-id i3exit hibernate, mode default
 bindsym r exec --no-startup-id i3exit reboot, mode default
 bindsym Shift+s exec --no-startup-id i3exit shutdown, mode
 default
 
 # back to normal: Enter or Escape
  bindsym Return mode default
  bindsym Escape mode default
  }
  bindsym $mod+Pause mode $mode_system
 
 
 Now if I run i3exit suspend, then my laptop suspends properly. [After
 asking the password]. If I run i3exit lock, then my laptop gets
 locked, without asking for the password.
 
 But when I press $mod+pause the control mod popups appears on the
 i3statusbar and if I press l (lock) nothing happens and the dialogue
 box disappears!
 
 If I open up a terminal and `echo $PATH`, then my folder, ~/bin is
 seen there. But if I run this specific command:
  `tr '\0' '\n' /proc/$(pidof i3)/environ | grep PATH` then the $PATH
 doesn't have the concerned folder.
 
 Also, will adding this line :
 `neo1691 ALL=(ALL) ALL, NOPASSWD: /home/neo1691/bin/i3exit` will stop
 asking passwords if I run i3exit. I just want to make sure of the
 syntax!
 
 Any ideas will be appreciated. Thanks
 
 

I'm using i3 on debian sid i686.
Simply I use a shortchut to show the system
power dailog by i3-nagbar and use mouse to choose the button.
Beacuse of systemd, when poweroff/suspend the machine, there is no need
to enter password for a normal user.
That works for me.


--
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: https://lists.debian.org/20140324035751.47a084f3@debian



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

2014-03-23 Thread Anubhav Yadav
 I'm using i3 on debian sid i686.
 Simply I use a shortchut to show the system
 power dailog by i3-nagbar and use mouse to choose the button.
 Beacuse of systemd, when poweroff/suspend the machine, there is no need
 to enter password for a normal user.
 That works for me.

Hi thanks for replying me. But systemd is only implemented completely and not in
wheezy!
So I am not looking at systemd unless it gets merged with stable!

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


-- 
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: 
https://lists.debian.org/ca+jf9aez5+qrfizii8pes0eoapcu7aqk8opikojyjt7xbs+...@mail.gmail.com