Wednesday, February 15, 2012

semplice menu

The menu in Openbox in Semplice Linux 2.0.1 ("emily") is not the default Openbox menu, although you can copy that menu from /etc/xdg/openbox/menu.xml to ~/.config/openbox, edit it if necessary, and use that instead. You'll want to make a copy of the menu.xml file that's already there, in case you want to go back to using the Semplice menu.

The default ~/.config/openbox/menu.xml calls the "alan-gentree" menu, which is located at ~/.config/alan/tree.conf. I wanted to do two things with this menu: Add the Debian menu, and add a few application entries to the menu. Semplice forum member Eugenio (aka "g7") helped me with this.

For the Debian menu, first you have to make sure that the Debian menu package is installed (it was). Next, I added the following to the extensions area, right after the "[ext:desktop]" section:

[ext:debianmenu]
## debian-menu
ext = __menu__
name = Debian
id = /Debian
icon = distributor-logo

Then I edited the "extensions" line of the "[cat:one]" section to add a spacer and "debianmenu" to the menu:

[cat:one]
## First part of the main category:
##   apps: provides an easy way to startup popular programs like the
##         Web Browser and the Terminal Emulator
##   xdgmenu: Applications menu
##   places: Places menu
##   desktop: Workspaces menu
name = STOCK_NULL
extensions = apps - xdgmenu places - desktop - debianmenu


Next, I had to go to ~/.config/openbox/rc.xml and find this section:

<!-- You can specify more than one menu file in here and they are all loaded,
       just don't make menu ids clash or, well, it'll be kind of pointless -->
    <!-- default menu file (or custom one in $HOME/.config/openbox/) -->
    <!-- system menu files on Debian systems -->
<file>menu-static.xml</file>
    <file>menu.xml</file>

I changed it to this:

<!-- You can specify more than one menu file in here and they are all loaded,
       just don't make menu ids clash or, well, it'll be kind of pointless -->
    <!-- default menu file (or custom one in $HOME/.config/openbox/) -->
    <!-- system menu files on Debian systems -->
    <file>/var/lib/openbox/debian-menu.xml</file>
    <file>debian-menu.xml</file>
    <file>menu-static.xml</file>
    <file>menu.xml</file>


Next, here's how I set up the "[ext:apps]" section of ~/.config/alan/tree.conf to add PCManFM, Mousepad, and Synaptic to the menu:

[ext:apps]
## Display a list of common apps (Terminal Emulator and Web Browser)
ext = __itemlist__
name = STOCK_NULL
count = 5

icon1 = terminal
item1 = STOCK_TERMINAL_EMULATOR
item1_ex = x-terminal-emulator

icon2 = web-browser
item2 = STOCK_WEB_BROWSER
item2_ex = x-www-browser

icon3 = pcmanfm
item3 = PCManFM
item3_ex = pcmanfm

icon4 = mousepad
item4 = Mousepad Text Editor
item4_ex = mousepad

icon5 = synaptic
item5 = Synaptic Package Manager
item5_ex = gksudo synaptic


So, here's my current Semplice desktop, showing the new menu:

No comments: