You are not logged in.

#1 2008-11-27 14:17:10

Gullible Jones
Member
Registered: 2004-12-29
Posts: 4,863

How do I make Openbox chain commands?

So, I want to have a menu entry in Openbox which locks my screen and suspends my laptop:

  <item label="Suspend">
    <action name="Execute">
      <command>
      slock; dbus-send --system --print-reply --dest="org.freedesktop.Hal" /org/freedesktop/Hal/devices/computer org.freedesktop.Hal.Device.SystemPowerManagement.Suspend int32:0
      </command>
    </action>
  </item>

Only instead of running slock and then the suspend command, as BASH would if presented with this, it does nothing at all. How do I make it do both?

Offline

#2 2008-11-27 14:19:12

Mr Green
Forum Fellow
From: U.K.
Registered: 2003-12-21
Posts: 5,893
Website

Re: How do I make Openbox chain commands?

would it not be better to make a small script and fire that....?


Mr Green

Offline

#3 2008-11-27 15:38:49

moljac024
Member
From: Serbia
Registered: 2008-01-29
Posts: 2,676

Re: How do I make Openbox chain commands?

Yes, openbox can't execute bash scripts like that. You should either use it as arguments to sh, like so:

sh -c 'slock; dbus-send --system --print-reply --dest="org.freedesktop.Hal" /org/freedesktop/Hal/devices/computer org.freedesktop.Hal.Device.SystemPowerManagement.Suspend int32:0'

Or, like Mr Green said, make your own script somewhere and execute that (I prefer this way)

Last edited by moljac024 (2008-11-27 15:39:33)


The day Microsoft makes a product that doesn't suck, is the day they make a vacuum cleaner.
--------------------------------------------------------------------------------------------------------------
But if they tell you that I've lost my mind, maybe it's not gone just a little hard to find...

Offline

#4 2008-11-27 15:46:16

Gullible Jones
Member
Registered: 2004-12-29
Posts: 4,863

Re: How do I make Openbox chain commands?

Alright, thanks.

Offline

Board footer

Powered by FluxBB