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

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



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/

Attachment: signature.asc
Description: OpenPGP digital signature


Reply to: