Saturday, 13 April 2013

Crunchbang Linux - add a menu option

If you install a new application on Crunchbang you may want to add a shortcut to the menu. In a previous article I wrote about installing Asunder, the audio CD ripping application. As an example I'll explain here how to add Asunder to the Multimedia menu:


Instructions





Right click on the desktop

Click Settings | Openbox | GUI Menu Editor







Click the arrow next to Openbox 3

Scroll down and find Multimedia


Click the arrow next to Multimedia 

Click once to select VLC Media Player (or one of the other items under Multimedia)

Click New Item 


A place holder is created (where it says "New item" under Multimedia above)


Label: This is the name of the shortcut
Id: Leave this blank
Action: Execute
Execute: This is the folder and name of the program to run



In our example we'll call our label Asunder (see above)

For the execute command, either type it in or browse using the [...] button. In our example Asunder can be found at /usr/bin/asunder

Click File | Save

Click File | Quit


Result
Now when you want to start Asunder do the following:
Right click on the desktop
Click Multimedia | Asunder


Understanding
Crunchbang uses the Openbox desktop interface. This is a simple yet powerful system. As with most configuration in Linux the menu configuration is stored in a text file. So above where we used the GUI Menu Editor, that wrote the changes to a file. This is great because if you redesigned the menu structure to your liking you could save the configuration file. Later if you wanted to reuse the same menu structure on another computer, you could by copying your configuration file - simple!

To understand this more, on the desktop right click, click Settings | Edit menu.xml


Above in the editor can you see the Multimedia menu and Asunder? What you entered in the GUI Menu Editor appears here in menu.xml.

In the window at the bottom of the Geany text editor you can see the path, the folder where the menu.xml is stored: /home/michael/.config/openbox/
Of course on your computer it won't be "michael" but whatever your username is.


Conclusion
Again another simple yet powerful Crunchbang feature.




Post a Comment