SEARCH

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

You are not logged in.

#1 2014-10-11 23:53:21

rmoe
New Member
Registered: 2014-10-11
Posts: 9

working, portable openbox menu gen. available

Hi

I'm a rather hardcore FreeBSD user but if and when I have to use linux, it's usually Crunchbang, which I consider about as great as linux can get.

As it so happens the FreeBSD linuxolator linux emulation is CentOs based and I had to find out the ugly way that openbox-menu (an otherwise nice utility) didn't like to work there. Of course, it didn't work at all on FreeBSD.

That's how obamenu came to be ...

It's an automagical menu generator done right == portable, very lite, quite fast, no fuzz.

Written in Python, working with Python's standard install (v. 2.5 or higher), no dependencies, no fuzz; it just works. And yes, it does icons, both for applications and categories.

While it will almost certainly simply be called (no parameters, just call it and that's it), there is also some docu coming with it for those who feel more adventurous.

It has been tested both on FreeBSD and on linux (Crunchbang).

Its home is http://rmoe.anukis.de/obamenu.html

Oh, and: Just ignore the frigging psychodelic wallpaper in the screenshot. It was chosen by my cat. I'm innocent!

obamenu screenshot

Enjoy!

Last edited by rmoe (2014-10-11 23:55:28)

Offline

Be excellent to each other!

#2 2014-10-12 05:15:22

johnraff
nullglob
From: Nagoya, Japan
Registered: 2009-01-07
Posts: 4,148
Website

Re: working, portable openbox menu gen. available

Thank you for that, rmoe! It's working nicely for me in text-only mode, which is what I normally use, but not with icons. In the interests of science I enabled icons in openbox but they aren't being displayed. Here's a snippet of the code which obamenu is giving me:

<menu id="openbox-Office" label="Office"  >
<item icon="/usr/share/pixmaps//usr/share/pixmaps/evince.xpm" label="Document Viewer"><action name="Execute"><command><![CDATA[evince]]></command></action></item>
<item label="LibreOffice Draw"><action name="Execute"><command><![CDATA[libreoffice --draw]]></command></action></item>

As you can see, the string /usr/share/pixmaps/ is being doubled, and icons from /usr/share/icons/Faenza-CrunchBang/categories/24 aren't being output at all.
Here's my config section in the script:

applications_dirs = ("/usr/share/applications","/home/john/.local/share/applications" )
image_dir_base = "/usr/share" # without "pixmaps" -/usr/local/share in FreeBSD, /usr/share on linux
icon_Theme = "Faenza-Crunchbang"
image_cat_prefix = "applications-"
application_groups = ("Office",  "Development",  "Graphics", "Internet",  "Games", "System",  "Multimedia",  "Utilities",  "Settings")
group_aliases = {"Audio":"Multimedia","AudioVideo":"Multimedia","Game":"Games", "Utility":"Utilities", "GTK":"",  "GNOME":""}
ignoreList = ("evince-previewer", "Ted",  "wingide3.2", "python3.4", "feh","xfce4-power-manager-settings" )
terminal_string = "urxvt -e"         # your favourites terminal exec string

Anyway, it's fine for me as it is, but you might want to have a look at those icons. smile


John
--------------------
( a boring Japan blog , Japan Links, idle twitterings  and GitStuff )
#! forum moderator    BunsenLabs

Offline

#3 2014-10-12 06:15:35

rmoe
New Member
Registered: 2014-10-11
Posts: 9

Re: working, portable openbox menu gen. available

You are right, Johnraff, and I apologize.

In fact, I remember that error and I did fix it, but then I didn't copy the fixed version to the upload directory.

As for the theme, I'm sorry, because I just have to work with another linux and can't verify specific #! themes.
Generally speaking, however, the theme name for the config is just the name of the theme subdirectory in /usr/share/icons. Except for that detail (which you have probably right but I can't verify right now) your config looks perfectly fine to me.

As for the application icons there is only so much I can do because some guys out there (incl. big guys who actually worked on the standard, haha) spread their icons all over the place, gnumeric being one example that does actually use the correct directory (pixmaps) but then creates its own subdirectory for one(!) icon file.
If someone is picky about having the proper icon for each application there is basically just one sensible solution: hunt them icons down and soft link them to /usr/share/pixmaps.

The problem is: xdg is a complex (read: softened and rotten pseudo) standard and fully implementing it would make obamenu considerably bigger and bring in dependencies (and sure enough still miss some applications icons, because many out there don't give a damn about standards or simply don't know about them).

Things being what they are I had to make a decision and that decision was to not fight over some lost icons but to get 80% right and keep obamenu slick and fast.

All in all obamenu scratches my itch really well and I think (and hope) that might be true for many out there.

Let me know if any of you encounter problems or have questions! I'll be around for the next days to offer quick reaction.

Btw.: In case there are jwm fans here, there's also a jwmamenu ...

Offline

#4 2014-10-12 06:49:58

johnraff
nullglob
From: Nagoya, Japan
Registered: 2009-01-07
Posts: 4,148
Website

Re: working, portable openbox menu gen. available

Thanks - the current version now works OK, though only about 1/2 the items get icons. No problem (for me) I don't use them anyway. It's a nice little text-based menu and is fast enough not to need caching, at least on this machine, so the menu generated is always up to date.  cool


John
--------------------
( a boring Japan blog , Japan Links, idle twitterings  and GitStuff )
#! forum moderator    BunsenLabs

Offline

#5 2014-10-12 07:05:44

ohnonot
...again
Registered: 2012-05-22
Posts: 2,205

Re: working, portable openbox menu gen. available

totally appreciated, will check out.
also thanks to johnraff for "alphatesting"  wink

Offline

#6 2014-10-14 04:00:12

rmoe
New Member
Registered: 2014-10-11
Posts: 9

Re: working, portable openbox menu gen. available

There's a new version. Nothing major, just a small (rather rare) problem with very short icon filenames.

And btw: I tested some more for missing icons. I found out that there seem to be quite some applications which specify an icon but don't insall one. Other apps specify "standard" xdg icons that simply don't exist.

If you are interested I'm willing to make a small utility that just checks for those cases and lists all apps without icons (be it not existing, wrong or not found by obamenu).
Just let me know.


And btw: I found out that google images has icons for pretty every application.

Offline

#7 2014-10-14 08:16:15

ohnonot
...again
Registered: 2012-05-22
Posts: 2,205

Re: working, portable openbox menu gen. available

i'm getting "invalid output from pipemenu ~/bin/obamenu" :-(

$ openbox --version
Openbox 3.5.2

(archlinux)

first lines from obamenu's output:

<?xml version="1.0" encoding="UTF-8" ?><openbox_pipe_menu xmlns="http://openbox.org/"  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"  xsi:schemaLocation="http://openbox.org/" >
<menu id="openbox-Office" label="Office"  >
<item label="ePDFViewer" ><action name="Execute"><command><![CDATA[epdfview]]></command></action></item>
<item label="WPS Spreadsheets" ><action name="Execute"><command><![CDATA[/usr/bin/et]]></command></action></item>
<item label="LibreOffice Math" ><action name="Execute"><command><![CDATA[libreoffice --math]]></command></action></item>
<item label="WPS Presentation" ><action name="Execute"><command><![CDATA[/usr/bin/wpp]]></command></action></item>
<item label="LibreOffice" ><action name="Execute"><command><![CDATA[libreoffice]]></command></action></item>
<item label="WPS Writer" ><action name="Execute"><command><![CDATA[/usr/bin/wps]]></command></action></item>
<item label="LibreOffice Base" ><action name="Execute"><command><![CDATA[libreoffice --base]]></command></action></item>
<item label="LibreOffice Impress" ><action name="Execute"><command><![CDATA[libreoffice --impress]]></command></action></item>
<item label="LibreOffice Writer" ><action name="Execute"><command><![CDATA[libreoffice --writer]]></command></action></item>
<item label="LibreOffice Calc" ><action name="Execute"><command><![CDATA[libreoffice --calc]]></command></action></item>
<item label="LibreOffice Draw" ><action name="Execute"><command><![CDATA[libreoffice --draw]]></command></action></item>
</menu>
<menu id="openbox-Development" label="Development"  >
<item label="OpenJDK Policy Tool" ><action name="Execute"><command><![CDATA[/usr/bin/policytool]]></command></action></item>

and my config section:

applications_dirs = ("/usr/share/applications", )
image_dir_base = "/usr/share" # without "pixmaps" -/usr/local/share in FreeBSD, /usr/share on linux
icon_Theme = "iNX"
image_cat_prefix = "applications-"
application_groups = ("Office",  "Development",  "Graphics", "Internet",  "Games", "System",  "Multimedia",  "Utilities",  "Settings")
group_aliases = {"Audio":"Multimedia","AudioVideo":"Multimedia","Game":"Games", "Utility":"Utilities", "GTK":"",  "GNOME":""}
ignoreList = ("evince-previewer","python3.4", "feh","xfce4-power-manager-settings", "nautilus-browser", "lxshortcut" , "compton", "gnome-about", "mate-about")
terminal_string = "st -e"         # your favourites terminal exec string

i tried to shorten the first print '<?xml....' to '<openbox_pipe_menu>' because i've seen it like that on other pipemenus, but it didn't help either.

no clue what these "![CDATA..." thingies mean, but since johnraff has them too, i guess it's valid syntax.
it actually all looks like valid syntax to me. i'm stumped.

Last edited by ohnonot (2014-10-14 08:18:30)

Offline

#8 2014-10-14 08:57:46

rmoe
New Member
Registered: 2014-10-11
Posts: 9

Re: working, portable openbox menu gen. available

Strange.

Both your config section and the output part look OK to me.

What happens if you run '~/bin/obamenu > text.xml' in a terminal console?

I'm asking because I encountered that error a couple of times during development and testing and it was always either nonsense that I tried to feed to OB (like a forgotten angle bracket) or a Python error; those, however, would be printed out as a Python traceback.

I have tested obamenu meanwhile on multiple machines and linuxes and FreeBSD and I'm quite sure that the openbox syntax is correct (it also is in what you showed here).

Don't worry, I'm here and we'll get this working wink

P.S. Don't ask me about that CDATA stuff. I don't know much about it myself but I'm certain it's OK the way it is and OB wants it like that. Seems to be some syntax the OB parser wants the menu commands in.

Offline

#9 2014-10-14 15:25:03

ohnonot
...again
Registered: 2012-05-22
Posts: 2,205

Re: working, portable openbox menu gen. available

rmoe wrote:

What happens if you run '~/bin/obamenu > text.xml' in a terminal console?

nothing.
i mean, no output, it writes the file, the file looks exactly like what i posted.
the according bit in menu.xml:

<menu execute="obamenu" id="pipe-64555" label="Applications"/>

i don't see anything wrong there, and the menu works otherwise.

i will continue investigating.

here's the complete output of obamenu:

<?xml version="1.0" encoding="UTF-8" ?><openbox_pipe_menu xmlns="http://openbox.org/"  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"  xsi:schemaLocation="http://openbox.org/" >
<menu id="openbox-Office" label="Office"  >
<item label="ePDFViewer" ><action name="Execute"><command><![CDATA[epdfview]]></command></action></item>
<item label="WPS Spreadsheets" ><action name="Execute"><command><![CDATA[/usr/bin/et]]></command></action></item>
<item label="LibreOffice Math" ><action name="Execute"><command><![CDATA[libreoffice --math]]></command></action></item>
<item label="WPS Presentation" ><action name="Execute"><command><![CDATA[/usr/bin/wpp]]></command></action></item>
<item label="LibreOffice" ><action name="Execute"><command><![CDATA[libreoffice]]></command></action></item>
<item label="WPS Writer" ><action name="Execute"><command><![CDATA[/usr/bin/wps]]></command></action></item>
<item label="LibreOffice Base" ><action name="Execute"><command><![CDATA[libreoffice --base]]></command></action></item>
<item label="LibreOffice Impress" ><action name="Execute"><command><![CDATA[libreoffice --impress]]></command></action></item>
<item label="LibreOffice Writer" ><action name="Execute"><command><![CDATA[libreoffice --writer]]></command></action></item>
<item label="LibreOffice Calc" ><action name="Execute"><command><![CDATA[libreoffice --calc]]></command></action></item>
<item label="LibreOffice Draw" ><action name="Execute"><command><![CDATA[libreoffice --draw]]></command></action></item>
</menu>
<menu id="openbox-Development" label="Development"  >
<item label="OpenJDK Policy Tool" ><action name="Execute"><command><![CDATA[/usr/bin/policytool]]></command></action></item>
<item label="Qt4 Assistant" ><action name="Execute"><command><![CDATA[assistant-qt4]]></command></action></item>
<item label="CMake" icon="/usr/share/pixmaps/CMakeSetup32.png" ><action name="Execute"><command><![CDATA[cmake-gui]]></command></action></item>
<item label="Qt4 Linguist" ><action name="Execute"><command><![CDATA[linguist-qt4]]></command></action></item>
<item label="Geany" ><action name="Execute"><command><![CDATA[geany]]></command></action></item>
<item label="Qt4 Designer" ><action name="Execute"><command><![CDATA[designer-qt4]]></command></action></item>
<item label="Qt4 QDbusViewer" ><action name="Execute"><command><![CDATA[qdbusviewer-qt4]]></command></action></item>
<item label="Bluefish Editor" icon="/usr/share/pixmaps/bluefish.png" ><action name="Execute"><command><![CDATA[bluefish]]></command></action></item>
<item label="OpenJDK Monitoring & Management Console" ><action name="Execute"><command><![CDATA[/usr/bin/jconsole]]></command></action></item>
</menu>
<menu id="openbox-Graphics" label="Graphics"  >
<item label="ida" icon="/usr/share/pixmaps/ida.png" ><action name="Execute"><command><![CDATA[ida]]></command></action></item>
<item label="Specimen Font Previewer" ><action name="Execute"><command><![CDATA[gnome-specimen]]></command></action></item>
<item label="GNU Image Manipulation Program" ><action name="Execute"><command><![CDATA[gimp-2.8]]></command></action></item>
<item label="Gtkam Digital Camera Browser" icon="/usr/share/pixmaps/gtkam-camera.png" ><action name="Execute"><command><![CDATA[gtkam]]></command></action></item>
<item label="Geeqie" icon="/usr/share/pixmaps/geeqie.png" ><action name="Execute"><command><![CDATA[geeqie -r]]></command></action></item>
<item label="Inkscape" ><action name="Execute"><command><![CDATA[inkscape]]></command></action></item>
<item label="mtPaint" icon="/usr/share/pixmaps/mtpaint.png" ><action name="Execute"><command><![CDATA[mtpaint]]></command></action></item>
<item label="UFRaw" icon="/usr/share/pixmaps/ufraw.png" ><action name="Execute"><command><![CDATA[ufraw]]></command></action></item>
<item label="XPaint" icon="/usr/share/pixmaps/xpaint.png" ><action name="Execute"><command><![CDATA[xpaint]]></command></action></item>
<item label="Viewnior" ><action name="Execute"><command><![CDATA[viewnior]]></command></action></item>
<item label="FontForge" ><action name="Execute"><command><![CDATA[fontforge]]></command></action></item>
<item label="Evolvotron" ><action name="Execute"><command><![CDATA[evolvotron --grid 4x3]]></command></action></item>
<item label="LibreOffice Draw" ><action name="Execute"><command><![CDATA[libreoffice --draw]]></command></action></item>
<item label="Gcolor2" icon="/usr/share/pixmaps/gcolor2/icon.png" ><action name="Execute"><command><![CDATA[gcolor2]]></command></action></item>
<item label="gbdfed" icon="/usr/share/pixmaps/gbdfed.png" ><action name="Execute"><command><![CDATA[gbdfed]]></command></action></item>
</menu>
<menu id="openbox-Games" label="Games"  >
<item label="Foobillard++" icon="/usr/share/pixmaps/foobillardplus.png" ><action name="Execute"><command><![CDATA[foobillardplus]]></command></action></item>
<item label="Naev" icon="/usr/share/pixmaps/naev.png" ><action name="Execute"><command><![CDATA[naev]]></command></action></item>
<item label="FreeDroid" ><action name="Execute"><command><![CDATA[freedroid]]></command></action></item>
<item label="TecnoBallZ" icon="/usr/share/pixmaps/tecnoballz.xpm" ><action name="Execute"><command><![CDATA[tecnoballz]]></command></action></item>
<item label="Slime Volley" icon="/usr/share/pixmaps/slimevolley.xpm" ><action name="Execute"><command><![CDATA[slimevolley]]></command></action></item>
<item label="Frogatto" icon="/opt/frogatto/images/window-icon.png" ><action name="Execute"><command><![CDATA[/usr/bin/frogatto]]></command></action></item>
<item label="FreeDink" icon="/usr/share/pixmaps/freedink.png" ><action name="Execute"><command><![CDATA[freedink]]></command></action></item>
<item label="SuperTuxKart" icon="/usr/share/pixmaps/supertuxkart_128.png" ><action name="Execute"><command><![CDATA[supertuxkart]]></command></action></item>
<item label="Frozen Bubble" ><action name="Execute"><command><![CDATA[/usr/bin/vendor_perl/frozen-bubble]]></command></action></item>
<item label="Endgame: Singularity" icon="/usr/share/singularity/data/images/icon.png" ><action name="Execute"><command><![CDATA[/usr/bin/singularity]]></command></action></item>
<item label="Crack Attack!" ><action name="Execute"><command><![CDATA[crack-attack]]></command></action></item>
<item label="Critical Mass" icon="/usr/share/pixmaps/critter.png" ><action name="Execute"><command><![CDATA[critter]]></command></action></item>
<item label="Rocks'N'Diamonds" ><action name="Execute"><command><![CDATA[rocksndiamonds]]></command></action></item>
<item label="Neverball" ><action name="Execute"><command><![CDATA[neverball]]></command></action></item>
<item label="Hex-a-Hop" icon="/usr/share/hex-a-hop/icon.bmp" ><action name="Execute"><command><![CDATA[/usr/bin/hex-a-hop]]></command></action></item>
<item label="Snes9x" ><action name="Execute"><command><![CDATA[snes9x-gtk]]></command></action></item>
<item label="Neverputt" ><action name="Execute"><command><![CDATA[neverputt]]></command></action></item>
<item label="Fillets-ng" icon="/usr/share/pixmaps/fillets-ng.png" ><action name="Execute"><command><![CDATA[fillets]]></command></action></item>
<item label="Pingus" icon="/usr/share/pingus/images/core/editor/actions.png" ><action name="Execute"><command><![CDATA[pingus]]></command></action></item>
<item label="Globulation 2" icon="/usr/share/pixmaps/glob2-icon-48x48.png" ><action name="Execute"><command><![CDATA[glob2]]></command></action></item>
<item label="Alien Arena" icon="/usr/share/pixmaps/alienarena.png" ><action name="Execute"><command><![CDATA[alienarena]]></command></action></item>
<item label="ScummVM" icon="/usr/share/pixmaps/scummvm.xpm" ><action name="Execute"><command><![CDATA[scummvm]]></command></action></item>
<item label="Dungeon Crawl Stone Soup" icon="/usr/share/pixmaps/stone-soup.png" ><action name="Execute"><command><![CDATA[crawl-tiles]]></command></action></item>
<item label="INSTEAD Launcher" ><action name="Execute"><command><![CDATA[/usr/bin/instead-launcher]]></command></action></item>
<item label="MegaGlest Map Editor" icon="/usr/share/pixmaps/megaglest.png" ><action name="Execute"><command><![CDATA[megaglest_editor]]></command></action></item>
<item label="Armagetron Advanced" ><action name="Execute"><command><![CDATA[armagetronad]]></command></action></item>
<item label="Gweled" ><action name="Execute"><command><![CDATA[gweled]]></command></action></item>
<item label="MegaGlest Model Viewer" icon="/usr/share/pixmaps/megaglest.png" ><action name="Execute"><command><![CDATA[megaglest_g3dviewer]]></command></action></item>
<item label="Mari0" ><action name="Execute"><command><![CDATA[mari0]]></command></action></item>
<item label="Flobopuyo" icon="/usr/share/pixmaps/flobopuyo.png" ><action name="Execute"><command><![CDATA[flobopuyo]]></command></action></item>
<item label="legend-of-kyrandia-1" icon="/opt/abandonia/Kyrandia1/KYRANDIA.ICO" ><action name="Execute"><command><![CDATA[/usr/bin/Kyrandia1]]></command></action></item>
<item label="KoboDeluxe" ><action name="Execute"><command><![CDATA[kobodl]]></command></action></item>
<item label="Warzone 2100" ><action name="Execute"><command><![CDATA[warzone2100]]></command></action></item>
<item label="FreeDinkedit" icon="/usr/share/pixmaps/freedink.png" ><action name="Execute"><command><![CDATA[freedinkedit]]></command></action></item>
<item label="Beneath a Steel Sky" ><action name="Execute"><command><![CDATA[bass]]></command></action></item>
<item label="Golly" icon="/usr/share/pixmaps/golly.xpm" ><action name="Execute"><command><![CDATA[golly]]></command></action></item>
<item label="Caph" ><action name="Execute"><command><![CDATA[caph]]></command></action></item>
<item label="GLHack" ><action name="Execute"><command><![CDATA[glhack]]></command></action></item>
<item label="Abuse" icon="/usr/share/pixmaps/abuse.png" ><action name="Execute"><command><![CDATA[abuse]]></command></action></item>
<item label="MegaGlest" icon="/usr/share/pixmaps/megaglest.png" ><action name="Execute"><command><![CDATA[megaglest]]></command></action></item>
<item label="INSTEAD" icon="/usr/share/pixmaps/sdl_instead.ico" ><action name="Execute"><command><![CDATA[/usr/bin//sdl-instead]]></command></action></item>
<item label="Dosbox" icon="/usr/share/pixmaps/dosbox.png" ><action name="Execute"><command><![CDATA[dosbox]]></command></action></item>
<item label="PokerTH" icon="/usr/share/pixmaps/pokerth.png" ><action name="Execute"><command><![CDATA[pokerth]]></command></action></item>
</menu>
<menu id="openbox-System" label="System"  >
<item label="ix" ><action name="Execute"><command><![CDATA[st -e ix]]></command></action></item>
<item label="Oracle VM VirtualBox" ><action name="Execute"><command><![CDATA[VirtualBox]]></command></action></item>
<item label="UNetbootin" ><action name="Execute"><command><![CDATA[/usr/bin/unetbootin_polkit]]></command></action></item>
<item label="File Manager PCManFM" ><action name="Execute"><command><![CDATA[pcmanfm]]></command></action></item>
<item label="dconf Editor" ><action name="Execute"><command><![CDATA[dconf-editor]]></command></action></item>
<item label="GParted" ><action name="Execute"><command><![CDATA[/usr/bin/gparted_polkit]]></command></action></item>
<item label="UXTerm" icon="/usr/share/pixmaps/xterm-color_48x48.xpm" ><action name="Execute"><command><![CDATA[uxterm]]></command></action></item>
<item label="Htop" icon="/usr/share/pixmaps/htop.png" ><action name="Execute"><command><![CDATA[st -e htop]]></command></action></item>
<item label="LSHW" icon="/usr/share/lshw/artwork/logo.svg" ><action name="Execute"><command><![CDATA[/usr/sbin/gtk-lshw]]></command></action></item>
<item label="Heimdall" ><action name="Execute"><command><![CDATA[heimdall-frontend]]></command></action></item>
<item label="gtk2fontsel" ><action name="Execute"><command><![CDATA[gtk2fontsel]]></command></action></item>
<item label="XTerm" icon="/usr/share/pixmaps/xterm-color_48x48.xpm" ><action name="Execute"><command><![CDATA[xterm]]></command></action></item>
<item label="Avahi Zeroconf Browser" ><action name="Execute"><command><![CDATA[/usr/bin/avahi-discover]]></command></action></item>
<item label="emelFM2" icon="/usr/share/pixmaps/emelfm2.png" ><action name="Execute"><command><![CDATA[/usr/bin/emelfm2]]></command></action></item>
<item label="Eagle Mode" icon="/opt/eaglemode/res/icons/eaglemode48.png" ><action name="Execute"><command><![CDATA[/opt/eaglemode/eaglemode.sh]]></command></action></item>
<item label="PkgBrowser" ><action name="Execute"><command><![CDATA[pkgbrowser]]></command></action></item>
<item label="System Profiler and Benchmark" icon="/usr/share/hardinfo/pixmaps/logo.png" ><action name="Execute"><command><![CDATA[hardinfo]]></command></action></item>
</menu>
<menu id="openbox-Multimedia" label="Multimedia"  >
<item label="Qt V4L2 test Utility" ><action name="Execute"><command><![CDATA[qv4l2]]></command></action></item>
<item label="Audacity" icon="/usr/share/pixmaps/audacity.xpm" ><action name="Execute"><command><![CDATA[audacity]]></command></action></item>
<item label="streamtuner2" ><action name="Execute"><command><![CDATA[streamtuner2]]></command></action></item>
<item label="Avidemux (GTK+)" icon="/usr/share/pixmaps/avidemux.png" ><action name="Execute"><command><![CDATA[avidemux2_gtk]]></command></action></item>
<item label="Enqueue in SMPlayer" ><action name="Execute"><command><![CDATA[smplayer -add-to-playlist]]></command></action></item>
<item label="FFADO Mixer" icon="/usr/share/pixmaps/ffado.png" ><action name="Execute"><command><![CDATA[ffado-mixer]]></command></action></item>
<item label="Audio Mixer" ><action name="Execute"><command><![CDATA[xfce4-mixer]]></command></action></item>
<item label="MPlayer Media Player" icon="/usr/share/pixmaps/mplayer.png" ><action name="Execute"><command><![CDATA[mplayer]]></command></action></item>
<item label="Kid3-qt" ><action name="Execute"><command><![CDATA[kid3-qt]]></command></action></item>
<item label="GTK Youtube Viewer" icon="/usr/share/pixmaps/gtk-youtube-viewer.png" ><action name="Execute"><command><![CDATA[gtk-youtube-viewer]]></command></action></item>
<item label="VLC media player" ><action name="Execute"><command><![CDATA[/usr/bin/vlc --started-from-file]]></command></action></item>
<item label="Aegisub" ><action name="Execute"><command><![CDATA[aegisub-3.2]]></command></action></item>
<item label="Gnome Music Player Client" ><action name="Execute"><command><![CDATA[gmpc]]></command></action></item>
<item label="Xfburn" ><action name="Execute"><command><![CDATA[xfburn]]></command></action></item>
<item label="SMPlayer" ><action name="Execute"><command><![CDATA[smplayer]]></command></action></item>
</menu>
<menu id="openbox-Utilities" label="Utilities"  >
<item label="Sunflower" icon="/usr/share/pixmaps/sunflower.png" ><action name="Execute"><command><![CDATA[sunflower]]></command></action></item>
<item label="File Manager PCManFM" ><action name="Execute"><command><![CDATA[pcmanfm]]></command></action></item>
<item label="AllTray 0.7.5.1dev" ><action name="Execute"><command><![CDATA[alltray -a]]></command></action></item>
<item label="Terminal Emulator" ><action name="Execute"><command><![CDATA[exo-open --launch TerminalEmulator]]></command></action></item>
<item label="KeePassX" icon="/usr/share/pixmaps/keepassx.xpm" ><action name="Execute"><command><![CDATA[keepassx]]></command></action></item>
<item label="Furius ISO Mount" icon="/usr/share/furiusisomount/pix/furiusisomount.png" ><action name="Execute"><command><![CDATA[furiusisomount]]></command></action></item>
<item label="medit" ><action name="Execute"><command><![CDATA[medit]]></command></action></item>
<item label="emelFM2" icon="/usr/share/pixmaps/emelfm2.png" ><action name="Execute"><command><![CDATA[/usr/bin/emelfm2]]></command></action></item>
<item label="Root Terminal" icon="/usr/share/pixmaps/gksu-root-terminal.png" ><action name="Execute"><command><![CDATA[gksu -l gnome-terminal]]></command></action></item>
<item label="ClipIt" ><action name="Execute"><command><![CDATA[clipit]]></command></action></item>
<item label="File Manager" ><action name="Execute"><command><![CDATA[exo-open --launch FileManager]]></command></action></item>
<item label="About Xfce" ><action name="Execute"><command><![CDATA[xfce4-about]]></command></action></item>
<item label="Xfburn" ><action name="Execute"><command><![CDATA[xfburn]]></command></action></item>
<item label="Archive Manager" ><action name="Execute"><command><![CDATA[file-roller]]></command></action></item>
</menu>
<menu id="openbox-Settings" label="Settings"  >
<item label="Preferred Applications" ><action name="Execute"><command><![CDATA[exo-preferred-applications]]></command></action></item>
<item label="Panel" ><action name="Execute"><command><![CDATA[xfce4-panel --preferences]]></command></action></item>
<item label="Qt4 Config" ><action name="Execute"><command><![CDATA[qtconfig-qt4]]></command></action></item>
<item label="Privilege granting" ><action name="Execute"><command><![CDATA[gksu-properties]]></command></action></item>
<item label="Customize Look and Feel" ><action name="Execute"><command><![CDATA[lxappearance]]></command></action></item>
<item label="IcedTea-Web Control Panel" icon="/usr/share/pixmaps/javaws.png" ><action name="Execute"><command><![CDATA[/usr/share/icedtea-web/bin/itweb-settings]]></command></action></item>
<item label="Adobe Flash Player" ><action name="Execute"><command><![CDATA[flash-player-properties]]></command></action></item>
<item label="NVIDIA X Server Settings" icon="/usr/share/pixmaps/nvidia-settings.png" ><action name="Execute"><command><![CDATA[/usr/bin/nvidia-settings]]></command></action></item>
<item label="Openbox Configuration Manager" icon="/usr/share/pixmaps/obconf.png" ><action name="Execute"><command><![CDATA[obconf]]></command></action></item>
<item label="Default Sound Card" ><action name="Execute"><command><![CDATA[/usr/bin/asoundconf-gtk]]></command></action></item>
<item label="Desktop Preferences" ><action name="Execute"><command><![CDATA[pcmanfm --desktop-pref]]></command></action></item>
<item label="Theme Configuration" ><action name="Execute"><command><![CDATA[gtk-theme-config]]></command></action></item>
<item label="Preferred Applications" ><action name="Execute"><command><![CDATA[libfm-pref-apps]]></command></action></item>
<item label="ARandR" ><action name="Execute"><command><![CDATA[arandr]]></command></action></item>
</menu>
</openbox_pipe_menu>

omitting the openbox_pipe_menu header & footer, i can insert the whole block into my menu.xml and all is fine, so the problem must be in the way i'm using the pipe, or in the way the pipe is generated.
2 years with openbox and i don't know what's going on... brain's going spongy i guess.

Last edited by ohnonot (2014-10-14 16:03:04)

Offline

#10 2014-10-15 00:34:06

rmoe
New Member
Registered: 2014-10-11
Posts: 9

Re: working, portable openbox menu gen. available

OK, ohnonot

I've built something like a minimal debugger to close in on the problem.
You can find it here http://rmoe.anukis.de/amenudbg

There is only 1 var to set, namely some X editor; default is mousepad.

Here's how it works:

- copy amenudbg *exactly* to where obamenu is (in your case /usr/bin I believe) and make it owned by the same owner (and, of course, chmod +x it).
- comment out your current obamenu line in OB's menu.xml
- tmp replace it by "<menu id="desktop-app-menu" label="Applications" execute="PATH/amenudbg" />"
where PATH is as described above.
- reconfigure OB
- run it ... (click it)

Here's what happens:

amenudbg builds a very simple pipe menu (seen from OB's perspective) and also opens a temp file in /tmp and writes some info into it (inkl. what it feeds back to OB). It's intentionally that primitive to avoid OB hickups. After all, we want to find out where exactly obamenu doesn't work for you.

When clicking on it in the OB menu you will be prompted whether you want to look at the result. Click "yes". That's a detour, I know, but it's intentional. Showing that prompt indicates that OB has digested the feed-back "menu".
After clicking "yes" mousepad (or whatever (Gui!) editor you tell amenudbg to use) you will see what amenudbg has written down about itself and some important info along with the feed back to OB.

Possibly the most important bit is the ppid which should be the pid of openbox; grepping ps for it should look something like this:
"  903 ?        Ssl    0:03 /usr/bin/openbox --sm-save-file ~/.cache/openbox/sessions/1413324847-903-4132006434.obs --sm-no-load"

Please, show me that and amenudbg's output, either here or via PN.

Offline

#11 2014-10-15 06:25:26

ohnonot
...again
Registered: 2012-05-22
Posts: 2,205

Re: working, portable openbox menu gen. available

ok this is the output from amenudbg:

called with: 
CPython - 2.7.8
termid: /dev/tty, euid: 1000, ppid: 623
cwd: /home/XXXX

Output for OB:
<openbox_pipe_menu>
<item label="obamenu Dbg">
	<action name="Execute">
		<prompt>Look at amenudbg output?</prompt>
		<command>geany /tmp/amenudbg6610</command>
	</action>
</item>
</openbox_pipe_menu>

so it works.
i noticed another thing:
i copied another instance of obamenu from your webpage and tried it without modifying it at all.
at first i get the non-descript error, but i had to change "#!/usr/bin/env python" to "#!/usr/bin/env python2" (this is something i had done already on the first version but forgot to mention).
then i get no output, but no error either.
as soon as i change /usr/local to /usr, i get the error again. no matter what else i try to adjust.

trying to hunt down the cause with such a non-descript error message, i came across 2 things that made me think:
- otherwise valid syntax, but encoding issues. but since you, too, live in a non-english environment and everything is utf-8, i don't see how...
- someone mentioned a corrupt .desktop file being the source, but since copying the pipemenu's output to menu.xml works, that can't be it either...

Last edited by ohnonot (2014-10-15 06:28:47)

Offline

#12 2014-10-15 07:05:26

rmoe
New Member
Registered: 2014-10-11
Posts: 9

Re: working, portable openbox menu gen. available

@ohnonot

OK, thanks.

I guess you have verified (ps -ax | grep 623) that the parent process actually *is* openbox ...

As for /usr vs. /usr/local it's (from what I see) basically a question of linux (/usr) or FreeBSD (/usr/local). To be sure, just look where the applications, icons, and pixmaps subdirectories are.

As for the test: It obviously runs and works. Concerning the pipe menu stuff the only difference is that obamenu uses the fully blown header where amenudbg uses a primitive minimal header. In other words: If amenudbg does work then obamenu should work, too.

As for your python2 and then an empty menu: I have doubts. The question whether the menu is empty or not does not depend on calling python or python2 (with python usually being just a soft link to python2 anyway).

My take is that there is a problem in the menu. Possibly some weird stuff in some .desktop file that obamenu is (not yet) prepared to handle via pipe menu while handling it when fed directly from menu.xml.

I think right now that I can be certain that the calling from OB works, the best thing to do is for you to simply email me your full obamenu output (running obamenu from the commandline outputting into a file as you have already done successfully).
And another friendly request: Please create a tar.gz of all .desktop files in your applications directory and email them, too. I'd like to have a good look at them (you have a PN).

@johnraff

I thought about you and I think I should offer some way for puristic guys like you to have obamenu create an iconless text-only menu upon request. You can expect some new version within a day or two.

Offline

#13 2014-10-15 16:58:21

ohnonot
...again
Registered: 2012-05-22
Posts: 2,205

Re: working, portable openbox menu gen. available

about python2: no, that was just something i forgot to mention.
archlinux uses python3 by default, so i have to change that line in quite many python scripts.

i know most of my stuff is in /usr, and not in /usr/local.
but the behavior shows me that the error appears as soon as the script gets something to parse - probably one of the desktop files.

a little more deduction, some trial and error, and i found the culprit:

<item label="OpenJDK Monitoring & Management Console" >
<action name="Execute"><command><![CDATA[/usr/bin/jconsole]]></command></action>
</item>

notice the "&" in the item label! that's what broke it.
could you tell python to change every "&" to "&amp;"?
sorry, if it was a shell script i could do it myself.

Offline

#14 2014-10-15 21:40:52

rmoe
New Member
Registered: 2014-10-11
Posts: 9

Re: working, portable openbox menu gen. available

There is a new version (1.1.7) now.

- The label is now xml escaped. I tested it with evil labels like "Exe&cute &so'me<"
- leaving image_cat_prefix empty (i.e. the empty string -> "") disables the icon stuff and creates a text only menu
- There is a new config entry: simpleOBheader (default False, i.e. no changes to the former way)
While I do not think that the full pipe menu header is guilty of anything (it worked fine) I wanted you to have the option, for whatever reason you may have, to have obamenu create a puristic minimal header only without all the funny (or not) xml brouhaha.

@ohnonot

Thanks for your efforts to track down and identify the problem. The new escape mechanism should now take care of that kind of stuff in .desktop files.

Enjoy!

Offline

#15 2014-10-16 07:51:26

ohnonot
...again
Registered: 2012-05-22
Posts: 2,205

Re: working, portable openbox menu gen. available

thanks rmoe!
it works perfectly now (without icons) and it's fast!
just one thing: i think it would increase compatibility if you change "#!/usr/bin/env python" to "#!/usr/bin/env python2"?
or does it break on freebsd then?

i'm still struggling to understand the icons search mechanism.
in /usr/share/pixmaps there's no icon themes, so why does it ask for an icon theme in the config section, and then /pixmaps/ is "hardcoded" further down?
and what exactly is the image_cat_prefix for?
in other words, can i make it work for my icon theme?
mind, this is not a feature request, just trying to understand what is implemented.

Offline

#16 2014-10-16 09:11:59

rmoe
New Member
Registered: 2014-10-11
Posts: 9

Re: working, portable openbox menu gen. available

@ohnonot

Thanks for the thanks and you're welcome. And thanks for the "fast" compliment because I did indeed work and try to make obamenu fast (I feel that a tool like obamenu should hardly be noticed performance wise or else it's obtrusive and unsatisfying).

Sorry, but I will not change the env string. It would risk to break a lot and it's not worth the trouble because, as you yourself have experienced, it's *very* easy to change for a user. What I can do, however, is to put a hint comment right below it or maybe even an alternative to simply uncomment.

As for the icons stuff:

To understand that one must know that icons are (at least) in two places, the icons subdirectory (more precisely a subdir thereof, depending, among others on the theme) and the pixmaps subdirectory of what the obamenu config calls "image_dir_base", which on linux usually is /usr/share.

With the pixmaps subdirectory it's relatively simple. That's where well behaved applications put their icon.
With the icons subdir it's more complicated. Because there are 3 significant directory levels below. One is the theme (config var "icon_Theme"), another one is the diverse icon sizes and the third one is some kind of grouping like "apps".
So to find the icons for your theme obamenu needs to know the theme.

To make things funnier, the wise people who came up with that whole stuff decided that there can be (and usually are) different icons for one and the same thing, e.g. a "folder". You can thinkk of it as subthemes or theme subgroups. That's where obamenus "image_cat_prefix" comes in. Unless you know your way really well in linux and X and freedesktop "standard" weirdness and are very picky about icons, you certainly want to keep the default "applications-".

Can you make it work for your icon theme? Sure. It's easy. Just put your theme into "icon_theme". "nuoveXT2" or "Humanity" are typical examples. There may be others or more or less depending on your distro.

Final question: Why is there an explicit applications_dirs config var (rather than simply constructing it based on image_dir_base) ?
Because it's perfectly sensible to have more than one, namely the system directory, for applications. One typical example would be to have applications installed under your HOME and accordingly to have the .desktop files for those under HOME, too (typically in ~/.local/share/applications). That's why applications_dirs is a list rather than a string, albeit a list with only one default entry.

In the end I'm afraid it's like I wrote in the docu. Icons and linux "standards" are a mess and one must search many application's icons by hand or even on google.

Or * grin * you can wait another day and use the tool I'll put online in a day or so. As this search is rather expensive I will *not* extend obamenu but rather offer you a tool to hunt down those icons. Based on it's output it will be easy to, for instance, soft link all those astray icons to pixmaps.

Btw: (I mention it because some might want to have it) I just finished testing the xmlchecker I wrote because I wanted to be perfectly sure that obamenu creates proper menus and that checker would find unmatched tags, improper stacks, unmatched angles, etc.

Offline

#17 2014-10-16 16:41:56

ohnonot
...again
Registered: 2012-05-22
Posts: 2,205

Re: working, portable openbox menu gen. available

i had a deeper look at how the icons are organized in /usr/share/icons, and I'm beginning to understand your rant - and how the script works.
but i prefer fast, so for now i'll stick to no icons.

thanks again.

Offline

#18 2014-10-19 03:06:13

johnraff
nullglob
From: Nagoya, Japan
Registered: 2009-01-07
Posts: 4,148
Website

Re: working, portable openbox menu gen. available

Thank you rmoe, that new version works nicely, and without icons the output comes in 38ms as opposed to 63ms before (even though I wasn't using the icons anyway).

The speed is really a main attraction here because it means there's no need to update a cached menu when apps are added or removed from the system. Just call the script when you need it.  cool

About icons - I can see why the intricacies and inconsistencies of the way they are provided will annoy you, or anyone... but - and I mean this in a totally positive way - if the user has to manually set up the links for icons of the apps they install, then some of the point of an auto-updating menu is lost.

There are already a number of much bulkier menus (gnome, xfce, lxde...) which go through all those icon folders and come up with an iconified menu, at the cost of speed and system load. If you can hone your script to cover all the corner cases and fill out the menu with all its icons, then that's fantastic! If not, it has a valuable role as a nice text-only menu which takes up no RAM when it's not used.

Last edited by johnraff (2014-10-19 03:07:20)


John
--------------------
( a boring Japan blog , Japan Links, idle twitterings  and GitStuff )
#! forum moderator    BunsenLabs

Offline

#19 2014-10-19 08:00:18

ohnonot
...again
Registered: 2012-05-22
Posts: 2,205

Re: working, portable openbox menu gen. available

^obemnu-generator caches icons with an icons.db.

Offline

#20 2014-10-22 06:49:43

seppalta
#! Member
Registered: 2012-05-04
Posts: 97
Website

Re: working, portable openbox menu gen. available

Works great in my Debian-based distros!  However, in Manjaro I keep getting:

 File "/home/me/.config/openbox/obamenu", line 128
    print "Error: Invalid .desktop line'" + l + "'"
                                        ^
SyntaxError: invalid syntax

Offline

#21 2014-10-22 18:45:06

ohnonot
...again
Registered: 2012-05-22
Posts: 2,205

Re: working, portable openbox menu gen. available

seppalta, that's because you have to tell it that it's python 2, not 3.
see my previous posts.

Offline

#22 2014-10-23 02:17:48

seppalta
#! Member
Registered: 2012-05-04
Posts: 97
Website

Re: working, portable openbox menu gen. available

I thought that I had tried python2.  Anyway, now:

[me@8710w-1 ~]$ python2 /home/me/.config/openbox/obamenu | tee /home/me/obamenu.xml
  File "/home/me/.config/openbox/obamenu", line 127
    if eqi len(eqi) < 2:
             ^
SyntaxError: invalid syntax

Offline

#23 2014-10-23 04:22:46

damo
#! gimpbanger
From: N51.5 W002.8 (mostly)
Registered: 2011-11-24
Posts: 5,434

Re: working, portable openbox menu gen. available

seppalta wrote:

I thought that I had tried python2.  Anyway, now:

[me@8710w-1 ~]$ python2 /home/me/.config/openbox/obamenu | tee /home/me/obamenu.xml
  File "/home/me/.config/openbox/obamenu", line 127
    if eqi len(eqi) < 2:
             ^
SyntaxError: invalid syntax

Too many "eqi's"?

if len(eqi) < 2:

BunsenLabs Group on deviantArt
damo's gallery on deviantArt
Openbox themes
Forum Moderator smile

Offline

#24 2014-10-23 06:08:37

seppalta
#! Member
Registered: 2012-05-04
Posts: 97
Website

Re: working, portable openbox menu gen. available

Thank you gimpbanger and Petunia.  That solved the problem.  What a nice tool!

Offline

Help fund CrunchBang, donate to the project!

#25 2014-10-23 06:18:28

ohnonot
...again
Registered: 2012-05-22
Posts: 2,205

Re: working, portable openbox menu gen. available

that's strange, i just tried on archbang - with python (= the default on archlinux = python3) i get the same error as in post #20, however after installing python2 and telling the script to use python2 it works.

could this be manjaro-specific?

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.
Server: acrobat

Debian Logo