You are not logged in.
(When I say none before I mean none that I could find. If I could find one, I wouldn't have to make this then. Anyway..)
Hey guys, I'm here to present my project 'obtap'. It's inspired by obmenugen, a great menu generator written in D which I've used before obtap. The reason I don't use it anymore is because it wasn't as customizable as I'd of liked it to be and that's why I've made obtap.
I've developed a small (under <150KiB, only using the C++ standard library which means you don't have to install any dependencies) Openbox menu generator that's grown to do many things:
obtap can generate pipe menus, static menus, a dynamically updating menu (basically a menu with it's contents a pipe menu).
obtap can easily add separators for menu layout and edit entries in such ways of renaming/merging categories, setting entry categories, renaming entries and deleting entries.
obtap has command line options to specify menu type (pipe, static, dynamic), the configuration file and the output.
The selling point, I'd say at least, is that obtap can (but doesn't have to) load desktop files from directories as entries, which you can then process with the above methods.
Here's my menu:
That's created using this configuration file:
# Jookia's obtap configuration file.
output(~/.config/openbox/menu.xml)
type(openboxDynamic)
locations(/usr/share/applications,/usr/share/applications/kde4)
extensions(desktop)
obeyOnlyShowIn(GNOME,KDE,XFCE)
ignoreCategories(GTK,GNOME,Qt)
alphabetize(true)
customEntry(Logout;shutdown-dialog.py)
customEntry(Reconfigure Openbox;openbox --reconfigure;Utilities)
customEntry(Nitrogen;nitrogen;Settings)
replaceCategoryName(AudioVideo;Multimedia)
replaceCategoryName(Game;Games)
replaceCategoryName(Graphics;Multimedia)
replaceCategoryName(Utility;Utilities)
replaceCategoryName(System;Utilities)
replaceEntryName(GNU Image Manipulation Program;GIMP)
deleteEntry(Root Terminal)
deleteEntry(Open Folder with Thunar)
menuEntry(separator;Applications)
menuEntry(categories)
menuEntry(separator)
menuEntry(entry;Logout)
Here's how to get it from the GitHub page.
git clone git://github.com/Jookia/obtap.git
cd obtap
make
bin/obtap -c goodies/example.conf
openbox --reconfigure
That'll create a dynamic example menu and update Openbox.
To edit it, edit example.conf or copy it to ~/.config/obtap.conf and run obtap without the '-c goodies/example.conf'.
You can also install it by using the PKGBUILD in the goodies folder.
I don't have much to say. Uh.. Thanks for reading and if you do use it, I'd love to know.
Last edited by Jookia (2010-11-07 22:35:46)
Offline
Just tried your instructions and it's working great.
Offline
This. Is. Awesome.
I'm actually running Openbox as the WM for Ubuntu 10.04 and I'm pleased to report that it works like a charm there.
One thing that confused me (and this might be my relative noobness to linux) was the original parentheses in example.conf with the locations line. One reason I've wanted an app EXACTLY like this was to catch everything first, and ask questions later. (Otherwise I'd edit all the XML by hand.) It took me a second to realize that this was what I wanted:
locations(/home/USERNAME/.local/share/applications,/usr/share/applications,/usr/share/applications/kde4) # Locations.
(I don't know if Arch keeps *.desktop files in ~/.local/share/applications, but Ubuntu does - and they aren't always mirrored.)
The other thing possibly worth mentioning is that it's a pretty trivial thing to set this up within your existing Openbox configuration. I installed under ~/Apps/obtap, edited the example.conf, and added these line to menu.xml:
<menu id="dyn_apps" label="apps" execute=
"/home/USERNAME/Apps/obtap/bin/obtap -c /home/USERNAME/Apps/obtap/goodies/example.conf -t openboxpipe -o -"
/>
And boom - no overwriting and I have a dynamic menu off to the side (so I can keep my otherwise minimalistic menu clear).
Again, this is an AWESOME program, and you deserve quite a bit of credit for it. My absolute thanks!
Offline
Thanks for taking time to respond, I created the program for the minority.
Arch doesn't keep desktop files in ~/.local/share/applications, although that may be a GNOME thing. I think this may be so you can delete the icons or modify it, etc.
Thanks for complimenting the program, and you're very welcome.
Offline
It's a GNOME thing, I believe. There's more than one person running OpenBox over GNOME that's reading these forums, given the number of pointers I've seen from Ubuntuforums.org!
Offline
I think something missing with your PKGBUILD... i try to correct it. Here's the file http://pastebin.com/7df2Bmmv
Offline
Thanks for the fix hellnest, I've incorporated it into the repo. Cheers.
Offline
^o^.. it's no problem at all. And after installation finish it's also need to be fixed. If you install it use pacman and then you invoke obtap it will generate a blank menu which is i i guess it's depend on the configuration files inside the goodies folder before.
Hmm.. maybe you can try to make an "default automatic" configuration and then for the extra command they can manually add it with editing the menu.xml file.
Other bug is when invoke Htop application from the menu it's causing crash and i don't know why. Invoke unetbootin didn't work from menu.
^o^, keep up your good job i really appreciated it
Offline
To save some time as you already seem to be able to reproduce those errors, after a fresh installed using pacman, can you invoke obtap with the -v flag (verbose) and post the output?
I'm wary of a default configuration as I'd have to store it in the executable which adds more annoyances for converting it to be stored properly.
You say that invoking some programs causes a crash? Please generate the XML schema for that menu by running 'obtap -topenboxpipe -o-' (or a file as an output by -oFILENAME) in the terminal and then posting the schema for Htop and unetbootin here.
Thanks!
Offline
Ok here's for the verbose result, it's pointing to "`/.config/obtap.conf" which is resulting
XML
<?xml version="1.0" encoding="UTF-8"?>
<openbox_menu xmlns="http://openbox.org/3.4/menu">
<menu id="root-menu" label="" execute=
"/home/martin/obtap -c /home/martin/.config/obtap.conf -t openboxpipe -o -"
/>
</openbox_menu>
It's have an exactly same results like when you first time invoke obtap before install it to your /usr/bin
Here's the obtap output schema
<openbox_pipe_menu>
<separator label="Applications"/>
<menu id="menu-utilities" label="Utilities">
<item label="Shutter">
<action name="Execute">
<command>shutter</command>
</action>
</item>
<item label="Bulk Rename">
<action name="Execute">
<command>/usr/lib/ThunarBulkRename</command>
</action>
</item>
<item label="UNetbootin">
<action name="Execute">
<command>su -c /usr/sbin/unetbootin</command>
</action>
</item>
<item label="Cairo Composite Manager">
<action name="Execute">
<command>cairo-compmgr</command>
</action>
</item>
<item label="SUSE Studio Imagewriter">
<action name="Execute">
<command>imagewriter</command>
</action>
</item>
<item label="Avahi Zeroconf Browser">
<action name="Execute">
<command>/usr/bin/avahi-discover</command>
</action>
</item>
<item label="Htop">
<action name="Execute">
<command>htop</command>
</action>
</item>
<item label="Terminator">
<action name="Execute">
<command>terminator</command>
</action>
</item>
<item label="GSmartControl">
<action name="Execute">
<command>"/usr/bin/gsmartcontrol-root"</command>
</action>
</item>
<item label="GParted">
<action name="Execute">
<command>gksu /usr/sbin/gparted</command>
</action>
</item>
<item label="gVim">
<action name="Execute">
<command>gvim</command>
</action>
</item>
<item label="Thunar File Manager">
<action name="Execute">
<command>Thunar</command>
</action>
</item>
<item label="CoverGloobus">
<action name="Execute">
<command>covergloobus</command>
</action>
</item>
<item label="Squeeze">
<action name="Execute">
<command>squeeze</command>
</action>
</item>
<item label="Disk Utility">
<action name="Execute">
<command>palimpsest</command>
</action>
</item>
</menu>
<menu id="menu-settings" label="Settings">
<item label="Notifications">
<action name="Execute">
<command>xfce4-notifyd-config</command>
</action>
</item>
<item label="Openbox Configuration Manager">
<action name="Execute">
<command>obconf</command>
</action>
</item>
<item label="TintWizard">
<action name="Execute">
<command>tintwizard</command>
</action>
</item>
<item label="File Manager">
<action name="Execute">
<command>thunar-settings</command>
</action>
</item>
<item label="Removable Drives and Media">
<action name="Execute">
<command>/usr/lib/xfce4/thunar-volman-settings</command>
</action>
</item>
<item label="Qt Config ">
<action name="Execute">
<command>/usr/bin/qtconfig</command>
</action>
</item>
<item label="CoverGloobus Configuration">
<action name="Execute">
<command>covergloobus-config</command>
</action>
</item>
<item label="Preferred Applications">
<action name="Execute">
<command>libfm-pref-apps</command>
</action>
</item>
<item label="Customize Look and Feel">
<action name="Execute">
<command>lxappearance</command>
</action>
</item>
</menu>
<menu id="menu-network" label="Network">
<item label="IcedTea Web Start">
<action name="Execute">
<command>/usr/bin/javaws</command>
</action>
</item>
<item label="Avahi VNC Server Browser">
<action name="Execute">
<command>/usr/bin/bvnc</command>
</action>
</item>
<item label="Firefox - Safe Mode">
<action name="Execute">
<command>firefox -safe-mode</command>
</action>
</item>
<item label="Avahi SSH Server Browser">
<action name="Execute">
<command>/usr/bin/bssh</command>
</action>
</item>
<item label="Firefox">
<action name="Execute">
<command>firefox</command>
</action>
</item>
<item label="Midori">
<action name="Execute">
<command>midori</command>
</action>
</item>
<item label="XChat IRC">
<action name="Execute">
<command>xchat</command>
</action>
</item>
<item label="Pidgin Internet Messenger">
<action name="Execute">
<command>pidgin</command>
</action>
</item>
</menu>
<menu id="menu-development" label="Development">
<item label="Qt Designer">
<action name="Execute">
<command>/usr/bin/designer</command>
</action>
</item>
<item label="CMake">
<action name="Execute">
<command>cmake-gui</command>
</action>
</item>
<item label="Qt Linguist">
<action name="Execute">
<command>/usr/bin/linguist</command>
</action>
</item>
<item label="OpenJDK Monitoring & Management Console">
<action name="Execute">
<command>/usr/bin/jconsole</command>
</action>
</item>
<item label="Geany">
<action name="Execute">
<command>geany</command>
</action>
</item>
<item label="Qt Assistant">
<action name="Execute">
<command>/usr/bin/assistant</command>
</action>
</item>
<item label="OpenJDK Policy Tool">
<action name="Execute">
<command>/usr/bin/policytool</command>
</action>
</item>
</menu>
<menu id="menu-multimedia" label="Multimedia">
<item label="Document Viewer">
<action name="Execute">
<command>evince</command>
</action>
</item>
<item label="DeaDBeeF">
<action name="Execute">
<command>deadbeef</command>
</action>
</item>
<item label="Mirage">
<action name="Execute">
<command>mirage</command>
</action>
</item>
<item label="VLC media player">
<action name="Execute">
<command>vlc</command>
</action>
</item>
<item label="GIMP">
<action name="Execute">
<command>gimp-2.6</command>
</action>
</item>
</menu>
<menu id="menu-openbox" label="Openbox">
<item label="Reconfigure Openbox">
<action name="Execute">
<command>openbox --reconfigure</command>
</action>
</item>
</menu>
<separator/>
<menu id="menu-openbox" label="Openbox">
<item label="Reconfigure Openbox">
<action name="Execute">
<command>openbox --reconfigure</command>
</action>
</item>
</menu>
<item label="Logout">
<action name="Execute">
<command>shutdown-dialog.py</command>
</action>
</item>
</openbox_pipe_menu>
I guess the problem is "Htop" is a CLi program and normally when i want to invoke unetbootin / imagewriter, i'm using "gksu <command>" using manual menu.xml configuration.
Hope it's help
Offline
But does ~/.config/obtap.conf not exist?
Also, I'm not sure how to fix the CLI and imagewriter stuff. You could always overwrite the exec. I'm not sure about the Unetbootin problems. Would it work if I add a setEntryExec command so you can just fix it manually?
Offline
But does ~/.config/obtap.conf not exist?
Also, I'm not sure how to fix the CLI and imagewriter stuff. You could always overwrite the exec. I'm not sure about the Unetbootin problems. Would it work if I add a setEntryExec command so you can just fix it manually?
Hmm.. in my menu.xml it's pointing to obtap.conf, which is obtap.conf is sort like "script" to auto generated the menu structure. I suggest for future also put a "window class" option as Default, it's much better than default application name shown on taskbar. People will love it i guess, coz it'z automate all when using your command. I will try to do a small modification in my .xml
Offline
I'm planning a number of fixes and a small but new feature for obtap to address the issues above and a configuration file limitation.
Offline
You can now replace entry execs (example.conf replaces Htop's with xterm -e htop).
You can now escape characters in the configuration file that would've blocked you from using stuff with ; or , or # in it.
Removed unused alphabetizing code.
Example configuration files (as of 28th of Nov 2010)
Last edited by Jookia (2010-11-28 03:49:20)
Offline
Before I wrote that post, yes. You can view the updated source at the GitHub page.
Offline
Hallo. I just migrated to openbox and LOVE the idea of this app. Unfortunately, i can't seem to get it to compile >_<. Followed the instructions above, but get stuck when making. I've done some compiling already on my machine, of kernel modules and what not. not sure if I got a daily build or not. see code below.
$ make
mkdir -p ./objs ./bin
make defaultConfig
make[1]: Entering directory `/home/g33kdot/System/obtap'
make[1]: Leaving directory `/home/g33kdot/System/obtap'
make ./objs/main.o ./objs/config.o ./objs/filter.o ./objs/hacks.o ./objs/parser.o ./objs/scanner.o ./objs/menu.o
make[1]: Entering directory `/home/g33kdot/System/obtap'
g++ -Wall -Wextra -Werror -ansi -pedantic-errors -O3 -c source/main.cpp -o objs/main.o
In file included from source/main.cpp:7:
source/defaultConfig.h:1: error: stray '#' in program
In file included from source/main.cpp:7:
source/defaultConfig.h:54:2: error: #endif without #if
source/defaultConfig.h:1: error: expected unqualified-id before '-' token
source/main.cpp: In function 'int main(int, char**)':
source/main.cpp:185: error: 'defaultConfig' was not declared in this scope
make[1]: *** [objs/main.o] Error 1
make[1]: Leaving directory `/home/g33kdot/System/obtap'
make: *** [all] Error 2
is this a bug, or just OE on my part? Thanks
Offline
It may be a bug, I'm a bit of a shoddy programmer. But do you have the 'exampleConfig' file in the source folder? If you don't, please add it, if you do, please post it and the defaultConfig.h file.
Offline
I've moved to Xfce, so I don't really have any reason to maintain this anymore. Bye.
Offline