Bug 443548 - Use a dynamic pipe menu for Fedora menu ?
Use a dynamic pipe menu for Fedora menu ?
Product: Fedora
Classification: Fedora
Component: openbox (Show other bugs)
All Linux
low Severity low
: ---
: ---
Assigned To: Miroslav Lichvar
Fedora Extras Quality Assurance
Depends On: 446438
  Show dependency treegraph
Reported: 2008-04-22 02:22 EDT by Luke Macken
Modified: 2016-09-19 22:38 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2008-06-25 06:40:40 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Luke Macken 2008-04-22 02:22:14 EDT
With the following code, we could ship openbox with a dynamic Fedora pipe menu.

import gobject
import gmenu
def walk_menu(entry):
    if entry.get_type() == gmenu.TYPE_DIRECTORY:
        print '<menu id="%s" label="%s">' % (entry.menu_id, entry.get_name())
        map(walk_menu, entry.get_contents())
        print '</menu>'
    elif entry.get_type() == gmenu.TYPE_ENTRY and not entry.is_excluded:
        print """
            <item label="%s">
              <action name="Execute">
        """ % (entry.get_name(), entry.get_exec())

print "<openbox_pipe_menu>"
map(walk_menu, gmenu.lookup_tree('applications.menu').root.get_contents())
print "</openbox_pipe_menu>"

...then, in the default menu configuration, all you have to put is:

     <menu id="fedora" label="Fedora" execute="/path/to/script.py" />

I initially wrote this script for the security spin (more details here:
http://lewk.org/blog/securitylivecd), but I think many people would find it
useful.  This is just a suggestion up for discussion.  What do you think?
Comment 1 Miroslav Lichvar 2008-04-22 08:27:01 EDT
I was thinking about adding gnome menus to the default menu for some time, but
wasn't able to finish it.

There are already written some utils that we could use:

- obx-xdgmenu (not packaged in Fedora) which does the same as your script, just
written in C, but it doesn't replace character & -> &amp; and similar, so "Sound
& Video" menu doesn't work. The script you posted probably has the same problem ;-).

- obmenu package has obm-xdg, unfortunately it doesn't seem to work well with
Fedora menus.

If you fix the problem with & character in the script and add an option to
create arbitrary menus (I think settings and preferences would be nice to have),
I'll be happy to include it.

If possible I'd like to keep openbox dependencies minimal and not add
gnome-menus (and python) to them. Do you think creating a -menus subpackage is a
good idea? A wrapper to switch between the pipe-menus and the hardcoded menus
when the subpackage is not installed would be needed.
Comment 2 Bug Zapper 2008-05-14 05:55:02 EDT
Changing version to '9' as part of upcoming Fedora 9 GA.
More information and reason for this action is here:
Comment 3 Miroslav Lichvar 2008-05-14 12:44:36 EDT
I've included the script with some minor modifications in the package. Thanks!
Comment 4 Fedora Update System 2008-05-20 10:55:22 EDT
openbox-,obconf-2.0.3-2.fc8 has been submitted as an update for Fedora 8
Comment 5 Fedora Update System 2008-05-21 07:00:04 EDT
openbox-, obconf-2.0.3-2.fc8 has been pushed to the Fedora 8 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing update openbox obconf'.  You can provide feedback for this update here: http://admin.fedoraproject.org/updates/F8/FEDORA-2008-4207
Comment 6 Luke Macken 2008-05-27 15:45:48 EDT
No update for Fedora 9?
Comment 7 Fedora Update System 2008-06-20 15:11:46 EDT
openbox-, obconf-2.0.3-2.fc8 has been pushed to the Fedora 8 stable repository.  If problems still persist, please make note of it in this bug report.

Note You need to log in before you can comment on or make changes to this bug.