obamenu(1)
β¨ NAME β¨
obamenu β menu generator for the openbox window manager. yes bestie, that's the whole name. it's obamenu(1), straight out of the User Commands section of your manual, and it's about to be your new favourite little script. π
π DESCRIPTION π
okay so. obamenu (which stands for openbox automenu) is a menu generator for the openbox window manager. and here's the whole vibe: it is not out here chasing full and complete xdg compliance. it offers a reasonable basic level of xdg compliance and instead hyperfixates on low resource usage and pragmatic, real-life issues. it's giving minimalism, it's giving "works on my machine", it's giving slay. π¦
obamenu is literally a single python file with no exotic imports. it was developed with Python 2.7, but it should work fine with any Python > 2.5 (possibly even older) and with Python's standard included batteries. no cap. π«Ά
Usage:
obamenu
that's it. no options, no parameters, simple as that. But ...
since openbox users are not afraid of editing config files, a decision was taken to make obamenu's configuration powerful yet simple β not by command line ΓΌarameters (yes that's a typo, we love her, no notes) or a config file, but by having a short config section right within obamenu itself. icon behaviour. π
π The basic idea π
it seems reasonable to assume that openbox users are quite different from users of the more common and usually monstrous window managers. and while obamenu is perfectly capable of just splashing the usual full menu into your .jwmrc, the author's needs (and the assumptions about other openbox users' needs) mean obamenu's capabilities are somewhat more refined. β¨
first, some basics. on pretty much any halfway modern Unixoid OS, there's some directory with ".desktop" files which contain information about applications needed by the OS β things like its name, the command, possibly some comment, and so on. on most linuxes and BSD this directory is /usr/share/applications. of course, as with every standard, there's some idio^H^H^H^H players (like Gnome) who don't care that much and dump their .desktop files elsewhere and anywhere. π
similarly, there's also a place for all those nice application (not OS!) icons. usually they are in /usr/share/pixmaps. last but not least, there are "Categories" into which applications are grouped in menus. btw, obamenu does not show empty categories to avoid senseless clutter. periodt. π
so, let's have a look at obamenu's config section and its bits and pieces:
# ---- config --- applications_dirs = ("/usr/share/applications", )
image_dir = "/usr/share/pixmaps"
application_groups = ("Office",
"Development", "Graphics", "Internet", "Games", "System",
"Multimedia", "Utility", "Settings") group_aliases =
{"AudioVideo":"Multimedia","Game":"Games", "GTK":""} ignoreList =
("evince-previewer", "python3.4", "feh","xfce4-power-manager-
settings" )
terminal_string = "svte -e"
# your favourites terminal exec string # --- End of user config
---
and yes, the line breaks in there are cursed β that's the manpage's wrapping, not mine. π reproduced faithfully anyway because the facts do not change.
πΈ the settings, one by one πΈ
the first one, applications_dirs, is a list of directories in which .desktop files are to be found. the default, which should be fine for most users, is where .desktop files are usually put by linux or BSD. feel free to add more β for instance some subdirectory within your $HOME. π
the next one, image_dir, is quite similar but is about icon images for applications. a small caveat though: while most applications are nicely putting their .desktop files into the standard directory, the story with icons is quite different. particularly the wm behemoths like Gnome tend to spread icon files all over the place. often, for instance, icon files are to be found in some obscure subdirectory of /usr/share/icons, buried deep, depending on the chosen theme and the icon size. π
the author of obamenu admits freely to having taken a rather deliberate choice in that regard: 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 the 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.*'). π
the next setting, application_groups, looks innocent enough but has some power with it. obviously the entries in that list are "menu groups" or categories into which xdg menus put the applications, depending on some .desktop data. you might want to keep in mind that obamenu keeps categories in the order of this setting β i.e. you will find those categories in the menu in that order, too. π
and then there are buts ... the first but is that you almost certainly don't want more categories than the number of citizens in your home town. π another and more interesting but is that, obviously, usage profiles are different. for me as a developer, for instance, a "shows coloured stuff or makes sound" category seems sensibly sufficient; some movie editing people though might have quite different views... which brings us to the next setting.
group_aliases is a list of string pairs: the first one being what is put as category in the .desktop file(s), and the second one being the category it will end up in. in other words: this is your chance to rearrange things the way you want them. the author, for instance, has a rather frugal attitude regarding multimedia; accordingly, he simply throws anything audio or video related into one category "multimedia". π¬
to illustrate another potentially useful feature β though admittedly somewhat construed β have a look at "GTK" in those string pairs. its second string is empty, which comes down to telling obamenu "ignore that stuff. Don't put it into my menu". the reason being that openbox *only* creates menus for applications being sorted into a category. no category, no menu entry. π«
Hint: this setting may also be used to have translated strings in your menu; simply have the english cat. string aliased to a translated version. π
the second to last setting, ignoreList, is what its name suggests. it's a list of .desktop file names (without the ".desktop" part) you wish to ignore, i.e. to not have in your menu, for whatever reason.
finally the last setting, terminal_string, is telling obamenu how to call your favourite terminal emulator for console applications like "htop". (obamenu automagically takes care of having console applications called in a terminal emulator). π₯οΈ
note that the auto-generated menu can be put right into the menu section of an openbox menu.xml. and last but not least, you can, of course, also send obamenu's output to a file β which can be edited, inserted manually, feed your cat, and all the other things Unixoids can do with files. π
just to avoid misunderstandings, here's an example (the author's usage) of obamenu in an ob menu.xml file:
<menu id="desktop-app-menu" label="Applications" icon="/usr/share/icons/applications.png" execute="~/obamenu" />
License: obamenu is under a dual license depending on who you are. if you are using it as a private person (which also means non-commercially), it's under a 3 clause BSD license. if you are using it as or in the context of anything not private β for instance, in a business or an agency β it's under GPL v.2. pick your fighter accordingly. βοΈ
Disclaimer: the author uses mainly jwm. while obamenu has been tested to work properly, it has been considerably less tested than the author's jwmamenu (same thing but for jwm β in fact, obamenu has been derived from jwmamenu). π
the main motivation behind obamenu was the fact that openbox-menu (probably the most used menu generator for ob) doesn't compile properly on FreeBSD, and the author saw absolutely no reason why a menu generator couldn't β and shouldn't β be cross platform (e.g. using Python). π₯
News & Updates:
- ported (from jwmamenu) smarts to get rid of
'%x'target specifiers in Exec spec. (used for file managers but disturbing in menus) ποΈ - ported search for category icons in configurable Theme π¨
- some cleaning up and small enhancements, mainly for speed. β‘
and that's the whole page bestie. this was obamenu from the User Commands corner, January 2018, and it ate, no crumbs. go forth, generate your menus, soft link your icons, and remember: no category, no menu entry. π«Άβ¨π
π¦ where this page comes from
- debian bookworm: openbox 3.6.1-10 Β· GPL-2.0-or-later
- debian trixie: openbox 3.6.1-12+b2 Β· GPL-2.0-or-later
- ubuntu jammy: openbox 3.6.1-10 Β· GPL-2.0-or-later
- ubuntu noble: openbox 3.6.1-12build5 Β· GPL-2.0-or-later
- ubuntu questing: openbox 3.6.1-12ubuntu2
- ubuntu resolute: openbox 3.6.1-12ubuntu3 Β· GPL-2.0-or-later
- ubuntu stonking: openbox 3.6.1-12ubuntu3 Β· GPL-2.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms