SEARCH

Enter your search query in the box above ^, or use the forum search tool.

You are not logged in.

#1 2013-11-21 15:45:30

joelgm
Member
Registered: 2013-11-10
Posts: 15

Openbox keyboard shortcut question

I'm trying to setup a keyboard shortcut to quickly shutdown crunchbang.

The combo I want is Ctrl-Super-S. I added the following to rc.xml, so it looks like:

    <keybind key="W-A-Right">
      <action name="Execute">
        <command>cb-aerosnap --right</command>
      </action>
    </keybind>
    
    <!-- Joel's custom key bindings -->
	<keybind key="C-W-s">
	  <action name="Execute">
		<command>'/usr/bin/sudo /sbin/shutdown -h now'</command>
	  </action>
	</keybind>
  </keyboard>

When I press the combo, I get a popup, stating "Openbox: Failed to execute child process '/usr/bin/sudo /sbin/shutdown -h now' (No such file or directory). I've already given permissions in sudo, to my username, to shutdown without a password. Invoking the same command from a terminal works fine.

What seems to be the mistake?

Last edited by joelgm (2013-11-21 15:46:35)

Offline

Help fund CrunchBang, donate to the project!

#2 2013-11-21 16:05:34

cup_of_squirrel
#! CrunchBanger
From: New York City
Registered: 2013-08-29
Posts: 141

Re: Openbox keyboard shortcut question

Isn't the command just this?

sudo shutdown -h now

No need to go to the /sbin or /usr/bin directory at all

Offline

#3 2013-11-21 16:14:46

joelgm
Member
Registered: 2013-11-10
Posts: 15

Re: Openbox keyboard shortcut question

cup_of_squirrel wrote:

Isn't the command just this?

sudo shutdown -h now

No need to go to the /sbin or /usr/bin directory at all

That was the first format I tried. It had the same error message. I tried solving it by using the full path (as required by cron).

Offline

#4 2013-11-21 21:05:42

cup_of_squirrel
#! CrunchBanger
From: New York City
Registered: 2013-08-29
Posts: 141

Re: Openbox keyboard shortcut question

Ah. Could try this:

gksudo shutdown -h now

(gksudo displays a graphical password input box, instead of opening a terminal)

or

terminator --command="sudo shutdown -h now"

Offline

Board footer

Powered by FluxBB

Copyright © 2012 CrunchBang Linux.
Proudly powered by Debian. Hosted by Linode.
Debian is a registered trademark of Software in the Public Interest, Inc.

Debian Logo