I'm trying to get my computer to go down to APM suspend and have xscreensaver locked when it wakes up. The following command works fine in xterm:
xscreensaver-command -lock;sudo chvt 1;sudo apm -s. But I'm trying to lock/suspend as a keybinding, configured in Openbox's ~/.config/openbox/rc.xml file. The section looks like:
Code:
<keybind key="C-A-Insert">
<action name="Execute"><execute>COMMAND</action>
</keybind>
I tried putting the bolded command above in as COMMAND, but it just runs the screen locker without changing virtual terminals or suspending. I created a script and tried to run that as COMMAND, but the same thing happens. The script works fine when executed from xterm. What gives?