You are not logged in.

#1 2017-02-22 23:46:05

martix
Kim Jong-un Stunt Double
Registered: 2016-02-19
Posts: 1,267

Dynamic menus on BunsenLabs - a comprehensive guide

Besides the static – out-of-the-box – openbox menu there are also also dynamic menus available on BunsenLabs like the

I. Debian Menu,
II. Obamenu,
III. bl-obmenu-generator (menu),
IV. Lxde/lxmenu,
V. XFCE, Kde4 and Gnome Menu,
VI. jgmenu or
VII. Menutray (menu started by a system tray icon).

This post describes the installation – and also the removal – process for these menus and their main characteristics. This writing got muuuuch longer than I originally intended and expected, but whatever menu you're interested in, just look for the appropriate part (thanks to @johnraff for helping to finish this guide with hints and suggestions and to @mrneilypops for hosting all the pictures! The text is cut in two posts).


I. Debian Menu

A. Implementation in the Openbox menu

There is a detailed introduction to the Debian Menu System here. It's fairly easy to implement the dynamic Debian menu into the openbox menu (thanks to Damo who mentioned the menu and helped me to get it work). Here are the steps (more info here):

Installation:
1.Install dependencies:

apt-get install menu menu-xdg

2. Add the following line to your ~/.config/openbox/rc.xml between the <menu> and </menu> tags, before the entry <file>menu.xml</file> (on #BĹ around the line 890; just for clarification: “~” means in this context the directory “/home/YourUserName”. The rc.xml file is also available via “Preferences/Openbox/Edit rc.xml”):

<file>/var/lib/openbox/debian-menu.xml</file>

3. Open “Preferences/Openbox/Edit menu.xml” and paste the following line where it's supposed to be in the menu, e.g. before the entry “Accessories” (which should be somewhere around the lines 75-80 and begins with “<menu id="accessories"...).

<menu id="/Debian" />

If there is no "Debian" entry after the next step, try to use the following code instead of the one above:

<menu id="/Debian" label="Debian"/>

4. Restart openbox - “Preferences/Openbox/Restart” or via terminal:

openbox --restart

That's all. The Debian menu in the openbox menu will look like this:

DebianMenu.th.png


Uninstall:
To get rid of the Debian menu simply delete the lines you pasted in menu.xml and rc.xml and restart openbox. If you wish to unclutter the system, remove the installed packages as well via

apt-get purge menu menu-xdg


B. Replacement to the Openbox menu

There is a different usage for the Debian menu as well: It can also replace the default openbox menu, so you will have only the Debian menu after a right click.
These are the steps:


Installation:

1. Create a backup file of ~/.config/openbox/menu.xml, e.g. copy this file to a different directory, rename it to menu.xml.backup and move it back or simply open the file and use “save as” with .backup ending.

2. This step is the same as step 2 above, so add the following line to your ~/.config/openbox/rc.xml between the <menu> and </menu> tags, before the entry <file>menu.xml</file> (on #BĹ around the line 890; the rc.xml file is also available via “Preferences/Openbox/Edit rc.xml”):

<file>/var/lib/openbox/debian-menu.xml</file>

3. Open “Preferences/Openbox/Edit menu.xml” and delete everything, except the first and the last line. Between the two lines paste the code from step 3 above (<menu id="/Debian" />), so menu.xml will look like this:

<?xml version="1.0" encoding="UTF-8"?>
<menu id="Debian" />
</openbox_menu>

4. Restart openbox - “Preferences/Openbox/Restart” or via terminal:

openbox --restart

The Debian Menu as replacement looks like this:

DebianMenuasreplacement.th.png



Uninstall:
To get back the openbox menu simply delete ~/.config/openbox/menu.xml and rename back menu.xml.backup (that was created at step 1) to menu.xml and restart openbox.
To unclutter the system delete the line you pasted in rc.xml and remove the installed packages as well via

apt-get purge menu menu-xdg

To describe the Debian menu, let me use a corenominal quote back from #!-days: “I am not keen on the Debian menu. Some applications seem to be listed under obscure categories and some really obscure applications also appear when maybe they should not.”
It's a kind of “nerdy” menu, but some users like it: “what i like about debmenu so far is that its showing me things i didn't know i had on here but i also either don't need or was wondering what was being used for it.” - This is exactly what I was thinking too...
One more comment (as sometimes applications do not appear in the menu): “I agree that this can and does get both confusing and frustrating, especially for the typical end-user. From what I have seen, Debian menu will Not auto-update an application that does not have a .Desktop entry in the usr/share/applications folder. If you create a missing .Desktop file, Debian menu handles things nicely.”

For a “how-to” on editing the menu entries you can also read the documentation in the “/usr/share/doc/menu/html” directory.
Note: There are two GUI menu editor packages called “alacarte” and “menulibre”. As far as I have seen both provide the same basic categories. However the Debian menu has a completely different structure and those menu editors did not seem to be useful (I might have overlooked something though). There is still a way to edit the structure of the Debian menu, which is described in the documentation mentioned above (“/usr/share/doc/menu/html”).

A sidenote just for the record: “Historically — way before the FreeDesktop.org standards emerged — Debian had invented its own menu system where each package provided a generic description of the desired menu entries in /usr/share/menu/. This tool is still available in Debian (in the menu package) but it is only marginally useful since package maintainers are encouraged to rely on .desktop files instead. “
There is also a readme-file in /usr/share/menu: “In this directory, each individual package should install its menu files. Although changing them in this directory to change the menus on your local system may work, the sysadmin (you?) is best advised to put the local menufiles in /etc/menu, as,  otherwise your changes are deleted when you upgrade the corresponding packages. Users may override the system-wide defaults by putting their menuentry files in ~/.menu.”
----------------------------------------------------------------------------------------------------------------------------------------------------------



II. Obamenu

There are also Obamenu and (bl-)obmenu-generator. The names are similar, but let's get things cleared first. I better quote forum member johnraff:

“obamenu and obmenu-generator are of course two entirely different things.
obamenu is a python script, not originally by xaos52, who has forked the code from rmoe and added his modifications. Whichever you use, however, the differences are small at the moment.
If you run the script successfully in a terminal it will output a bunch of xml code. This is the openbox menu! To turn it into a real menu you have to incorporate a call to the script somewhere in your openbox menu file.”


Here are the steps to implement obamenu in the openbox menu:

Installation:

1. Download the tarball from here (or go for xaos52's version, whatever you like – see above)   

wget rmoe.anukis.de/obamenu.tar.gz

2. Extract the obamenu.tar.gz file. It will create an obamenu directory with two files: “obamenu” (python script) and “obamenu.txt” (read this .txt file before using obamenu).

3. Copy the “obamenu” file in the “home/YourUserName/bin” directory, so it doesn't need to be called with its full path (or copy it where you like but call it with its full path at the next step after execute=”).

4. Open “Preferences/Openbox/Edit menu.xml” and paste the following line at the appropriate place in the menu structure, e.g. before the entry “Accessories” (which should be somewhere around the lines 75-80 and begins with “<menu id="accessories"...).

<menu id="desktop-app-menu" label="Applications" icon="/usr/share/icons/applications.png" execute="obamenu" />

If you wish a different entry name instead of “Applications”, just change the word after label=”.

6. Restart openbox.

This is how it looks without tweaking:

obamenudefault.th.png



Uninstall:
To remove it from the menu just delete the line pasted in menu.xml and restart openbox (if you wish to unclutter the system also delete the obamenu and obamenu.txt files).

In order to fix the missing icons issue have a look at the obamenu.txt file. Quote: “The author of obamenu admits freely to have taken a rather deliberate choice in that regard by having image_dir be a simple string rather than a list, which might seem to be a reasonable way to some. The author, however, didn't consider it wise to play find and catch with ignorance and idiosyncrasies of some parties. He rather chose to use the trusted Unix mechanism of links. In other words: You are advised to soft link all icon files outside the standard icon directory to /usr/share/pixmaps or similar. ("find" is your friend, e.g. find /usr/share/icons -name 'foo.*').”

If you prefer to use obamenu without icons, find the following line in the obamenu file:

image_cat_prefix = "applications -"  # if empty will create no icon text only menu

As it is described in the file, after deleting 'applications -', there will be no icons in the menu.

image_cat_prefix = ""  # if empty will create no icon text only menu

It's a pragmatic and easy to use dynamic menu implemented in the openbox menu. There are only the main categories with their applications, no submenus of submenus like in the Debian menu. Without icons it looks like this (fits perfectly to the openbox menu):

obamenu.th.png

Editing the menu entries:  The entries and the order for the main categories (Office, Development, Graphics, etc.) are defined in the obamenu file, look for the “application_groups =“ line. If you change the order here, it gets also changed in the menu structure. In the next section called “group_aliases =” it can be set in which category an application will end up, e.g. "AudioVideo":"Multimedia" -> if there is “AudioVideo” in the Categories line in the .desktop file, the application will be shown under “Multimedia”.

If an application is in a wrong category, go to /usr/share/applications and edit the “Categories” line in the .desktop file (as root). For example if a messenger app is in the menu under “Internet” AND “Multimedia”, because there is e.g. “Network” AND “AudioVideo” in the “Categories” line, just remove “AudioVideo” (or “Network”, if you prefer to keep it under “Multimedia”). For some applications – like Kate or Krita (because their .desktop files are in a kde4 subdirectory) or feh (because it's on the ignoreList in the obamenu file ) – there will be no obamenu entries, but it's possible to fix it by creating (copying) a .desktop file in the /usr/share/applications directory (or simply remove it from the ignoreList like with feh).

Correct me if I'm wrong but it seems – not like with the order of categories – there is no easy way to change the order of applications in the submenus.
----------------------------------------------------------------------------------------------------------------------------------------------------------



III. bl-obmenu-generator (menu)

bl-bmenu-generator is more complex than obamenu. bl-obmenu-generator is a fork of obmenu-generator optimized for BunsenLabs (icons, settings, installation, etc.) It is written in perl and basically creates a replacement menu to the default openbox menu. Obmenu-generator was made by trizen (who also created ((gtk-))youtube-viewer). Let's not forget that it is forum member ohnonot's favorite menu on BunsenLabs. The menu by (bl-)obmenu-generator can be generated as a dynamic or as a static menu. More info regarding obmenu-generator can be found on github or here and here. The repo for bl-obmenu-generator is available here

Before a short description of the installation steps let me thank forum member Head on a Stick for creating the obmenu-generator repository and starting the forum thread, which led me to try obmenu-generator and making the bl-obmenu-generator fork.

1. Installation
For installing bl-obmenu-generator with all its dependencies and letting it create a dynamic menu with icons simply run the following (if you already have the ~/src folder remove "mkdir ~/src && " from the beginning):

mkdir ~/src && sudo apt install cpanminus gexec libcpan-distnameinfo-perl libcpan-meta-check-perl libfile-pushd-perl liblocal-lib-perl libgtk2-perl libmodule-cpanfile-perl libparse-pmfile-perl libstring-shellquote-perl libdata-dump-perl && sudo cpanm Linux::DesktopFiles && sudo cpanm Data::Dump && cd ~/src && wget https://www.notabug.org/martix/bl-obmenu-generator/archive/master.tar.gz && tar vxf master.tar.gz && rm master.tar.gz && cd bl-obmenu-generator && sudo cp bl-obmenu-generator /usr/bin && sudo chmod 755 /usr/bin/bl-obmenu-generator && mkdir ~/.config/bl-obmenu-generator && cp schema.pl ~/.config/bl-obmenu-generator && bl-obmenu-generator -i -p

After installation you can delete the ~/src folder and bl-obmenu-generator's files there. Step by step installation instructions for bl-obmenu-generator are described here.

With the default #BĹ Paper icon theme the menu looks like this:

papericontheme.png

It opens after a right click and replaces the openbox menu (the original ~/.config/openbox/menu.xml will be changed to “menu.xml.bak”. It'll also creates ~/.config/bl-obmenu-generator/schema.pl, which file has to be edited in order to customize the menu (open via Menu/Preferences/Openbox/Edit schema.pl).



2. Add Menu Switch
On the screenshot there is a menu entry called Menu Switch. This goes back to this thread and the bl-menu-switch script. This script enables switching back and forth between the menu by bl-obmenu-generator and the static Openbox menu. For installing this feature run the following after the installation of bl-obmenu-generator (if you already have an ~/src folder, remove "mkdir ~/src && " from the beginning):

mkdir ~/src && cd ~/src && wget https://notabug.org/martix/bl-menu-switch/archive/master.tar.gz && tar vxf master.tar.gz && cd bl-menu-switch && cp bl-menu-switch ~/bin && chmod 755 ~/bin/bl-menu-switch && sudo cp ~/src/bl-menu-switch/bl-menu-switch_Paper_icon_32x32/bl-menu-switch.svg /usr/share/icons/Paper/32x32/apps/ && sudo cp ~/src/bl-menu-switch/bl-menu-switch_Papirus_icon_48x48/bl-menu-switch.svg /usr/share/icons/Papirus/48x48/apps && sed -i '/bl-menu-switch/s/#{item/{item/g' ~/.config/bl-obmenu-generator/schema.pl && sed -i '/item label="Edit autostart"/i \\t\t\t\t<item label="Menu Switch">\n\t\t\t\t\t<action name="Execute">\n\t\t\t\t\t\t<command>\n\t\t\t\t\t\t\tbl-menu-switch\n\t\t\t\t\t\t</command>\n\t\t\t\t\t</action>\n\t\t\t\t</item>' ~/.config/openbox/menu.xml.bak

The installation will place bl-menu-switch in ~/bin, copy its icon in the required icon theme folders and update schema.pl and openbox's menu.xml.bak. Running the command bl-menu-switch or using the Menu Switch entry switches between the Openbox and bl-obmenu-generator menus.


3. Fixing icons for bl-obmenu-generator when using Papirus icon theme

On default bl-obmenu-generator's schema.pl is optimized for the Helium release's Paper icon theme. If the icon theme Papirus is used, run the follwing command in order to fix missing icons:

cp ~/.config/bl-obmenu-generator/schema.pl ~/.config/bl-obmenu-generator/schema.pl.bak && sed -i '/Preferences/s/preferences-other/preferences-desktop/g' ~/.config/bl-obmenu-generator/schema.pl && sed -i '/menu.xml/s/text-editor/menu-editor/g' ~/.config/bl-obmenu-generator/schema.pl && sed -i '/schema.pl/s/text-editor/menu-editor/g' ~/.config/bl-obmenu-generator/schema.pl && sed -i '/bl-text-editor/s/package_editors/cs-windows/g' ~/.config/bl-obmenu-generator/schema.pl && sed -i '/bl-text-editor/s/hexedit/text-editor/g' ~/.config/bl-obmenu-generator/schema.pl && sed -i '/obconf/s/gtk-preferences/preferences-desktop-tweaks/g' ~/.config/bl-obmenu-generator/schema.pl && sed -i '/bl-compositor/s/window-new/Xfwm4CompositeEditor/g' ~/.config/bl-obmenu-generator/schema.pl && sed -i '/gmrun/s/system-run/application-x-phatch/g' ~/.config/bl-obmenu-generator/schema.pl

When changing back from the Papirus icon theme to Paper or Bunsen-Paper, you can use the ~/.config/bl-obmenu-generator/schema.pl.bak file and rename it (back) to schema.pl.


Uninstall:

1. Get rid of the file ~/.config/openbox/menu.xml (move it to an other directory or delete it; I tried to simply rename it to “.old” in the same directory but it did not work that way) and remove /usr/bin/bl-obmenu-generator.

2. Rename (back) the ~/.config/openbox/menu.xml.bak to menu.xml (i.e. simply delete .bak from the name, so you'll have the menu that was in use before bl-obmenu-generator was installed). If you prefer to get back the default “out-of-the-box” openbox menu, run the following command:

cp /usr/share/bunsen/skel/.config/openbox/menu.xml ~/.config/openbox/menu.xml

3. Uninstall the perl modules:

sudo cpanm -U Linux::DesktopFiles
sudo cpanm -U Data::Dump

4. For removing the installed dependencies run:

sudo apt purge cpanminus gexec libcpan-distnameinfo-perl libcpan-meta-check-perl libfile-pushd-perl liblocal-lib-perl libgtk2-perl libmodule-cpanfile-perl libparse-pmfile-perl libstring-shellquote-perl libdata-dump-perl

5. Delete the config directory used by bl-obmenu-generator: ~/.config/bl-obmenu-generator

6. Restart openbox.

openbox --restart


Editing the menu entries: There is more info on how to edit the menu, add categories, external submenus, put a bash-menu via xdotool to the menu, create all kinds of bells and whistles etc. on this site and here (thanks to forum member seppalta for these detailed tutorials!).  At the beggining of the file ~/.config/bl-obamenu-generator/schema.pl there is a description of the syntax:

    item:      add an item inside the menu               {item => ["command", "label", "icon"]},
    cat:       add a category inside the menu             {cat => ["name", "label", "icon"]},
    sep:       horizontal line separator                  {sep => undef}, {sep => "label"},
    pipe:      a pipe menu entry                         {pipe => ["command", "label", "icon"]},
    file:      include the content of an XML file        {file => "/path/to/file.xml"},
    raw:       any XML data supported by Openbox          {raw => q(xml data)},
    begin_cat: begin of a category                         {begin_cat => ["name", "icon"]},
    end_cat:   end of a category                         {end_cat => undef},
    obgenmenu: generic menu settings                     {obgenmenu => ["label", "icon"]},
    exit:      default "Exit" action                     {exit => ["label", "icon"]},

There are also some “commented out” lines on default like

# {cat => ['gtk',         'GTK Applications',   'gnome-applications']},

If you remove the #, there will be a new menu category with all the GTK applications. I really liked to tweak the menu as there is no need to restart openbox; it's enough to save the changes in “schema.pl” (or does not start, if there is wrong code). bl-bmenu-generator looks for apps in /usr/share/applications and ~/.local/share/applications. If apps don't show up there, just create an appropriate .desktop file.


There are no man pages for bl-obmenu-generator, only “help” via

bl-obmenu-generator -h
usage: bö-obmenu-generator [options]

Options:
    -p  : (re)generate a pipe menu
    -s  : (re)generate a static menu
    -o  : static menu file (default: ~/.config/openbox/menu.xml)
    -m  : menu id (default: 'root-menu')
    -t  : menu label text (default: "Applications")
    -r  : regenerate the config file
    -i  : use icons in menus
    -d  : regenerate icons.db (with -i)
    -u  : update the config file
    -c  : reconfigure openbox automatically
    -R  : reconfigure openbox now and exit

Examples:
   ** Static menu without icons:
        bl-obmenu-generator -s -c

   ** Dynamic menu with icons:
        bl-obmenu-generator -p -i

       

It's a pretty cool replacement to the default openbox menu. With all kinds of bells and whistles it looks like this. <-Amazing menu!

Why is a menu by (bl-)obmenu-generator great? Let's quote forum member ohnonot:

“It's absolutely genious because it's:
- fast as hell despite being
- dynamically generated
- configurable (easy once you get used to the syntax. easier than xml, imho)
- so you can also have static items in there, and submenus and everything
- icons or not (if you choose icons they are cached so it doesn't slow down too much)
- it adds its own configuration submenu.”

obmenu-generated_dynamic-menu2.th.png
----------------------------------------------------------------------------------------------------------------------------------------------------------
Edit: Updated instructions - obmenu-generator replaced by insturctions for bl-obmenu-generator

Last edited by martix (2018-06-15 17:45:11)

Offline

#2 2017-02-22 23:46:59

martix
Kim Jong-un Stunt Double
Registered: 2016-02-19
Posts: 1,267

Re: Dynamic menus on BunsenLabs - a comprehensive guide

IV. Lxde/lxmenu

The following menu is default on the desktop lxde, thanks to forum member dr_iian for mentioning it in a thread. It's very easy to implement it in the openbox menu.


Installation:

1. First install the required packages:

apt-get install lxmenu-data openbox-menu

2. Open menu.xml via “Preferences/Openbox/Edit menu xml”. Paste the following code in menu.xml e.g. between the line <separator/> and <menu id="accessories" label="Accessories"> (this is probably somewhere around the lines 70 and 85) and in this case the "Applications" menu entry will be above "Accessories" in the openbox-menu:

<menu execute="openbox-menu lxde-applications.menu" id="apps" label="Applications"/>

To change the entry name just modify the word after label=”. In order to use the menu without icons, just put “-i” after openbox-menu in the code above.

3. Restart openbox e.g. via ”Preferences/Openbox/Restart”.

That's it. The dynamic lxde/lxmenu will appear under “Applications” in the openbox menu. With icons it will look like this:

Lxdemenu.th.png



It's easy to edit this menu as there is a GUI menu editor called lxmed. It looks a bit outdated but is still working. It needs Java Runtime Environment and also works with OpenJDK instead of Sun's java.

Installation of lxmed:

1. In order to use the lxmed menu-editor install openjdk first:

apt-get install openjdk-7-jre

2. Download the tarball from here. The following steps are the same just like described on the site:

3. Extract the file.

4. Enter the lxmed folder and run this command to make the install script executable:

chmod +x install.sh

5. Install lxmed by

sudo ./install.sh

6. If you have lxde/lxmenu installed, start the editor via “Applications/Preferences/Main Menu Editor”.

Lxmed will require a root password after start and it will look like this:

lxmed.th.png

Removing an app from a certain category and move it to an other one (or rename it) via LXDE Main Menu Editor seems to work for other menus like obamenu or jgmenu too. You can also use this menu with fbpanel and it's possible to add new dynamic categories to the menu (whereas it was mentioned in a thread that only static categories could be added to the fbpanel menu).


Lxde/lxmenu without icons fits perfectly to the openbox menu:

Lxdemenuwithouticons.th.png

When you look at the pictures with and without icons closely, you will notice the entry “Main Menu Editor” for lxmed. On the picture with icons it is called “Main Menu Editor LXDE”, which was changed via lxmed. Besides renaming it is also possible to change the order of the entries, hide entries, copy&paste or cut&paste entries.


Uninstall:

If you wish to remove lxde/lxmenu, just delete the line that was pasted into menu.xml. If there is no need for the package anymore, use

apt-get purge lxmenu-data

To remove lxmed menu-editor use

sudo /opt/lxmed/uninstall.sh

If you receive a “command not found” error message, try first

sudo chmod +x /opt/lxmed/uninstall.sh

and the uninstall command after that.
----------------------------------------------------------------------------------------------------------------------------------------------------------




V. XFCE, KDE4 and Gnome Menu

The installation of the XFCE, KDE4 and Gnome menu is similar to the process of the Lxde/lxmenu. However for the XFCE menu its .menu file needs to be tweaked first.


Installation of the XFCE Menu

1. Install

apt-get install openbox-menu

2. Open the file /etc/xdg/menus/xfce-applications.menu as root and replace in line 5 “<Name>Xfce</Name>” – as advised here – the word “XFCE” with “Applications”, so it'll look like this:

<Name>Applications</Name>

3. Open menu.xml via “Preferences/Openbox/Edit menu xml”. Paste the following code in menu.xml e.g. between the line <separator/> and <menu id="accessories" label="Accessories"> (this is probably somewhere around the lines 70 and 85) and in this case the "Applications" menu entry will be above "Accessories" in the openbox-menu:

<menu execute="openbox-menu xfce-applications.menu" id="apps" label="Applications"/>

To change the entry name just modify the word after label=”. In order to use the menu without icons, put “-i” after openbox-menu in the code above.

4. Restart openbox e.g. via ”Preferences/Openbox/Restart”.
The XFCE Menu will appear under “Applications” in the openbox menu. Without icons this is how the menu structure looks like:
Xfcemenu.th.png

As a sidenote: The name of the entries “Main Menu Editor Menulibre” and “Menu Editor” (alacarte) were changed – if I recall it correctly – via lxmed (which is called “Main Menu Editor”). After I removed both packages – menulibre and alacarte – these two entries remained (although they did not start anything). It turned out that two .desktop files in ~/.local/share/applications had to be removed manually as well.
The XFCE Menu has a well-organized, pragmatic structure with a huge “Other” category. There were over fifty entries in this category, lots of them duplicate ones. Here is a “how-to” on customizing this menu. According to this wiki-page Menulibre works well for editing (and lxmed as well) but I did not test them with the XFCE menu.




Installation of the KDE4 Menu

The KDE4 menu requires only three steps, install openbox-menu, paste the appropriate line in menu.xml and restarting openbox:

1. Install

apt-get install openbox-menu

2. Open menu.xml via “Preferences/Openbox/Edit menu xml”. Paste the following code in menu.xml e.g. between the line <separator/> and <menu id="accessories" label="Accessories"> (this is probably somewhere around the lines 70 and 85) and in this case the "Applications" menu entry will be above "Accessories" in the openbox-menu:

<menu execute="openbox-menu kde4-applications.menu" id="apps" label="Applications"/>

For no icons put “-i” after openbox-menu in the code.

3. Restart openbox.

The KDE4 menu is a bit messy – strange structure and plenty duplicate menus –, without tweaking it's not really suitable for everyday use:

KDE4menu.th.png




Installation of the Gnome Menu

Same procedure for the Gnome menu as above:

1. Install

apt-get install openbox-menu

2. Open menu.xml via “Preferences/Openbox/Edit menu xml”. Paste the following code in menu.xml e.g. between the line <separator/> and <menu id="accessories" label="Accessories"> (this is probably somewhere around the lines 70 and 85) and in this case the "Applications" menu entry will be above "Accessories" in the openbox-menu:

<menu execute="openbox-menu gnome-applications.menu" id="apps" label="Applications"/>

For no icons put “-i” after openbox-menu in the code.

3. Restart openbox.

This is how the implemented Gnome menu looks like (there seems to be the category "Games" missing):

Gnomemenu.th.png


Uninstall:
To remove these menus just delete the line that was pasted into menu.xml and to clean up run: apt-get purge openbox-menu
----------------------------------------------------------------------------------------------------------------------------------------------------------




VI. jgmenu

jgmenu is a standalone X11 menu application, which was created by forum member malm (credit for contributions goes to forum member o9000). The menu was developed for Openbox and tint2, but it works with many use-cases like dwm, polybar, plank or cairo-dock as well (see jgmenu wiki). jgmenu provides a conventional launcher/start menu with some hackable features (size, position, color, transparency, etc.).


Installation:
As a package is available in the backports, the menu can be installed via:

sudo apt install jgmenu

The menu starts by running

jgmenu_run

Configuration:
In order to create the jgmenu config file (~/.config/jgmenu/jgmenurc) run the following command:

jgmenu init

By default, jgmenu will guess appearance settings (e.g. colours and positioning) based on the tint2 config file - if it exists - or just use default settings.

You can overrule any of these settings by uncommenting the appropriate variable in ~/.config/jgmenu/jgmenurc. For example if you would like to change the font type and size to "URW Chancery L bold italic 11", just open ~/.config/jgmenu/jgmenurc -> uncomment the line "font =" and change it to:

font = URW Chancery L bold italic 11

Save it. Open the menu, press F5 for restarting the menu and the new font type and size will be shown.

For further configuration-options see:

man jgmenu

Or check this site. There is a great overview regarding geometric variables (position of items, submenus, menu-padding, sub-spacing, arrow-width, etc.) here. In order to use it on Openbox with a shortcut or mouse-bind, check the details here.


Autostart:
In order to make it autostart, copy&paste the following line in ~/.config/openbox/autostart:

(sleep 2s; jgmenu --hide-on-startup) &

Here are the details for a tint2 implementation (you will find in the wiki the instructions for dwm and polybar too).

----------------------------------------------------------------------------------------------------------------------------------------------------------




VII. Menutray

Menutray is a menu, which can be started after a click on a system tray icon. It does not replace the openbox menu, so both menus can be used at the same time (there will be no menu entry for Menutray in the openbox menu). Menutray is somewhat similar to Obmenu-generator (both were created by trizen) as it is also written in perl, has similar dependencies and config files (schema.pl and config.pl).

Installation:

1. Install the dependencies:

sudo apt-get install cpanminus gexec libcpan-distnameinfo-perl libcpan-meta-check-perl libfile-pushd-perl liblocal-lib-perl libmodule-cpanfile-perl libparse-pmfile-perl libstring-shellquote-perl libdata-dump-perl

2. Download the .zip file (or git pull) from here:

wget https://github.com/trizen/menutray/archive/master.zip

3. Extract master.zip.

4. cd to the menutray-master directory, where - among others - the extracted menutray, schema.pl and README.md files are and place the file "menutray" in your PATH:

cp menutray ~/bin

5. Create a Menutray config directory:

mkdir ~/.config/menutray

6. Copy schema.pl in the created directory:

cp schema.pl ~/.config/menutray

7. Run the following command for creating a menu with icons (or "-g" instead of "-i" for no icons)

menutray -i

Without tweaking Menutray places an Ubuntu logo in the system tray. After clicking on it the menu looks like this:

menutray.th.png


As mentioned above, the menu can be tweaked in a similar way just like a menu by obmenu-generator. The config files - schema.pl and config.pl - are in the ~/.config/menutray directory. For further options (using gtk3 instead of gtk2, change path of schema.pl, etc.) see the github page.



Uninstall:
To remove Menutray just delete the menutray file from ~/bin and the menutray directory ~/.config/menutray. Um get rid of the dependencies run

apt-get purge cpanminus gexec libcpan-distnameinfo-perl libcpan-meta-check-perl libfile-pushd-perl liblocal-lib-perl libmodule-cpanfile-perl libparse-pmfile-perl libstring-shellquote-perl libdata-dump-perl

----------------------------------------------------------------------------------------------------------------------------------------------------------




VIII. uxdgmenu

Just for the record: There used to be a python script for a menu called XDG-Menu, which led to a project named uxdgmenu. There is still a .deb package available, however it seems to be outdated and did not work for me.

Last edited by martix (2018-04-27 10:35:55)

Offline

#3 2017-02-23 00:40:34

hhh
That's easy!
Registered: 2015-09-17
Posts: 6,118
Website

Re: Dynamic menus on BunsenLabs - a comprehensive guide

Fantastic work! Even though I've grown to despise nested menus (on BL I use a single-pane right-click menu for settings, shortcut keys for common apps and xfce4-appfinder for the rest), I'm sure there are many who will love you for this!

Megabonus points for including scrots and removal instructions for all of these.

I'm sure we'll end up either stickying this or linking it to a sticky. Cheers!

Offline

#4 2017-02-23 03:17:44

johnraff
nullglob
From: Nagoya, Japan
Registered: 2015-09-09
Posts: 4,677
Website

Re: Dynamic menus on BunsenLabs - a comprehensive guide

^For now, I've added a link to this list.


John
--------------------
( a boring Japan blog , Japan Links, idle twitterings  and GitStuff )
In case you forget, the rules.

Offline

#5 2017-02-23 08:22:12

Steve
Member
Registered: 2017-01-03
Posts: 642

Re: Dynamic menus on BunsenLabs - a comprehensive guide

What a great resource, thankyou for sharing.

Offline

#6 2017-02-23 08:53:29

martix
Kim Jong-un Stunt Double
Registered: 2016-02-19
Posts: 1,267

Re: Dynamic menus on BunsenLabs - a comprehensive guide

@hhh Well, in the first line credit goes to those coders who created these great menus! I just like to try different dynamic menus from time to time. An obmenu-generator thread gave me thinking about a tuto as it might seem complicated at the first glance but knowing the steps it's actually very easy to install and use it. I'm still wondering though why "purge" did not remove the /.config/obmenu-generator files for me. Btw XFCE4 Appfinder is good to have, I like it too! Although it relies on file names and descriptions, therefore e.g. after typing "pdf", readers like Atril or Evince don't show up.

@john Thank you for linking! If I forgot or overlooked some dynamic menu solutions, I'll try to add it to the post in the future.

Tweak and tinker those menus like there's no tomorrow!   smile

Offline

#7 2017-02-23 09:10:07

johnraff
nullglob
From: Nagoya, Japan
Registered: 2015-09-09
Posts: 4,677
Website

Re: Dynamic menus on BunsenLabs - a comprehensive guide

martix wrote:

I'm still wondering though why "purge" did not remove the /.config/obmenu-generator files for me.

Apt-get will never remove a user's personal files because they might be important. It's up to you to remove left-over config files in your home directory.


John
--------------------
( a boring Japan blog , Japan Links, idle twitterings  and GitStuff )
In case you forget, the rules.

Offline

#8 2017-02-23 10:23:40

martix
Kim Jong-un Stunt Double
Registered: 2016-02-19
Posts: 1,267

Re: Dynamic menus on BunsenLabs - a comprehensive guide

@john I see, thank you. So - when uninstalling something - does it mean there is no difference in "apt-get remove" and "apt-get purge"? (At least in this respect.) Somehow I had on my mind that the former does not remove config files and the later removes everything, but good to know that "purge" does not touch config files in the home directory then.

Offline

#9 2017-02-23 11:49:31

damo
....moderator....
Registered: 2015-08-20
Posts: 4,386

Re: Dynamic menus on BunsenLabs - a comprehensive guide

martix wrote:

@john I see, thank you. So - when uninstalling something - does it mean there is no difference in "apt-get remove" and "apt-get purge"?....

man apt-get

wink


Be Excellent to Each Other...

FORUM RULES and posting guidelines «» Help page for forum post formatting
Artwork on DeviantArt  «» BunsenLabs on DeviantArt

Online

#10 2017-02-24 15:42:49

martix
Kim Jong-un Stunt Double
Registered: 2016-02-19
Posts: 1,267

Re: Dynamic menus on BunsenLabs - a comprehensive guide

damo wrote:
man apt-get

wink

Yes, indeed, thanks! This is what I meant : "purge is identical to remove except that packages are removed and purged (any configuration files are deleted too)." Well, not the edited ones in ~/.config/obmenu-generator.

Added Menutray to the guide. Somewhat strange menu, as it starts by a systray icon. This kind of menu is probably not used by many users.

Offline

#11 2017-02-25 02:44:11

johnraff
nullglob
From: Nagoya, Japan
Registered: 2015-09-09
Posts: 4,677
Website

Re: Dynamic menus on BunsenLabs - a comprehensive guide

When apt talks about "configuration files" it means system configuration files, usually stored under /etc/. User's personal files are always (or should be) left untouched.

Users on single-user systems sometimes confuse system-wide settings with per-user settings, but policies about them are quite different.


John
--------------------
( a boring Japan blog , Japan Links, idle twitterings  and GitStuff )
In case you forget, the rules.

Offline

#12 2017-07-05 23:01:37

Bradypus
Member
From: Brazil
Registered: 2016-01-12
Posts: 43

Re: Dynamic menus on BunsenLabs - a comprehensive guide

Hey, thank you for this!

This is so useful, thorough and... understandable!
Thank you for sharing!

Cheers!!

JR Bradypus


Hard(ly?) working sloth...

Offline

#13 2017-07-06 01:44:36

Bradypus
Member
From: Brazil
Registered: 2016-01-12
Posts: 43

Re: Dynamic menus on BunsenLabs - a comprehensive guide

Hi, again!

I was trying it out here and I think the line to be added to the menu.xml file is:
       

<menu id="/Debian" label="Debian"/>

or there'll be no button for the Debian menu...

(but I may be wrong, it happens a lot more often than I like to admit.)

Cheers!

Last edited by Bradypus (2017-07-06 02:43:08)


Hard(ly?) working sloth...

Offline

#14 2017-07-06 02:31:52

DeepDayze
Member
From: In Linux Land
Registered: 2017-05-28
Posts: 541

Re: Dynamic menus on BunsenLabs - a comprehensive guide

Bradypus wrote:

Hi, againa!

I was trying it out here and I think the line to be added to the menu.xml file is:
       

<menu id="/Debian" label="Debian"/>

or there'll be no button for the Debian menu...

(but I may be wrong, it happens a lot more often than I like to admit.)

Cheers!

I saw the typo and that line you posted is the correct one. Debian menu now works for me.


Real Men Use Linux

Offline

#15 2017-07-06 02:44:49

Bradypus
Member
From: Brazil
Registered: 2016-01-12
Posts: 43

Re: Dynamic menus on BunsenLabs - a comprehensive guide

DeepDayze wrote:

I saw the typo and that line you posted is the correct one. Debian menu now works for me.

Great!!

It feels good to have been useful!

Cheers!


Hard(ly?) working sloth...

Offline

#16 2017-07-06 10:27:38

martix
Kim Jong-un Stunt Double
Registered: 2016-02-19
Posts: 1,267

Re: Dynamic menus on BunsenLabs - a comprehensive guide

DeepDayze wrote:
Bradypus wrote:

Hi, againa!

I was trying it out here and I think the line to be added to the menu.xml file is:
       

<menu id="/Debian" label="Debian"/>

or there'll be no button for the Debian menu...

(but I may be wrong, it happens a lot more often than I like to admit.)

Cheers!

I saw the typo and that line you posted is the correct one. Debian menu now works for me.


Hmm, I'm not sure: Which button do you mean?

Offline

#17 2017-07-06 15:37:21

Bradypus
Member
From: Brazil
Registered: 2016-01-12
Posts: 43

Re: Dynamic menus on BunsenLabs - a comprehensive guide

martix wrote:

Hmm, I'm not sure: Which button do you mean?

Sorry, by "button", I mean an entry in the menu, like a word to click on.

Adding the line:

<menu id="/Debian" />

to the menu, I got the same OB menu, without any place to click on to access the Debian Menu (that is what I mean by "no button", no link in the menu). The Debian menu may have been be there, but I couldn't access it. So, I think it's fair to say that, for me, this option did no work.

When I tried to replace the line with:

<menu id="/Debian" label="Debian"/>

The word "Debian" showed on the menu and, when I clicked on it, the Debian menu showed.

As I said, I may be wrong, but I tried this in two different computers, with the same result.

Thinking about it, I guess it does make sense, no label, no, menu entry, link (or "button") in the menu. Actually, I didn't even get a blank line, with the first option.

The best thing would be to try it out. I may have done something wrong in the first option, but I tried it in two different computers, twice in one of them, with the same result.

I hope this can be useful.
(I'm sure I am learning a lot!)

Cheers

Last edited by Bradypus (2017-07-06 15:38:15)


Hard(ly?) working sloth...

Offline

#18 2017-07-08 21:24:00

martix
Kim Jong-un Stunt Double
Registered: 2016-02-19
Posts: 1,267

Re: Dynamic menus on BunsenLabs - a comprehensive guide

^I see, thank you for the explanation.

I used that line without "label="Debian"" and it seems that here it is not required as after a restart there is the "Debian" entry with its menu-structure.

It's good to hear about these issues though, I'll add it to the description above.

Offline

#19 2017-07-09 14:58:19

Bradypus
Member
From: Brazil
Registered: 2016-01-12
Posts: 43

Re: Dynamic menus on BunsenLabs - a comprehensive guide

martix wrote:

I used that line without "label="Debian"" and it seems that here it is not required as after a restart there is the "Debian" entry with its menu-structure.

Hey, Martix,

It's pretty odd that things work differently with the same system (although in different machines). I actually found the "label="Debian"" solution (which worked here) by trial and error (from observing the other menu entries), after I got no "Debian" menu entry after following the instructions and restarting my system. I think that, if a lot of people had experienced the same issue, it would have shown in the forum earlier. Or maybe people who found this issue just gave up on Debian menu and went on to test other alternatives.

The line you posted (without "label="Debian") is the same one I found in other places (such as http://openbox.org/wiki/Help:Menus#The_Debian_menu), so it must work at least in some cases (if not in most cases). I just hope it works equally well for everyone with the "label="Debian"".

martix wrote:

It's good to hear about these issues though, I'll add it to the description above.

It's good to think that my remark may have been useful.

All the best!

Last edited by Bradypus (2017-07-09 15:15:17)


Hard(ly?) working sloth...

Offline

#20 2017-07-13 17:09:27

devnull
Member
Registered: 2017-06-29
Posts: 60

Re: Dynamic menus on BunsenLabs - a comprehensive guide

Awesome topic, thanks!

After installing obmenu-generator both from repo and from git I have the following output when I try to use it. Any help on how to solve it?

It is a fresh deuterium

Can't locate Linux/DesktopFiles.pm in @INC (you may need to install the Linux::DesktopFiles module) (@INC contains: /etc/perl /usr/local/lib/i386-linux-gnu/perl/5.20.2 /usr/local/share/perl/5.20.2 /usr/lib/i386-linux-gnu/perl5/5.20 /usr/share/perl5 /usr/lib/i386-linux-gnu/perl/5.20 /usr/share/perl/5.20 /usr/local/lib/site_perl .) at /usr/bin/obmenu-generator line 34.

Offline

#21 2017-07-13 17:41:53

martix
Kim Jong-un Stunt Double
Registered: 2016-02-19
Posts: 1,267

Re: Dynamic menus on BunsenLabs - a comprehensive guide

^Indeed, I had that issue as well after upgrading to stretch.

Run as root:

perl -MCPAN -e shell

Answer the question and then from the shell inside:

install Linux::DesktopFiles

Then

exit

Exit root and try again the obmenu command.

Offline

#22 2017-07-15 12:27:02

devnull
Member
Registered: 2017-06-29
Posts: 60

Re: Dynamic menus on BunsenLabs - a comprehensive guide

thank you sir, that worked like a charm and I wouldn't have thought of it. It should be in the first post guide!

Offline

#23 2017-07-15 17:56:07

martix
Kim Jong-un Stunt Double
Registered: 2016-02-19
Posts: 1,267

Re: Dynamic menus on BunsenLabs - a comprehensive guide

You're welcome. Good idea too, added!

There is also a way to have both: The static menu and the dynamic menu and switch back and forth. Here is a detailed description.

Offline

#24 2017-07-16 07:52:35

devnull
Member
Registered: 2017-06-29
Posts: 60

Re: Dynamic menus on BunsenLabs - a comprehensive guide

The switcher looks like a nice little toy, nice job!

Is there a way to change the font of the obmenu-generator? Can't find it around

Offline

#25 2017-07-16 18:57:02

martix
Kim Jong-un Stunt Double
Registered: 2016-02-19
Posts: 1,267

Re: Dynamic menus on BunsenLabs - a comprehensive guide

In "Preferences/Openbox/GUI Config Tool" there is "Appearance".

You can choose under "Menu Item" the font style and size for the bl-obmenu-generator menu.

Offline

Board footer

Powered by FluxBB