You need to put the commands into a shell script, make that script executable and then uses this script as the command.
<command>/usr/local/bin/volume_up</command>
The contents of /usr/local/bin/volume_up
#!/bin/sh pactl set-sink-volume alsa_output.usb-Focusrite_Scarlett_2i4_USB-00.multichannel-output +5% & pactl set-sink-volume alsa_output.pci-0000_00_1b.0.analog-stereo +5% & pactl set-sink-volume alsa_output.usb-Focusrite_Scarlett_2i4_USB-00.analog-surround-40 +5%
and make it executable
chmod +x /usr/local/bin/volume_up
The reason is that Openbox is not executing the contents of the command element in a shell instead it tries to execute it directly.
From the documentation for <command>
:
A string which is the command to be executed, along with any arguments to be passed to it. The "~" tilde character will be expanded to your home directory, but no other shell expansions or scripting syntax may be used in the command unless they are passed to the sh command. Also, the & character must be written as & in order to be parsed correctly. is a deprecated name for .
Another benefit is that you can rewrite the script to also be able lower the volume
#!/bin/sh change_volume() { pactl set-sink-volume alsa_output.usb-Focusrite_Scarlett_2i4_USB-00.multichannel-output "$1" pactl set-sink-volume alsa_output.pci-0000_00_1b.0.analog-stereo "$1" pactl set-sink-volume alsa_output.usb-Focusrite_Scarlett_2i4_USB-00.analog-surround-40 "$1" } main() { case "$1" in up) change_volume +5% ;; down) change_volume -5% ;; *) printf "volume <command>\n" printf " up \n" printf " down\n" esac } main "$@"
This would be saved under /usr/local/bin/volume
and would be use like this
<command>/usr/local/bin/volume up</command> <command>/usr/local/bin/volume down</command>