SEARCH

Enter your search query in the box above ^, or use the forum search tool.

You are not logged in.

#1 2013-07-03 02:39:02

annoyingbeggar
#! Junkie
From: Florida
Registered: 2013-05-30
Posts: 430

Adding XDG menu (Sorted menu ala Gnome/KDE/XFCE) to Openbox Menu

I spent some time looking around for ways to do this and all I was able to find on here were threads where people said they couldn't get this to work.

Background
XDG, and specifically, the Desktop Menu Specification, are part of the Free Desktop standards. The goal is to create a uniform, desktop and platform independent, specification for ease of use across systems. You can read more about it here. If you are familiar with the menu structure in Gnome Classic, KDE, XFCE, LXDE, etc. then you are familar with the XDG menu standard.

Problem
It appears to be that Openbox, at some point in the past, changed the way the program obm-xdg is called. When running this from the command line the user was once presented with xml which could be included (directly or by piping) into the Openbox menu. However, if one executes the command now they are presented with a fairly non-descript error.

$ obm-xdg
Traceback (most recent call last):
  File "/usr/bin/obm-xdg", line 443, in <module>
    mnu.parseFile(filename)
  File "/usr/bin/obm-xdg", line 180, in parseFile
    f = open(filename)
IOError: [Errno 2] No such file or directory: ''

Solution
Apparently an update was made to obmenu, and obm-xdg, which made it so that the command can no longer be run without an argument. The built-in pipe option was never removed and the new implementation was not expressed in the command line. The solution is to execute obm-xdg with an argument. We need to point to one of the XDG menus which exists on the system. This can be done by adding the following in your menu.xml. (From the menu choose Settings-->Openbox-->Edit menu.xml)

(There might be other menus available in /etc/xdg/menus/ so look around and experiment.

<menu execute="obm-xdg /etc/xdg/menus/debian-menu.menu" id="xdg-menu" label="Applications"/>

The result can be seen below. Due to the way Openbox generates its menus this will not autoupdate, but selecting "Settings-->Openbox-->Reconfigure" from the menu should do the trick.

xdgmenu.jpg

As you can see I've also kept the Debian menu for now, but I will probably end up removing it in favor of the XDG organized one.

Good luck and enjoy!  smile


“I don't believe in charity. I believe in solidarity. Charity is so vertical. It goes from the top to the bottom. Solidarity is horizontal. It respects the other person. I have a lot to learn from other people.” - Eduardo Hughes Galeano

Offline

Help fund CrunchBang, donate to the project!

#2 2013-07-29 16:27:36

Ahks
Member
Registered: 2012-12-16
Posts: 14

Re: Adding XDG menu (Sorted menu ala Gnome/KDE/XFCE) to Openbox Menu

I don't have a /etc/xdg/menus/debian-menu.menu to obm-xdg to

******@******:~$ ls /etc/xdg/menus/
gnome-applications.menu  gnomecc.menu  xfce-applications.menu

Can you tell me how the .menu is generated?

EDIT: Why do I bother posting when I just answer myself 45seconds later via google

/etc/xdg/menus/debian-menu.menu is supplied by menu-xdg
http://packages.debian.org/wheezy/all/menu-xdg/filelist

smile

Last edited by Ahks (2013-07-29 16:31:30)

Offline

#3 2013-07-29 16:28:56

annoyingbeggar
#! Junkie
From: Florida
Registered: 2013-05-30
Posts: 430

Re: Adding XDG menu (Sorted menu ala Gnome/KDE/XFCE) to Openbox Menu

Change debian-menu.menu to xfce-applications.menu

Some random entries may be in French but with the XFCE menu it will auto-update.


“I don't believe in charity. I believe in solidarity. Charity is so vertical. It goes from the top to the bottom. Solidarity is horizontal. It respects the other person. I have a lot to learn from other people.” - Eduardo Hughes Galeano

Offline

#4 2013-07-29 16:43:38

Ahks
Member
Registered: 2012-12-16
Posts: 14

Re: Adding XDG menu (Sorted menu ala Gnome/KDE/XFCE) to Openbox Menu

Well I've got the debian-menu.menu so I went ahead and added it and the xfce-applications.menu to my menu.

Both are empty.
VIj6kT2l.png

Offline

#5 2013-07-29 17:27:19

annoyingbeggar
#! Junkie
From: Florida
Registered: 2013-05-30
Posts: 430

Re: Adding XDG menu (Sorted menu ala Gnome/KDE/XFCE) to Openbox Menu

What happens if you run obm-xdg /etc/xdg/menus/debian-menu.menu from the command line?


“I don't believe in charity. I believe in solidarity. Charity is so vertical. It goes from the top to the bottom. Solidarity is horizontal. It respects the other person. I have a lot to learn from other people.” - Eduardo Hughes Galeano

Offline

#6 2013-07-29 23:55:52

Ahks
Member
Registered: 2012-12-16
Posts: 14

Re: Adding XDG menu (Sorted menu ala Gnome/KDE/XFCE) to Openbox Menu

******@******:~$ obm-xdg /etc/xdg/menus/debian-menu.menu
<?xml version="1.0" encoding="utf-8"?>
<openbox_pipe_menu>
	<menu id="xdg-Applications" label="Applications">
		<menu id="xdg-Network" label="Network">
</menu>
		<menu id="xdg-Science" label="Science">
</menu>
		<menu id="xdg-System" label="System">
</menu>
	</menu>
	<menu id="xdg-Games" label="Games">
</menu>
	<menu id="xdg-Screen" label="Screen">
</menu>
</openbox_pipe_menu>

So it's working... but showing an empty menu.

How is the .menu populated?

Offline

#7 2013-07-31 01:11:55

annoyingbeggar
#! Junkie
From: Florida
Registered: 2013-05-30
Posts: 430

Re: Adding XDG menu (Sorted menu ala Gnome/KDE/XFCE) to Openbox Menu

menu-xdg seems to be the problem. I am able to replicate your menus after installing it (I didn't have it before.) Unfortunately removing and purging it does not repopulate the .menu files.

Give me some time with this and I will see if I can come up with a solution.


“I don't believe in charity. I believe in solidarity. Charity is so vertical. It goes from the top to the bottom. Solidarity is horizontal. It respects the other person. I have a lot to learn from other people.” - Eduardo Hughes Galeano

Offline

#8 2013-07-31 01:15:50

Ahks
Member
Registered: 2012-12-16
Posts: 14

Re: Adding XDG menu (Sorted menu ala Gnome/KDE/XFCE) to Openbox Menu

I've been using the terminal to run most apps so all this has been was a clinic in my typing skills smile I'd appreciate a fix, but don't worry at it too hard wink

Offline

#9 2013-07-31 01:45:22

annoyingbeggar
#! Junkie
From: Florida
Registered: 2013-05-30
Posts: 430

Re: Adding XDG menu (Sorted menu ala Gnome/KDE/XFCE) to Openbox Menu

If you want another alternative, there is a debian menu built-in to Openbox. It's not as nice but it works in the meantime. You need to uncomment the Debian menu section of rc.xml and add <menu id="/Debian"/> to menu.xml.

I'm trying to find a solution for this still as it is bothering me. I've read about a books worth of man pages and forums with no luck on the issue. I'm stubborn, though.


“I don't believe in charity. I believe in solidarity. Charity is so vertical. It goes from the top to the bottom. Solidarity is horizontal. It respects the other person. I have a lot to learn from other people.” - Eduardo Hughes Galeano

Offline

#10 2013-07-31 03:14:35

Ahks
Member
Registered: 2012-12-16
Posts: 14

Re: Adding XDG menu (Sorted menu ala Gnome/KDE/XFCE) to Openbox Menu

I've got the debian menu enabled and it's a bit rough. I still tend to just run most things via dmenu or a terminal.

Offline

#11 2013-07-31 03:26:58

annoyingbeggar
#! Junkie
From: Florida
Registered: 2013-05-30
Posts: 430

Re: Adding XDG menu (Sorted menu ala Gnome/KDE/XFCE) to Openbox Menu

Got it sorted.

If the file ~/.obmxdg.xml exists, delete it. Problem solved.  big_smile

I figured this out by running locate obm when I ran out of ideas. cat $HOME/.obmxdg.xml showed the minimal output that you are seeing. I deleted the file and it worked. For some reason using the tilde didn't work to cat or remove it and ls -A *.xml didn't work but the file was there. As soon as it was deleted the menu came back as it should have.


“I don't believe in charity. I believe in solidarity. Charity is so vertical. It goes from the top to the bottom. Solidarity is horizontal. It respects the other person. I have a lot to learn from other people.” - Eduardo Hughes Galeano

Offline

#12 2013-08-01 20:01:19

Ahks
Member
Registered: 2012-12-16
Posts: 14

Re: Adding XDG menu (Sorted menu ala Gnome/KDE/XFCE) to Openbox Menu

Ok, this is strange. The file is there, so I deleted it. But it would seem that it's being automatically generated by the process of opening the menu...
SO
I thought I'd get wise and rm the file then ln -s it to /etc/xdg/menus/debian-menu.menu which in turn gives me an invalid output from pipe menu "obm-xdg /etc/xdg/menus/debian-menu.menu" error box when I access the menu item

So I run a few things in the terminal...
both
******@******:~$ obm-xdg /etc/xdg/menus/debian-menu.menu
and
******@******:~$ obm-xdg /home/Ahks/.obmxdg.xml

output:

<!DOCTYPE Menu PUBLIC "-//freedesktop//DTD Menu 0.8//EN"
 "http://www.freedesktop.org/standards/menu-spec/menu-0.8.dtd">
<!-- Automatically generated do not edit -->
<Menu>
<AppDir>/var/lib/menu-xdg/applications</AppDir>
<DirectoryDir>/var/lib/menu-xdg/desktop-directories/menu-xdg</DirectoryDir>
<Name>Debian</Name>
<Directory>debian.directory</Directory>
<Include>
<Category>X-Debian</Category>
</Include>
<Menu>
<Name>Applications</Name>
<Directory>debian-applications.directory</Directory>
<Include>
<Category>X-Debian-Applications</Category>
</Include>
<Menu>
<Name>Accessibility</Name>
<Directory>debian-applications-accessibility.directory</Directory>
<Include>
<Category>X-Debian-Applications-Accessibility</Category>
</Include>
</Menu>
<Menu>
<Name>AudioVideo</Name>
<Directory>debian-applications-audiovideo.directory</Directory>
<Include>
<Category>X-Debian-Applications-AudioVideo</Category>
</Include>
</Menu>
<Menu>
<Name>Data Management</Name>
<Directory>debian-applications-data-management.directory</Directory>
<Include>
<Category>X-Debian-Applications-Data-Management</Category>
</Include>
</Menu>
<Menu>
<Name>Editors</Name>
<Directory>debian-applications-editors.directory</Directory>
<Include>
<Category>X-Debian-Applications-Editors</Category>
</Include>
</Menu>
<Menu>
<Name>File Management</Name>
<Directory>debian-applications-file-management.directory</Directory>
<Include>
<Category>X-Debian-Applications-File-Management</Category>
</Include>
</Menu>
<Menu>
<Name>Graphics</Name>
<Directory>debian-applications-graphics.directory</Directory>
<Include>
<Category>X-Debian-Applications-Graphics</Category>
</Include>
</Menu>
<Menu>
<Name>Network</Name>
<Directory>debian-applications-network.directory</Directory>
<Include>
<Category>X-Debian-Applications-Network</Category>
</Include>
<Menu>
<Name>Communication</Name>
<Directory>debian-applications-network-communication.directory</Directory>
<Include>
<Category>X-Debian-Applications-Network-Communication</Category>
</Include>
</Menu>
<Menu>
<Name>File Transfer</Name>
<Directory>debian-applications-network-file-transfer.directory</Directory>
<Include>
<Category>X-Debian-Applications-Network-File-Transfer</Category>
</Include>
</Menu>
<Menu>
<Name>Web Browsing</Name>
<Directory>debian-applications-network-web-browsing.directory</Directory>
<Include>
<Category>X-Debian-Applications-Network-Web-Browsing</Category>
</Include>
</Menu>
</Menu>
<Menu>
<Name>Office</Name>
<Directory>debian-applications-office.directory</Directory>
<Include>
<Category>X-Debian-Applications-Office</Category>
</Include>
</Menu>
<Menu>
<Name>Programming</Name>
<Directory>debian-applications-programming.directory</Directory>
<Include>
<Category>X-Debian-Applications-Programming</Category>
</Include>
</Menu>
<Menu>
<Name>Science</Name>
<Directory>debian-applications-science.directory</Directory>
<Include>
<Category>X-Debian-Applications-Science</Category>
</Include>
<Menu>
<Name>Mathematics</Name>
<Directory>debian-applications-science-mathematics.directory</Directory>
<Include>
<Category>X-Debian-Applications-Science-Mathematics</Category>
</Include>
</Menu>
</Menu>
<Menu>
<Name>Shells</Name>
<Directory>debian-applications-shells.directory</Directory>
<Include>
<Category>X-Debian-Applications-Shells</Category>
</Include>
</Menu>
<Menu>
<Name>Sound</Name>
<Directory>debian-applications-sound.directory</Directory>
<Include>
<Category>X-Debian-Applications-Sound</Category>
</Include>
</Menu>
<Menu>
<Name>System</Name>
<Directory>debian-applications-system.directory</Directory>
<Include>
<Category>X-Debian-Applications-System</Category>
</Include>
<Menu>
<Name>Administration</Name>
<Directory>debian-applications-system-administration.directory</Directory>
<Include>
<Category>X-Debian-Applications-System-Administration</Category>
</Include>
</Menu>
<Menu>
<Name>Hardware</Name>
<Directory>debian-applications-system-hardware.directory</Directory>
<Include>
<Category>X-Debian-Applications-System-Hardware</Category>
</Include>
</Menu>
<Menu>
<Name>Monitoring</Name>
<Directory>debian-applications-system-monitoring.directory</Directory>
<Include>
<Category>X-Debian-Applications-System-Monitoring</Category>
</Include>
</Menu>
<Menu>
<Name>Package Management</Name>
<Directory>debian-applications-system-package-management.directory</Directory>
<Include>
<Category>X-Debian-Applications-System-Package-Management</Category>
</Include>
</Menu>
<Menu>
<Name>Security</Name>
<Directory>debian-applications-system-security.directory</Directory>
<Include>
<Category>X-Debian-Applications-System-Security</Category>
</Include>
</Menu>
</Menu>
<Menu>
<Name>Terminal Emulators</Name>
<Directory>debian-applications-terminal-emulators.directory</Directory>
<Include>
<Category>X-Debian-Applications-Terminal-Emulators</Category>
</Include>
</Menu>
<Menu>
<Name>Text</Name>
<Directory>debian-applications-text.directory</Directory>
<Include>
<Category>X-Debian-Applications-Text</Category>
</Include>
</Menu>
<Menu>
<Name>Tools</Name>
<Directory>debian-applications-tools.directory</Directory>
<Include>
<Category>X-Debian-Applications-Tools</Category>
</Include>
</Menu>
<Menu>
<Name>Video</Name>
<Directory>debian-applications-video.directory</Directory>
<Include>
<Category>X-Debian-Applications-Video</Category>
</Include>
</Menu>
<Menu>
<Name>Viewers</Name>
<Directory>debian-applications-viewers.directory</Directory>
<Include>
<Category>X-Debian-Applications-Viewers</Category>
</Include>
</Menu>
</Menu>
<Menu>
<Name>Games</Name>
<Directory>debian-games.directory</Directory>
<Include>
<Category>X-Debian-Games</Category>
</Include>
<Menu>
<Name>Toys</Name>
<Directory>debian-games-toys.directory</Directory>
<Include>
<Category>X-Debian-Games-Toys</Category>
</Include>
</Menu>
</Menu>
<Menu>
<Name>Help</Name>
<Directory>debian-help.directory</Directory>
<Include>
<Category>X-Debian-Help</Category>
</Include>
</Menu>
<Menu>
<Name>Screen</Name>
<Directory>debian-screen.directory</Directory>
<Include>
<Category>X-Debian-Screen</Category>
</Include>
<Menu>
<Name>Locking</Name>
<Directory>debian-screen-locking.directory</Directory>
<Include>
<Category>X-Debian-Screen-Locking</Category>
</Include>
</Menu>
<Menu>
<Name>Saving</Name>
<Directory>debian-screen-saving.directory</Directory>
<Include>
<Category>X-Debian-Screen-Saving</Category>
</Include>
</Menu>
</Menu>
</Menu>

Last edited by Ahks (2013-08-01 20:04:34)

Offline

#13 2013-08-02 00:36:31

annoyingbeggar
#! Junkie
From: Florida
Registered: 2013-05-30
Posts: 430

Re: Adding XDG menu (Sorted menu ala Gnome/KDE/XFCE) to Openbox Menu

It should recreate the file with the appropriate contents in it. What is the output of cat $HOME/.obmxdg.xml The problem isn't inherently with the existance of the file, just the version of the file put there after installing menu-xdg.


“I don't believe in charity. I believe in solidarity. Charity is so vertical. It goes from the top to the bottom. Solidarity is horizontal. It respects the other person. I have a lot to learn from other people.” - Eduardo Hughes Galeano

Offline

#14 2013-08-02 09:21:44

Milozzy
#! Die Hard
Registered: 2011-02-22
Posts: 608
Website

Re: Adding XDG menu (Sorted menu ala Gnome/KDE/XFCE) to Openbox Menu

I am very happy with uxdgmenu by ju1ius https://github.com/ju1ius/uxdgmenu

Offline

Board footer

Powered by FluxBB

Copyright © 2012 CrunchBang Linux.
Proudly powered by Debian. Hosted by Linode.
Debian is a registered trademark of Software in the Public Interest, Inc.

Debian Logo