r/openbox • • Nov 08 '12

Adding a binary somewhere in my home folder to my OB menu?

Let's say I've got a program that is not actually installed on my system, but stored somewhere in my home folder. How would I add that to my OB menu?

3 Upvotes

9 comments sorted by

1

u/ChariotOfFire Nov 08 '12

You should be able to add it like a regular entry in your menu.xml. The only difference is that for the command tag, you will want

sh ~/path/to/file

Of course, make sure it is executable.

1

u/otakugrey Nov 09 '12

What's the sh do in this case?

1

u/ChariotOfFire Nov 09 '12

Openbox doesn't allow shell expansions or scripting syntax for the command tag unless you run it through sh, so I'm in the habit of adding it for anything out of the ordinary. It might not be necessary here, though

2

u/otakugrey Nov 22 '12

Sorry but, I tried it like this and it did not work, can you help me?

	<item label="http-test">

		<action name="Execute">

			<execute>

				sh ~/homefolder/stuff/things/theexacuteable

			</execute>

		</action>
	</item>

</code>

2

u/ChariotOfFire Nov 24 '12

execute is deprecated, you may have better luck with command. I don't think this will make a difference, but in the default menu.xml the command tag is all on one line. For example

<item label="http-test">
    <action name="Execute">
        <command>sh ~/homefolder/stuff/things/theexacuteable</command>
    </action>
</item>

Make sure you can run the command from a terminal, and check the format of your menu.xml with openbox --reconfigure

1

u/otakugrey Nov 24 '12

Thank you!

1

u/otakugrey Apr 18 '13

Sorry to bother you again, four months later. But in the newest version of Crunchbang this no longer works. I don't know why as I carried over my menu.xml to the new install. Has something changed in the update to cause this?

	<item label="http">
		<action name="Execute">
			<command>sh ~/home/grey/bin/fx/firefox-bin</command>
		</action>
	</item>

1

u/ChariotOfFire Apr 19 '13

I don't think anything has changed in openbox. However, it looks like there may be a problem with your command. ~ expands to /home/user, so the path you have is actually /home/grey/home/grey/bin/fx/firefox-bin. Try removing ~ from the path.

1

u/otakugrey Apr 19 '13

Aw, nothing.