You are not logged in.
Good evening everyone!
Just done a clean install of Arch and now working on my applications menu. I want a automatically generated application menu exactly like ArchBang.
I have installed openbox-menu and all I get is "Menu not found, Please specify a menu specification file.". How do I get a menu like ArchBang without using ArchBang?
Thanks in advance!
Nic
Last edited by Toxcity (2012-02-11 16:34:27)
Offline
I don't think there are any automatically generated menus for openbox. ArchBang just comes with obmenu preconfigured on install. But to get the right click menu type:
pacman -S obmenu
launch the GUI menu editor by typing 'obmenu' from your terminal and edit the menu however you wish.
Desktop: Fedora 21 Mate + Compiz [x86_64] on 2 TiB HDD / Windows 7 Professional [x86_64] on 500 GiB HDD
Laptop: Arch Linux + Openbox [i686] 120 GiB SSD on Acer c720 Chromebook
Offline
I don't know what archbang uses, but you could have a look at obmenugen in AUR. It bases it's menu on *.desktop files.
Offline
Did you follow the wiki to install openbox? If so you should not get that error - you should have copied the default files to your ~/.config/openbox/ folder.
The default (for OB 3.5) even comes with pipe-menus set up by default. No extra packages are needed - just read up on pipe-menus.
"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" - Richard Stallman
Offline
ArchBang uses openbox-menu to generate it's application menu, it also assigns the correct icons to the menu entries.
Basically, I want my menu like that without me having to manually create it.
I'm looking at obm-xdg at the moment.
Offline
I've ended up using a script which I found in the Arch wiki page for Openbox. Working fine now. Thanks for the help guys!
Make sure you have gnome-menu installed.
How do I mark this as solved?
Last edited by Toxcity (2012-02-11 10:45:57)
Offline
[...] How do I mark this as solved?
Edit your first post and change the title into for example '[SOLVED] Openbox Application Menu'...
If the Matrix was real, it would run on Arch...
Offline
I've ended up using a script which I found in the Arch wiki page for Openbox. Working fine now. Thanks for the help guys!
Make sure you have gnome-menu installed.How do I mark this as solved?
Care to elaborate on that. I am also looking for an easier way to get started. What script? and why gnome-menu? A picture would be great, please.
EDIT: I was able to make some changes using obmenu. I have configured xdg to generate list of installed softwares. I suppose I will have to manually run update-menus every time I want to see newly installed software. Will update-menus only add newly installed software or will it regenerate whole list? Would be great if it's automatic in line to following scheme.
CUSTOM ENTRIES
*****************
AUTOMATICALLY GENERATED LIST (APP, MUSIC, ETC)
*****************
MORE CUSTOM ENTRIES
Thank you.
Last edited by donniezazen (2012-02-16 09:42:20)
Offline
It seems gnome-menu is used to give it the layout. I personally quite like the gnome menu layout so it's perfect for me.
Offline
You're welcome mate! :)
<menu id="apps-menu" label="Applications" execute="python2 /home/nic/.config/openbox/scripts/apps"/>
That's the line I have in my menu.xml for the menu, it points to the script called apps. Below is the script:
#!/usr/bin/python
#
import xdg.Menu, xdg.DesktopEntry, xdg.Config
import re, sys, os
from xml.sax.saxutils import escape
icons = True
try:
from gi.repository import Gtk
except ImportError:
icons = False
def icon_attr(entry):
if icons is False:
return ''
name = entry.getIcon()
if os.path.exists(name):
return ' icon="' + name + '"'
# work around broken .desktop files
# unless the icon is a full path it should not have an extension
name = re.sub('\..{3,4}$', '', name)
# imlib2 cannot load svg
iconinfo = theme.lookup_icon(name, 22, Gtk.IconLookupFlags.NO_SVG)
if iconinfo:
iconfile = iconinfo.get_filename()
iconinfo.free()
if iconfile:
return ' icon="' + iconfile + '"'
return ''
def entry_name(entry):
return escape(entry.getName().encode('utf-8', 'xmlcharrefreplace'))
def walk_menu(entry):
if isinstance(entry, xdg.Menu.Menu) and entry.Show is True:
print '<menu id="%s" label="%s"%s>' \
% (entry_name(entry),
entry_name(entry),
escape(icon_attr(entry)))
map(walk_menu, entry.getEntries())
print '</menu>'
elif isinstance(entry, xdg.Menu.MenuEntry) and entry.Show is True:
print ' <item label="%s"%s>' % \
(entry_name(entry.DesktopEntry).replace('"', ''),
escape(icon_attr(entry.DesktopEntry)))
command = re.sub(' -caption "%c"| -caption %c', ' -caption "%s"' % entry_name(entry.DesktopEntry), entry.DesktopEntry.getExec())
command = re.sub(' [^ ]*%[fFuUdDnNickvm]', '', command)
if entry.DesktopEntry.getTerminal():
command = 'xterm -title "%s" -e %s' % \
(entry_name(entry.DesktopEntry), command)
print ' <action name="Execute">' + \
'<command>%s</command></action>' % command
print ' </item>'
if len(sys.argv) > 1:
menufile = sys.argv[1] + '.menu'
else:
menufile = 'applications.menu'
lang = os.environ.get('LANG')
if lang:
xdg.Config.setLocale(lang)
# lie to get the same menu as in GNOME
xdg.Config.setWindowManager('GNOME')
if icons:
theme = Gtk.IconTheme.get_default()
menu = xdg.Menu.parse(menufile)
print '<?xml version="1.0" encoding="UTF-8"?>'
print '<openbox_pipe_menu>'
map(walk_menu, menu.getEntries())
print '</openbox_pipe_menu>'
Make sure you have gnome-menu installed and it should work fine. I am not the author of the script so cannot take any praise for it. ;)
Offline
Offline