You are not logged in.
I'm using OpenBox 3.5.0 with PCManFM to manage my desktop, I would like to add "New File" and "New Folder" options in the OpenBox menu. From my terminal the following command works fine, however it does not work in the OpenBox menu. When run from OpenBox the Zenity dialog never shows up.
mkdir ~/Desktop/$(zenity --entry --text="Folder Name:")<item label="New Folder">
<action name="Execute">
<command>
mkdir ~/Desktop/$(zenity --entry --text="Folder Name:")
</command>
</action>
</item>(I do know I could put it in a script and have OpenBox execute that script, but I would rather it was just a single line in my menu.xml)
Last edited by PSW (2011-09-22 12:36:05)
Offline
What (I guess) openbox does: content of <command> is taken as a string, broken up in tokens and then executed with some kind of exec function (man 3 exec).
Whay you want: system("<command>"), which gives this stuff to a shell.
So try:
<item label="New Folder">
<action name="Execute">
<command>
sh -c "mkdir ~/Desktop/$(zenity --entry --text="Folder Name:")"
</command>
</action>
</item>Offline
What (I guess) openbox does: content of <command> is taken as a string, broken up in tokens and then executed with some kind of exec function (man 3 exec).
Whay you want: system("<command>"), which gives this stuff to a shell.
So try:<item label="New Folder"> <action name="Execute"> <command> sh -c "mkdir ~/Desktop/$(zenity --entry --text="Folder Name:")" </command> </action> </item>
Sadly, this makes no difference.
<item label="New Folder">
<action name="Execute">
<command>
zenity --entry --text="Folder Name:"
</command>
</action>
</item>Works, and mkdir works. It's just when put together they fail =/
Last edited by PSW (2011-09-23 10:44:21)
Offline
It's the "" inside the $() ...
<item label="New Folder">
<action name="Execute">
<command>
sh -c "mkdir ~/Desktop/$(zenity --entry --text='Folder Name:')"
</command>
</action>
</item>works for me. Normally quoting stuff inside $() is totally ok. So i think this is a bug in openbox.
Offline
Just confirmed it by using
strace -o foo.bar -f -p $(pidof openbox) -s 1000In foo.bar you see this:
execve("/bin/sh", ["sh", "-c", "mkdir $(zenity --entry --text=Folder", "Name:)"]which should be:
execve("/bin/sh", ["sh", "-c", "mkdir $(zenity --entry --text='Folder Name:')"]Offline
One other thing: escaping quotes works as well ![]()
--text=\"Folder Name:\"
Offline
Thanks guys, all working now.
Offline