SEARCH

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

You are not logged in.

#1 2013-06-09 07:35:39

ohnonot
...again
Registered: 2012-05-22
Posts: 2,205

can openbox's rc.xml and menu.xml take complex shell syntax?

hello,
every now and then i stumble over this when i want the menu or some hotkey to execute some more complex command - for example this

urxvt -fn xft:iris:size=6 -icon /usr/share/icons/AnyColorYouLike/scalable/real_icons/apps/arts.svg -e mocp

or even

gedit $( ps -a -o args | sed -e '/conky -c/!d' -e 's/conky -c//' -e '/sed -e/d' )

both lines work from a terminal.
i tried putting "" around it in rc.xml or menu.xml, but it doesn't help.
it's fairly easy to solve by creating a shell script that is executing that or some such command, so i never bothered, but is it possible?

Last edited by ohnonot (2013-06-09 07:39:22)

Offline

Be excellent to each other!

#2 2013-06-09 07:55:09

pvsage
Internal Affairs
From: North Carolina
Registered: 2009-10-18
Posts: 13,970

Re: can openbox's rc.xml and menu.xml take complex shell syntax?

Single quotes should work with the former, but they won't work with the latter.  I believe (but am not certain) that the latter would work within double quotes if you escape the single quotes, exclamation point, and pipe with backslashes.

Offline

#3 2013-06-09 09:55:30

fatmac
#! Die Hard
Registered: 2012-11-14
Posts: 1,948

Re: can openbox's rc.xml and menu.xml take complex shell syntax?

Would definately be easier to call a script; plus an advantage would be if you wanted to alter a parameter or two.

Offline

#4 2013-06-11 05:03:34

johnraff
nullglob
From: Nagoya, Japan
Registered: 2009-01-07
Posts: 4,148
Website

Re: can openbox's rc.xml and menu.xml take complex shell syntax?

^agreed, a script usually makes things easier, and you don't need to reconfigure openbox after each edit.
Openbox's config files only accept "command + arguments", and you have to escape special characters for xml.

Even so, for very short sections of code that don't seem worth making a script for you can call bash as your command, and everything else as its agument, like this to restart apache:

<execute>urxvt -e bash -c "sudo service apache2 restart &amp;&amp; { echo OK; sleep 2;} || { echo 'ERROR (press a key to close)'; read;}"</execute>

Offline

#5 2013-06-12 18:47:15

ohnonot
...again
Registered: 2012-05-22
Posts: 2,205

Re: can openbox's rc.xml and menu.xml take complex shell syntax?

Offline

#6 2013-06-13 10:17:25

johnraff
nullglob
From: Nagoya, Japan
Registered: 2009-01-07
Posts: 4,148
Website

Re: can openbox's rc.xml and menu.xml take complex shell syntax?

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.
Server: bleh

Debian Logo