Obtap - An openbox menu generator like none before. (BETA)

(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)

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 &amp; 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

Similar Messages

  • Openbox Menu generator script

    Hey guys, not sure if this is in the right section...
    I know I'm not the only one using Openbox around here, so I'm sure you have run in to the issue of losing your custom menu entries every time you regen a menu with menumaker; to compensate, I threw together a little script that takes static header/footer menu sections and puts them around the automatically-generated menu generated by menumaker. It then copies the updated menu to ~/.config/openbox/menu.xml. As soon as you restart/reconfigure Openbox, you have your updated menu.
    Obviously you would edit the header and footer to match your needs.
    Depends on "menumaker".
    http://drop.io/obmenugen
    Last edited by steevols (2009-08-01 01:20:21)

    I don't see the paperclips. I looked in IE also (I normally use Firefox) and not there either.
    At the very bottom of the screen, it says "You cannot download files in this forum", so I suspect that some piece of software is hiding the files from me.
    The entire text in the bottom right corner is:
    You can post new topics in this forum
    You can reply to topics in this forum
    You cannot edit your posts in this forum
    You cannot delete your posts in this forum
    You cannot vote in polls in this forum
    You cannot attach files in this forum
    You cannot download files in this forum
    --John

  • [SOLVED] Openbox-menu saying Menu not found...

    Hello all,
    I installed Arch with Openbox. For the menu, I want to use openbox-menu to see my Applications.
    In menu.xml, I put the line:
    <menu execute="openbox-menu" id="desktop-app-menu" label="Applications"/>
    But when I point it in the menu, I get:
    Menu not found. Please specify a menu specification file.
    I get the same result in Terminal either as a user or as root.
    These are the "menu" packages I have installed:
    [philippe@phil-bureau ~]$ pacman -Qs menu
    local/dmenu-xft 4.5-1
    Dynamic X menu - with xft support
    local/gnome-menus 3.2.0.1-1
    GNOME menu specifications
    local/gnome-menus2 3.0.1-1
    GNOME menu specifications
    local/libdbusmenu-qt 0.9.0-2
    A library that provides a Qt implementation of the DBusMenu spec
    local/lxmenu-data 0.1.2-1 (lxde)
    freedesktop.org desktop menus for LXDE
    local/menu-cache 0.3.2-1 (lxde)
    Caches to speed up freedesktop.org's application menus use.
    local/obmenu 1.0-9
    Openbox menu editor.
    local/openbox-menu 0.3.6.6-1
    Dynamic XDG menu for openbox
    local/openbox-xdgmenu 0.3-2
    fast xdg-menu converter to xml-pipe-menu
    Any help/ideas/suggestions are welcome!
    Thanks
    Philippe
    Last edited by Philippe1 (2012-02-17 16:30:22)

    Hey guys, thanks for the quick response!
    Openbox-menu comes from AUR and the menu.xml is a copy of my Archbang installation. And yes, openbox-menu works like a charm on Archbang. So what am I missing?
    Here is the menu.xml:
    <?xml version="1.0" encoding="utf-8"?>
    <openbox_menu xmlns="http://openbox.org/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://openbox.org/ file:///usr/share/openbox/menu.xsd">
    <menu id="root-menu" label="Openbox 3.5">
    <item label="Fichiers">
    <action name="Execute">
    <execute>
    nautilus
    </execute>
    </action>
    </item>
    <item label="Internet">
    <action name="Execute">
    <execute>
    chromium
    </execute>
    </action>
    </item>
    <item label="Minitube">
    <action name="Execute">
    <execute>
    minitube
    </execute>
    </action>
    </item>
    <item label="Jeux de cartes">
    <action name="Execute">
    <execute>
    pysol
    </execute>
    </action>
    </item>
    <item label="LibreOffice Writer">
    <action name="Execute">
    <execute>
    libreoffice -writer
    </execute>
    </action>
    </item>
    <item label="LibreOffice Calc">
    <action name="Execute">
    <execute>
    libreoffice -calc
    </execute>
    </action>
    </item>
    <item label="Terminal">
    <action name="Execute">
    <execute>
    sakura
    </execute>
    </action>
    </item>
    <separator/>
    <menu execute="openbox-menu" id="desktop-app-menu" label="Applications"/>
    <menu execute="~/.config/openbox/pipemenus/obpipemenu-places ~/" id="places" label="Places"/>
    <menu execute="~/.config/openbox/pipemenus/obrecent.sh ~/" id="recent" label="Recent Files"/>
    <menu id="Preferences" label="Preferences">
    <menu id="root-menu-90523" label="Conky Config">
    <item label="Edit .conkyrc">
    <action name="Execute">
    <execute>
    leafpad ~/.conkyrc
    </execute>
    </action>
    </item>
    <item label="Restart Conky">
    <action name="Execute">
    <execute>
    conkywonky
    </execute>
    </action>
    </item>
    </menu>
    <menu id="root-menu-891528" label="Eye Candy">
    <item label="No effects">
    <action name="Execute">
    <execute>
    ~/.config/openbox/scripts/xcompmgr.sh unset
    </execute>
    </action>
    </item>
    <item label="Transparency">
    <action name="Execute">
    <execute>
    ~/.config/openbox/scripts/xcompmgr.sh set
    </execute>
    </action>
    </item>
    <item label="Transparency, fading">
    <action name="Execute">
    <execute>
    ~/.config/openbox/scripts/xcompmgr.sh setshaded
    </execute>
    </action>
    </item>
    <item label="Transparency, fading shadows">
    <action name="Execute">
    <execute>
    ~/.config/openbox/scripts/xcompmgr.sh setshadowshade
    </execute>
    </action>
    </item>
    </menu>
    <menu id="root-menu-525118" label="Openbox Config">
    <item label="Edit autostart">
    <action name="Execute">
    <execute>
    leafpad ~/.config/openbox/autostart
    </execute>
    </action>
    </item>
    <item label="GUI Menu Editor">
    <action name="Execute">
    <execute>
    obmenu
    </execute>
    </action>
    </item>
    <item label="GUI Config Tool">
    <action name="Execute">
    <execute>
    obconf
    </execute>
    </action>
    </item>
    <item label="Key Editor">
    <action name="Execute">
    <execute>
    obkey
    </execute>
    </action>
    </item>
    <item label="Reconfigure">
    <action name="Reconfigure"/>
    </item>
    <item label="Restart">
    <action name="Restart"/>
    </item>
    </menu>
    <menu id="root-menu-23433" label="Take Screenshot">
    <item label="Now">
    <action name="Execute">
    <execute>
    scrot '%Y-%m-%d--%s_$wx$h_scrot.png' -e 'mv $f ~/ &amp; geeqie ~/$f'
    </execute>
    </action>
    </item>
    <item label="In 5 Seconds...">
    <action name="Execute">
    <execute>
    scrot -d 5 '%Y-%m-%d--%s_$wx$h_scrot.png' -e 'mv $f ~/ &amp; geeqie ~/$f'
    </execute>
    </action>
    </item>
    <item label="In 10 Seconds...">
    <action name="Execute">
    <execute>
    scrot -d 10 '%Y-%m-%d--%s_$wx$h_scrot.png' -e 'mv $f ~/ &amp; geeqie ~/$f'
    </execute>
    </action>
    </item>
    <item label="Selected Area... (click &amp; drag mouse)">
    <action name="Execute">
    <execute>
    scrot -s '%Y-%m-%d--%s_$wx$h_scrot.png' -e 'mv $f ~/ &amp; geeqie ~/$f'
    </execute>
    </action>
    </item>
    </menu>
    <menu id="root-menu-571948" label="tint2 config">
    <item label="Edit tint2rc">
    <action name="Execute">
    <execute>
    leafpad ~/.config/tint2/tint2rc
    </execute>
    </action>
    </item>
    <item label="Tint Wizard">
    <action name="Execute">
    <execute>
    tintwizard.py
    </execute>
    </action>
    </item>
    </menu>
    <item label="Edit /etc/rc.conf">
    <action name="Execute">
    <execute>
    sudo leafpad /etc/rc.conf
    </execute>
    </action>
    </item>
    <item label="Input Device Preferences">
    <action name="Execute">
    <execute>
    lxinput
    </execute>
    </action>
    </item>
    <item label="Screen Resolution">
    <action name="Execute">
    <execute>
    arandr
    </execute>
    </action>
    </item>
    <item label="User Interface Settings">
    <action name="Execute">
    <execute>
    lxappearance
    </execute>
    </action>
    </item>
    <item label="Wallpaper">
    <action name="Execute">
    <execute>
    nitrogen
    </execute>
    </action>
    </item>
    </menu>
    <separator/>
    <item label="Exit">
    <action name="Execute">
    <execute>
    oblogout
    </execute>
    </action>
    </item>
    </menu>
    </openbox_menu>
    Thanks again!

  • MyGtkMenu dinamic menu generator (auto-updated)

    I switched from lxpanel to bmpanel2 about a week or 10 days ago. With lxpanel I used the menu it provides, but bmpanel2 doesn't cames with a menu widget. One of the solutions suggested is use myGtkMenu, called from a launcher. I use Openbox with obmenugen, which auto-updates the menu every time I call it (right click on desktop), so, I want the same approach with myGtkMenu. This means that if I install a new application and it puts a .desktop file (which is the most common behavior), when I right-click in the desktop, and the menu is shown, the application is already under the category it belongs.
    The first version of obmenugen I wrote, was in python. obmenugen has evolved a lot since that, but the original python script, still having the main code needed to get the information from .desktop files, so, I tweaked the script and quickly have a usable version which generates a dinamic menu using the information present in .desktop files (/usr/share/applications/*.desktop).
    By now, the script still not adding icons to the menu, so, you end having a menu that looks similar to the Openbox menu. The layout of the menu is quite fixed (I don't know the term in english to describe "rígido"). To configure it, you must tweak the script itself, but it's easy if you don't need so much.
    In the future (I hope soon) I will be writing a modified version of obmenugen, also in the D programming language, with the same flexibility as obmenugen, but generating in myGtkMenu format.
    Edit it as needed (CONFIG, MY_GTK_MENU_BINARY, MENUPOS), and simply run it directly (save the code to a file, give it execution permissions, and call it).
    This is the script:
    #!/usr/bin/env python
    # -*- coding: UTF-8 -*-
    __license__ = """
    Copyright 2010 Pável Varela Rodríguez <[email protected]>
    This program is free software; you can redistribute it and/or modify it
    under the terms of the GNU General Public License as published by the Free
    Software Foundation; either version 2 of the License, or (at your option)
    any later version.
    __author__ = "Pável Varela Rodríguez <[email protected]>"
    __version__ = "0.1"
    ### EDIT THIS TO YOUR NEEDS ###
    CONFIG = {
    "Terminal": "sakura",
    "Editor" : "gedit",
    "FileManager" : "thunar",
    "RunCommand" : "gmrun",
    "ExitCommand" : "oblogout"
    MY_GTK_MENU_BINARY="~/bin/myGtkMenu"
    MY_GTK_MENU_FILE="/tmp/myGtkMenu.txt"
    ICONSIZE=-1 # Set to -1 to ignore icon
    MENUPOS=(1, 30) # Set both to -1 to ignore position
    ### DO NOT EDIT FROM HERE ###
    import os, re
    OB_CFG_HOME = os.path.expanduser("~/.config/openbox")
    DEFAULT_CFG = {
    "Terminal": "xterm",
    "Editor" : "gedit",
    "FileManager" : "thunar",
    "RunCommand" : "gmrun"
    LANG = {}
    LANG["Long"] = os.environ["LANG"].split(".")[0]
    LANG["Short"] = LANG["Long"].split("_")[0]
    DOT_DESKTOP_LOCATIONS = [
    "/usr/share/applications",
    "/usr/share/applications/kde4"
    FILTERS = {
    "dotDesktop": re.compile('.+\.desktop'),
    "Categories": re.compile('Categories=.+'),
    "Name": re.compile('Name(\[(en_US|en)\]|)=.+'),
    "Exec": re.compile('Exec=.+'),
    "Icon": re.compile('Icon=.+'),
    CATEGORIES_PRIORITY = ["01System", "02Settings", "03Development", "04Education",
    "05AudioVideo", "06Audio", "07Video", "08Office",
    "09Graphics", "10Network", "11Utility", "12Viewer",
    "13Game"]
    MENU_TEMPLATE = """
    MENU_TOP
    SEPARATOR
    MENU_ACCESORIES
    MENU_GRAPHICS
    MENU_EDUCATION
    MENU_AUDIOVIDEO
    MENU_OFFICE
    MENU_GAMES
    MENU_NETWORK
    MENU_DEVEL
    MENU_SETTINGS
    MENU_SYSTEM
    SEPARATOR
    #submenu = Openbox Settings
    #\ticon = NULL
    #\tMENU_OPENBOX
    EXIT
    MENU_TOP = """item=Terminal\ncmd="%s"\nicon=NULL\n
    item=Editor\ncmd="%s"\nicon=NULL\n
    item=FileManager\ncmd="%s"\nicon=NULL\n
    item=Run\ncmd="%s"\nicon=NULL\n"""
    MENU_CATEGORY = """submenu = %s\n\ticon = NULL\n%s\n\n"""
    ITEM_ACTION = """\titem=%s\n\tcmd="%s"\n\ticon=%s\n\n"""
    MENU = ""
    LISTS = {
    "accesories": {"categories": ["utility"], "label": "Accesories", "files": []},
    "graphics": {"categories": ["graphics"], "label": "Graphics", "files": []},
    "education": {"categories": ["education"], "label": "Education", "files": []},
    "audiovideo": {"categories": ["audiovideo", "audio", "video"], "label": "Audio & Video", "files": []},
    "office": {"categories": ["office"], "label": "Office", "files": []},
    "games": {"categories": ["game"], "label": "Games", "files": []},
    "network": {"categories": ["network"], "label": "Network", "files": []},
    "devel": {"categories": ["development"], "label": "Development", "files": []},
    "settings": {"categories": ["settings"], "label": "Settings", "files": []},
    "system": {"categories": ["system"], "label": "System Tools", "files": []}
    def getDotDesktopFiles():
    filelist = []
    for directory in DOT_DESKTOP_LOCATIONS:
    utf8_dir = directory.decode('utf8')
    filelist += [os.path.join(utf8_dir, item.decode('utf8'))
    for item in os.listdir(directory)
    if FILTERS["dotDesktop"].match(item)]
    return filelist
    def __cleanValue(value):
    for to_clean in ["%U", "%u", "%F", "%f", "\n"]:
    value = value.replace(to_clean, "")
    value = value.replace("&", "&")
    value = value.strip()
    return value
    def getName(content):
    for line in content:
    if FILTERS["Name"].match(line):
    return __cleanValue(line.split("=")[1])
    return None
    def getCategory(content):
    for line in content:
    if FILTERS["Categories"].match(line):
    categories = [item.replace("\n", "") for item in line.split("=")[1].split(";")]
    for cat in CATEGORIES_PRIORITY:
    if cat[2:] in categories:
    return __cleanValue(cat[2:])
    return None
    def getExecCmd(content):
    for line in content:
    if FILTERS["Exec"].match(line):
    return __cleanValue(line.split("=")[1])
    return None
    def getIcon(content):
    if ICONSIZE > 0:
    for line in content:
    if FILTERS["Icon"].match(line):
    return __cleanValue(line.split("=")[1])
    return "NULL"
    def parseDotDesktopFile(filepath):
    content = open(filepath, "r").readlines()
    name = getName(content)
    category = getCategory(content)
    exec_cmd = getExecCmd(content)
    icon = getIcon(content)
    if None in [name, category, exec_cmd]:
    return None
    else:
    return {"Name": name,
    "Category": category,
    "Exec": exec_cmd,
    "Icon": icon}
    def fillLists():
    files = getDotDesktopFiles()
    for currentFile in getDotDesktopFiles():
    info = parseDotDesktopFile(currentFile)
    if info:
    for category_list in LISTS.keys():
    if info["Category"].lower() in LISTS[category_list]["categories"]:
    LISTS[category_list]["files"].append(info)
    def __genMenuTop():
    for key in CONFIG.keys():
    if CONFIG[key]: DEFAULT_CFG[key] = CONFIG[key]
    return MENU_TOP % (DEFAULT_CFG["Terminal"],
    DEFAULT_CFG["Editor"],
    DEFAULT_CFG["FileManager"],
    DEFAULT_CFG["RunCommand"])
    def __genCategoryMenu(category):
    items = ""
    LISTS[category]["files"].sort()
    for item in LISTS[category]["files"]:
    items += ITEM_ACTION % (item["Name"], item["Exec"], item["Icon"])
    if not items:
    return ""
    menu_label = LISTS[category]["label"]
    return MENU_CATEGORY % (menu_label, items)
    def __genMenuOpenbox():
    items = ""
    AUTOSTARTSH = os.path.join(OB_CFG_HOME, "autostart.sh")
    if not os.path.exists(AUTOSTARTSH):
    f = open(AUTOSTARTSH, "w")
    f.close()
    os.chmod(AUTOSTARTSH, 0744)
    items += ITEM_ACTION[8:] % ("Configure Autostarted Applications", "%s %s" % (DEFAULT_CFG["Editor"], AUTOSTARTSH))
    for item in LISTS["settings"]["files"]:
    if item["Exec"] in ["obconf"]:
    items += ITEM_ACTION[:-1] % (item["Name"], item["Exec"], item["Icon"])
    return items
    def __genMenu():
    fillLists()
    MENU = MENU_TEMPLATE.replace("MENU_TOP", __genMenuTop())
    for category in LISTS.keys():
    MENU = MENU.replace("MENU_%s" % category.upper(), __genCategoryMenu(category))
    #MENU = MENU.replace("MENU_OPENBOX", __genMenuOpenbox())
    MENU = MENU.replace("EXIT", "\nitem=Exit\ncmd=%s\nicon=NULL\n" % CONFIG["ExitCommand"])
    if ICONSIZE > 0:
    MENU = "iconsize = %d\n%s" % (ICONSIZE, MENU)
    if MENUPOS[0] > 0 and MENUPOS[1] > 0:
    MENU = "MenuPosition = %d %d\n%s" % (MENUPOS[0], MENUPOS[1], MENU)
    return MENU
    def __writeMenuFile(content):
    filePath = os.path.join("/tmp", MY_GTK_MENU_FILE)
    menuFile = open(filePath, "w")
    menuFile.write(content)
    menuFile.close()
    if __name__ == "__main__":
    if len(os.sys.argv) > 2:
    print("Bad arguments length!!")
    elif "--help" in os.sys.argv or "-h" in os.sys.argv:
    print "La ayuda"
    elif len(os.sys.argv) == 1:
    menu = __genMenu()
    #print(menu)
    __writeMenuFile(menu)
    os.system("%s %s" % (MY_GTK_MENU_BINARY, MY_GTK_MENU_FILE))
    else:
    print("Argument error: %s" % " ".join(os.sys.argv[1:]))
    The only things you need to edit are those present in the first section of the script. If you know wath you do, can also change the order of the categories, editing MENU_TEMPLATE.
    The most important are settings are:
    - MY_GTK_MENU_BINARY: Which you must set up to the myGtkMenu binary (the full path or simply myGtkMenu if it is in $PATH)
    - CONFIG: Put there the tools you use
    - MENUPOS: If you will use the generated menu the way Openbox show it's own menu (ie. with compiz+emerald standalone), set this to (-1, -1), the menu will appear just under the mouse pointer. I setted it to (1, 30), because I have my bmpanel2 at screen's top, and the launcher is at the begining (the left).
    Sorry about the ugly code, but this was written to do the job, quick and dirty.
    I hope you enjoy it, and wait for next versions, which will be really flexible and fast, as obmenugen.
    See you
    Last edited by NeOnsKuLL (2010-01-05 05:32:48)

    I used this script and it as the icon names generated by it are the ones in the .desktop files, myGtkMenu was not able to show icons. So i inserted a piece of code from cbpanel to get the absolute path into the mygtkmenu file.
    Here is the relevant piece of code:
    #copied from the cbpanel code
    def find_icon(icon):
    foundiconfile=None
    if icon == '':
    return foundiconfile
    if icon[0] == '/':
    return icon
    iconbase=('','Faenza','elementary','gnome','hicolor','locolor')
    iconpath='/usr/share/icons'
    sizelist =('', 'scalable', '256x256', '128x128', '64x64', '48x48', '32x32', '24x24')
    categorylist=('actions', 'apps','devices', 'categories','filesystems', 'places', 'status', 'stock', '')
    extensionlist = ('png', 'svg', 'xpm')
    iconimagelist=[]
    for extension in extensionlist:
    if (icon.find('.'+extension) != -1):
    icon = icon.replace('.'+extension,'')
    for size in sizelist:
    for extension in extensionlist:
    for category in categorylist:
    for iconbasecat in iconbase:
    iconfile = iconpath+"/"+iconbasecat+'/'+size+'/'+category+'/'+icon+'.'+extension
    iconimagelist.append(iconfile)
    for extension in extensionlist:
    iconfile = '/usr/share/pixmaps/'+icon+'.'+extension
    iconimagelist.append(iconfile)
    for extension in extensionlist:
    iconfile = '/usr/share/app-install/icons/'+icon+'.'+extension
    iconimagelist.append(iconfile)
    # Seek if the files in pre-generated list exists.. first match is the best
    # return it
    for iconimage in iconimagelist:
    if os.path.exists(iconimage):
    return iconimage
    return foundiconfile
    #end of copy from cbpanel code
    And the relevant modification in NeOnsKuLL's script:
    def getIcon(content):
    if ICONSIZE > 0:
    for line in content:
    if FILTERS["Icon"].match(line):
    #return __cleanValue(line.split("=")[1])
    return find_icon(__cleanValue(line.split("=")[1]))
    return "NULL"
    This is my first attempt at doing anything with Python, so somebody with  any skills will do much better  than this copy-paste job
    I have no idea why the icons were not displayed in the first place though.
    Hope somebody finds it useful as I found NeOnsKull's script.

  • Obm-xdg won't show anything in the Openbox menu [SOLVED]

    I put the code:
    <menu execute="obm-xdg" id="obm-xdg" label="xdg"/>
    in ~/.config/openbox/menu.xml just like it says to do universally. It does not show any menu. Every other menu item in the file works. I can edit them and they change. obmenu can see the entry. gnome-menus is installed. obm-xdg works from the command line. Why does this not show anything in the menu?
    Last edited by skottish (2008-11-06 05:27:03)

    Make sure you add the menu id to the root-menu list at the bottom of menu.xml:
    <menu id="root-menu" label="Openbox 3">
    <separator label="Applications" />
    <menu id="obm-xdg" />
    <menu id="apps-accessories-menu"/>
    <menu id="apps-editors-menu"/>
    Last edited by thayer (2008-11-06 05:11:29)

  • HOWTO: Openbox Menu Icon in PyPanel

    Using Openbox and PyPanel (or similar) and are tired of either having to minimize windows or adjust maximum window size to leave space for right-clicking on the desktop?  Do you have a keyboard shortcut set up to open the menu, but also want to be able to use the mouse to open the menu easier?  I have a solution!
    Create an icon to launch the Openbox application menu on PyPanel.
    This will allow you to click on an icon on PyPanel which opens the OpenBox menu, similar to Gnome's application menu.
    Example:
    Requirements:
    Openbox Window Manager
    PyPanel (dock/panel application)
    xdotool
    obkey - to edit key shortcuts to OpenBox's rc.xml (not required, but used in this howto)
    Recommendations:
    archlinux-artwork
    Procedure:
    1) If you don't already have PyPanel installed, install it now (as root).
    pacman -S pypanel
    2) Launch pypanel in an application launcher, or the terminal (as normal user):
    pypanel &&
    3) Install xdotool (allows for launching keyboard shortcuts via command line) (as root)
    pacman -S xdotool
    4) If you do not have obkey installed, install it with yaourt (recommended) or download the tar.gz and run the python script:
    yaourt -S obkey-git
    OR
    Go to the obkey site or download the .tar.gz by clicking here
    Extract the .tar.gz:
    tar -xvf ./obkey-dev-abf0bb12.tar.gz
    Enter the obkey-dev directory:
    cd ./obkey-dev
    Run obkey and point it to the openbox rc.xml (as normal user!):
    ./obkey ~/.config/openbox/rc.xml
    5) In obkey, find an existing key or create a new key binding by clicking "Insert sibling key" at the top. Note: Ctrl+alt combinations did not seem to work for me to create this menu launcher.
    - If it's an existing key, select it, then click on the action in the bottom right-hand pane.  A window should pop up.  Find and select "ShowMenu"
    - If it's a new key, select it, enter in the key combination you want to use in the key (text) box (for example, C-M for Ctrl+M), then click the green "Insert Action" button at the bottom.  Click on the new "Focus" action.  A window should pop up.  Find and select "ShowMenu"
    In the ShowMenu action, at the top there should be a box for "menu:"  Enter in "root-menu" in this box.
    Now save by clicking the green arrow + hard drive in the top left corner of obkey.  Now you should be able to use that key combination to open the root-menu. If not, try restarting the X Server.
    Example:
    6) This is optional, but if you want a nice Arch icon for your new menu launcher, you can grab mine.  If you want to use your own image, it cannot be .svg, so I converted a .svg icon to .png from the the official Arch Artwork package (archlinux-artwork in the repos).  If you want to just use mine:
    Enter the following commands to get the image and set it up for the next step:
    mkdir ~/.icons/archlinux/icons/
    wget -P ~/.icons/archlinux/icons/ http://img297.imageshack.us/img297/1378/archlinuxiconcrystal128.png
    7) Open up your ~/.pypanelrc with your favorite text editor (e.g. nano or gedit). 
    Scroll down to a line starting with "LAUNCH_LIST"  Most likely it will have a line like this by default:
    ("gimp-2.2", "/usr/share/imlib2/data/images/paper.png")
    Change the line to the following to use xdotool and the key you assigned in step 5, as well as the icon image we just downloaded (Note: make sure to change /home/user to your specific home directory!):
    ("xdotool key ctrl+m", "/home/user/.icons/archlinux/icons/archlinuxiconcrystal128.png")
    Next, locate a line about 15 more down starting with "APPICONS."  Change this value from 0 to 1.
    APPICONS = 1 # Show application icons
    Finally, about 20 lines down, you will see a section for Panel Layout.
    There are 5 sections for the panel:  Desktop, Tasks, Tray, Clock, and Launcher.  They can be assigned, in order of left to right on the panel, with numbers 1-5 and 0 for disabled.  Choose a location you want your Launcher to be and set the value from 1-5.  You can play around with this by setting the values, then restarting pypanel.
    Here is how I have set mine (I disabled Desktop since I only use one desktop/workspace and do not need it to say which one I am on):
    DESKTOP = 0 # Desktop name section
    TASKS = 2 # Task names section
    TRAY = 3 # System tray section
    CLOCK = 4 # Clock section
    LAUNCHER = 1 # Application launcher section
    8) Finally, kill and restart PyPanel and enjoy!
    killall pypanel && pypanel
    9) Tell me how it went, what you think, what I could improve on, etc!
    Last edited by CheesyBeef (2009-03-24 22:22:39)

    Vighi wrote:
    Very nice guide got it working almost straight away :-)
    Had to restart X in order to get key-binding to work though. And I put /home/username/.icons/archlinux/icons/archlinuxiconcrystal128.png instead of ~/ because somehow I got couldn't find logo error when pypanel started.
    BTW sexy pypanel look you have. All the info in your .dotfiles link? will get to it tomorrow I guess. Thanks!
    Thanks very much for using my guide and responding!
    I will fix that ~/ directory problem and say to use the home directory. 
    And yes, that configuration is in my .dotfiles at the moment   You can follow that link or just grab it here: http://dotfiles.org/~CheesyBeef/.pypanelrc
    Thanks again!

  • Roboto font not available in certain applications and Openbox menu

    I have downloaded Roboto TTF font from here and saved it in ~/.fonts.
    After downloading it, I ran:
    $ fc-cache -vf
    After that, I changed the font in lxappearance and obconf and every single application I have tried so far uses it by default now except Openbox menu (window titles seem to work just fine) and Geany.
    What can I do to fix this?
    I really like the font and pretty much everything runs well except those two.
    Note: tried placing those files in /usr/share/fonts/local, but nothing changed.
    Last edited by COPE (2013-11-04 07:35:17)

    Tried to switch fonts in terminal (rxvt-unicode) and apparently that font is not available there either.
    Any ideas?

  • How to integrate OpenBox menu with Tint?

    Having tint shorter than screen width is not an option, because it looks terrible.
    Any ideas?

    Could you explain a bit more what it is exactly you're trying to accomplish.  How are you trying to integrate the openbox menu with tint?
    For example: right-clicking free space on tint panel brings up OB menu.
    Current workaround works (tint not stretched to screen width - I'm clicking empty space on sides of tint panel) but I was hoping for more "elegant" solution.
    According to tint manual:
    "3.7 Mouse
    customize mouse action with : none, close, toggle, iconify, shade, toggle_iconify
    mouse_middle = none
    mouse_right = close
    mouse_scroll_up = toggle
    mouse_scroll_down = iconify"
    Why not just use the hotkey to bring up the openbox menu?
    Not being able to do everyday tasks efficiently with a mouse is a big no-no.
    Besides that, combo of OB + Tint + Trayer is great.
    Last edited by mute (2008-10-10 22:42:56)

  • [SOLVED] openbox menu command doesn't work with &&

    I'm now using openbox-session only.
    I'd like to run a program after something was done correctly:
    zenity --question && killall openbox
    I used "obmenu" and it seems that it fixes & to & correctly in the menu.xml.
    However, the previous command "zenity" is run only.
    In terminal, there's no problem, but it doesn't work with "command" in openbox menu.
    <item label="Exit">
    <action name="Execute">
    <execute>
    zenity --question --title="Exit" --text="Are you sure to go back to console?" && killall openbox
    </execute>
    </action>
    </item>
    Please, give me any idea. Thank you.
    Last edited by mairoo (2009-09-09 10:06:17)

    hbekel wrote:
    You'll need to use a shell explicitly:
    <execute>
    sh -c 'command1 && command2'
    </execute>
    I flagged "solved" thanks to your help. It works good. Thank you.

  • "Running" openbox menu?[SOLVED]

    Is it possible to issue a command to open the root openbox menu(then menu that pops open on desktop right click)?  I want to use that as a button in pypanel...  Thanks for your time in advance.
    Last edited by isolier (2009-01-24 17:56:45)

    I asked myself the same question and found a great application called xdotool. I added it on AUR. One of its usage is to simulate a keypress. Simply add this code somewhere in the <keyboard> section of your rc.xml:
    <keybind key="A-C-q">
    <action name="ShowMenu">
    <menu>root-menu</menu>
    </action>
    </keybind>
    Then, just lauch your menu with:
    # xdotool key ctrl+alt+q
    A launcher in pypanel would look something like this:
    LAUNCH_LIST = [
    ("xdotool key ctrl+alt+q", "/usr/share/pixmaps/openbox.png"),
    Of course, you can change the keyboard shortcut, etc...
    Hope this helps.
    -T
    Last edited by rttommy (2008-01-30 00:23:26)

  • I'm not able to create my apple id without my credit card number in my iphone 5c.there is no way to skip this step.there is no option like "NONE" to skip that step.kindly help me out.im unable to download even free apps

    i'm not able to create my apple id without my credit card number in my iphone 5c.there is no way to skip this step.there is no option like "NONE" to skip that step.kindly help me out.im unable to download even free apps

    See
    Why can’t I select None when I edit my Apple ID payment information?
    and
    Creating an iTunes Store, App Store, iBooks Store, and Mac App Store account without a credit card
    Step 3 is important, no matter whether you do this on a Mac or an iPad / iPhone:
    Important: Before proceeding to the next step, you must download and install a free application. ...
    Important: Before proceeding to the next step, you must download and install the free application by tapping Free followed by tapping Install App. …
    First you must download a free app from the App Store. When you are asked to sign in with your Apple ID, select "Create new account". Accept the terms and conditions checkbox, then click Continue. After you enter all the requested personal data, click Continue.
    When you are asked to select a payment method, select "None". 
    That's all there is to it.

  • [Openbox] Wine menu in Openbox menu?

    Is there a way to get the wine menu in openbox? I mean in gnome its in Applications>Wine and it has all the configure, wine uninstall wine software etc etc and it also automatically updates when new software is installed. Is it possible to have something like that in openbox?

    You could try making your own Wine menu in Openbox through Obmenu or by directly modifying the ~/.config/openbox/menu.xml

  • Lost Openbox Menu to LXDE install

    I would like to know how to restore my openbox menu, or atleast edit the one LXDE uses. I installed LXDE in hopes to have a better linux experience. After all sitting there with just Openbox, Nitrogen, tint2, and Conky was all well and good but I like having a desktop with icons.
    My problem though without all the fluf is that my openbox menu became LXDE with only a few menus, which is far from my long list with just Openbox. Is there a way to restore it, or import everything over. (Like the menu.xml and the rc.xml) I know it exists since the obmenu command shows my old menu, though I can't get it to show up.

    Did you manually configure your old menu via ~/.config/openbox/menu.xml or did you use the default?
    If you configured it and now you have something different, then I'm guessing it was overwritten, in which case it would be interesting to know if that happens automatically or not when installing/running Lxde.
    If you were using the default, try renaming ~/.config/openbox/menu.xml to ~/.config/openbox/menu.xml.bak then reconfigure openbox and check if it reset your menu.

  • Netcfg openbox menu

    I've started tweaking my openbox box and the first thing to do was a simple script to run netcfg from openbox menu. You can grab it here: http://gist.github.com/160147. It can only activate an inactive profile or deactivate an active one (it's enough for me).
    And I've encountered a strange issue. You may notice that I use xterm for desplaying netcfg output and in case of success xterm waits for 2 seconds to close. Without that after putting the profile down from menu subsequent calls to netcfg may claim that the corresponding interface is busy and fail. Even with that delay often subsequent calls to netcfg will complain of the interface being busy but will succeed. So, what am I doing wrong? What is the safe way to run netcfg in my case?

    Well, I hope, that was not my fault: http://bbs.archlinux.org/viewtopic.php?pid=596519
    UPD: Still, I should try something like
    bash -c ". /usr/lib/network/network; . /etc/rc.d/functions; profile_up ...
    UPD: Just the same issue with the above command. And netcfg-tray often hangs the interface too.
    Last edited by Mr.Cat (2009-08-06 23:04:26)

  • Ted (Torrent Episode Downloader) - autostart & add to openbox menu?

    I've been playing with different torrent programs lately and I'm spoiled by the rss/autodownload feature in Deluge & Ktorrent.
    I really like qbittorrent but since it lacks that feature, I'm trying to get ted to work.
    It's just a small java.jar file you run and it uses filters to pull specific torrent files from specified feeds and places them in a folder monitored by qbittorrent.
    Anyhow, I'm seeking help to somehow get the .jar file (and ted w/ it's rss monitoring) to load on startup as well as how to add it to my openbox menu.

    Very nice guide!
    I'm using it now

Maybe you are looking for

  • FAGLL03 report not filtering G/L line items based on vendor entered in free selection

    Hello SAPians, I have a requirement to add Vendor field in the free(dynamic) selection of the standard report FAGLL03 so that G/L line items are displayed(filtered) based on the vendor values given. I followed the SAP note 945932 to create the vendor

  • New bar at the top of the screen

    With the new upgrade to Android version 4.0.4, there now appears to be another bar at the top of the screen.  I haven't been able to find any description of what this bar is/does.  Looking for a link to documentation about this new feature.

  • Back up contacts from cloud to samsung galaxy s5

    I just updated to the Samsung Galaxy s5 from the iPhone 4s.  I backed everything up to the cloud. It initial transfer was fine but I noticed I had a lot of duplicates. (It wasn't the clouds fault. It is because of the way I had my contacts in my blac

  • Cannot install CS3 on my new computer

    hi, i cannot install CS3 on my new computer due to the fact that i did not deactivate is on my old laptop. to which i dont have acces any more.. can anyone help finding a solution?

  • Pdf files not printing whole page

    pdf files printing just part of page. have everything updated on my mac and hp printer. anyone have a solution?