Running sudo pm-suspend from a keybinding does not work.
I've follows instructions from various guides on how to set up a suspend keybinding.
In my rc.xml file:
Code:
<keybind key="XF86Sleep">
<action name="Execute">
<command>xscreensaver-command -l</command>
</action>
<action name="Execute">
<command>sudo pm-suspend</command>
</action>
</keybind>
The last lines of my /etc/sudoers file:
Code:
jcao219 ALL = NOPASSWD: /usr/sbin/pm-suspend
jcao219 ALL = NOPASSWD: /sbin/shutdown
I verify that I can successfully run "sudo pm-suspend" without being prompted for the root password from the terminal.
When I press the sleep button, only a lockscreen happens. If I take out the lock screen command in the rc.xml file and try pressing the sleep button, nothing happens. How do I get it to work?
---------- Post added at 10:51 PM ---------- Previous post was at 08:54 PM ----------
After I got some help from NewWorld on the IRC channel for Openbox, the problem was solved.
It turns out that, in Fedora, a tty is required to run sudo.
To get everything to work, you have to comment out this line with visudo:
Code:
Defaults requiretty