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

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



On Sun, Mar 30, 2014 at 10:34 PM, Dmitrii Kashin <freehck@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.


Reply to: