[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

Similar Messages

  • Can't find the wine menu anymore :(

    Hi,
    I've been playing around with my Wine menu, and somehow managed it, to remove it. Unfortunately I can't get it back again now .
    Beforehand every windows setup that has installed start menu entries has created its entried in the "Applications -> Wine" menu, but now this menu is gone.
    Although the applications still create .desktop files in "/home/johnpatcher/.local/share/applications/wine/", they aren't shown in my "Applications" menu anymore. How can I fix this?
    Best regards
    johnpatcher

    Could fix the problem by removing wine completly (according to this guide) and re-installing it. This way I have to re-install all of my applications, but that is probably faster than struggling around with my applications.menu. I guess alacarte sucks a little bit, when it comes down to manually change the menu file(s) afterwards.
    Last edited by johnpatcher (2009-10-24 11:11:07)

  • Restoring wine menu in KDE [SOLVED]

    Hi, i'm using KDE 4.4.1 and wine. Before i decided to clean up mess in KDE menu, all wine installed menu items were under "lost and found"
    As http://wiki.archlinux.org/index.php/Win … Fix.5B1.5D states, i have edited /etc/xdg/menus/kde-applications.menu
    Now i had Wine menu, but i didn't need all items, so i ran kde menu editor, and some items were removed. After relogin, wine menu didn't have "Programs" submenu at all :s. I deleted wine menu from KDE menu
    Now, hot to restore that?
    I figure out that all desktop files created by wine are in /home/bagheera/.local/share/applications/
    In /home/bagheera/.config/menus/ i have several files:
    -rw-r--r-- 1 bagheera users 15647 03-15 12:22 applications-kmenuedit.menu
    -rw-r--r-- 1 bagheera 1000 3527 03-15 13:11 applications.menu
    -rw-r--r-- 1 bagheera users 3527 03-15 13:11 applications.menu~
    -rw-r--r-- 1 bagheera 1000 2349 2008-12-09 applications.menu.undo-10
    -rw-r--r-- 1 bagheera 1000 2418 2008-12-09 applications.menu.undo-11
    -rw-r--r-- 1 bagheera 1000 2492 2008-12-09 applications.menu.undo-12
    -rw-r--r-- 1 bagheera 1000 2571 2008-12-09 applications.menu.undo-13
    -rw-r--r-- 1 bagheera 1000 2647 2008-12-09 applications.menu.undo-14
    -rw-r--r-- 1 bagheera 1000 3358 2009-01-21 applications.menu.undo-15
    -rw-r--r-- 1 bagheera 1000 3373 2009-01-21 applications.menu.undo-16
    drwxr-xr-x 2 bagheera 1000 28672 03-15 12:35 applications-merged
    drwxr-xr-x 2 bagheera 1000 4096 2009-01-20 kde4-applications-merged
    drwxr-xr-x 2 bagheera 1000 4096 03-15 12:43 kde-applications-merged
    -rw-r--r-- 1 bagheera 1000 345 2009-03-20 settings.menu
    Do i need "undo" file, can they be safely removed?
    Witch file contains "wine menu"?
    There is so many files:
    settings.menu
    <!DOCTYPE Menu
    PUBLIC '-//freedesktop//DTD Menu 1.0//EN'
    'http://standards.freedesktop.org/menu-spec/menu-1.0.dtd'>
    <Menu>
    <Name>Desktop</Name>
    <MergeFile type="parent">/etc/xdg/menus/settings.menu</MergeFile>
    <Include>
    <Filename>gnomecc.desktop</Filename>
    </Include>
    <AppDir>/home/bagheera/.local/share/applications</AppDir>
    </Menu>
    applications-kmenuedit.menu
    <!DOCTYPE Menu PUBLIC '-//freedesktop//DTD Menu 1.0//EN' 'http://www.freedesktop.org/standards/menu-spec/1.0/menu.dtd'>
    <Menu>
    <Menu>
    <Name>Development</Name>
    <Layout>
    <Merge type="files"/>
    <Filename>pyCrust.desktop</Filename>
    <Merge type="menus"/>
    <Menuname>Web Development</Menuname>
    <Menuname>Translation</Menuname>
    <Menuname>X-KDE-KDevelopIDE</Menuname>
    <Filename>java-monitoring-and-management-console.desktop</Filename>
    <Filename>kde4-akonadiconsole.desktop</Filename>
    <Filename>netbeans.desktop</Filename>
    <Filename>python2.5.desktop</Filename>
    <Filename>kde4-kapptemplate.desktop</Filename>
    <Filename>designer.desktop</Filename>
    <Filename>kde4-kompare.desktop</Filename>
    <Filename>kde4-cervisia.desktop</Filename>
    <Filename>kde4-kcachegrind.desktop</Filename>
    <Filename>java-visualvm.desktop</Filename>
    <Filename>kde4-umbrello.desktop</Filename>
    <Filename>kde4-kuiviewer.desktop</Filename>
    <Filename>assistant.desktop</Filename>
    <Filename>kde4-kbugbuster.desktop</Filename>
    <Filename>geany.desktop</Filename>
    </Layout>
    <Include>
    <Filename>pyCrust.desktop</Filename>
    </Include>
    </Menu>
    <Menu>
    <Name>Applications</Name>
    <Exclude>
    <Filename>wine-Programy-4shared Service-4shared Uploader.desktop</Filename>
    <Filename>wine-Programy-K-Lite Codec Pack-Configuration-AC3Filter.desktop</Filename>
    <Filename>wine-Programy-AutoCAD R14-AutoCAD R14.desktop</Filename>
    <Filename>wine-Programy-K-Lite Codec Pack-Tools-Xvid StatsReader.desktop</Filename>
    <Filename>wine-Programy-AutoHotkey-AutoHotkey.desktop</Filename>
    <Filename>wine-Programy-AutoCAD R14-AutoCAD Readme.desktop</Filename>
    <Filename>wine-Programy-Larian Studios-Beyond Divinity Demo-Configuration.desktop</Filename>
    <Filename>wine-Programy-K-Lite Codec Pack-Configuration-Cyberlink MPEG-2 decoder.desktop</Filename>
    <Filename>wine-Programy-DeliPlayer-DeliPlayer.desktop</Filename>
    <Filename>wine-Programy-Miranda IM-Database Tool.desktop</Filename>
    <Filename>wine-Programy-Free Download Manager-Documentation.desktop</Filename>
    <Filename>wine-Programy-K-Lite Codec Pack-Configuration-DirectVobSub.desktop</Filename>
    <Filename>wine-Programy-AviSynth 2.5-Folder wtyczek.desktop</Filename>
    <Filename>wine-Programy-Atmel AVR Tools-AVR QTouch Studio.desktop</Filename>
    <Filename>wine-Programy-Audacity.desktop</Filename>
    <Filename>wine-Programy-AviSynth 2.5-Angielska dokumentacja.desktop</Filename>
    <Filename>wine-Programy-AutoHotkey-AutoIt3 Window Spy.desktop</Filename>
    <Filename>wine-Programy-SubEdit-Player-SubEdit Pomoc.desktop</Filename>
    <Filename>wine-Programy-AutoHotkey-AutoHotkey Help File.desktop</Filename>
    <Filename>wine-Programy-AutoHotkey-AutoScriptWriter (recorder).desktop</Filename>
    <Filename>wine-Programy-Atmel AVR Tools-AVR Battery Studio.desktop</Filename>
    <Filename>wine-Programy-Borland Delphi 7-Help-Error Messages & Warnings.desktop</Filename>
    <Filename>wine-Programy-Free Download Manager-Free Download Manager.desktop</Filename>
    <Filename>wine-Programy-Free Download Manager-FDM remote control server.desktop</Filename>
    <Filename>wine-Programy-Free Download Manager-Free Download Manager on the Web.desktop</Filename>
    <Filename>wine-Programy-Free Download Manager-Free Upload Manager.desktop</Filename>
    <Filename>wine-Programy-WSCAD 5.0-Instalacja.desktop</Filename>
    <Filename>wine-Programy-MySQL Oracle Import, Export & Convert Software-MySQL Oracle Import, Export & Convert Software.desktop</Filename>
    <Filename>wine-Programy-WSCAD 5.0-Pierwsze kroki.desktop</Filename>
    <Filename>wine-Programy-WSCAD 5.0-Pomoc online.desktop</Filename>
    <Filename>wine-Programy-Fallout Saga DVD-Fallout-Dokumentacja-Pomoc techniczna offline.desktop</Filename>
    <Filename>wine-Programy-Unreal-Play Unreal.desktop</Filename>
    <Filename>wine-Programy-Fallout Saga DVD-Fallout-Dokumentacja-Poradnik do gry (trzynasty schron).desktop</Filename>
    <Filename>wine-Programy-WSCAD 5.0-Readme.desktop</Filename>
    <Filename>wine-Programy-Unreal-Information-Release Notes.desktop</Filename>
    <Filename>oraclexe-runsql.desktop</Filename>
    <Filename>alacarte-made.desktop</Filename>
    <Filename>Shareaza.desktop</Filename>
    <Filename>wine-Programy-Fallout Saga DVD-Fallout-Dokumentacja-Słownik Fallout.desktop</Filename>
    <Filename>oraclexe-startdb.desktop</Filename>
    <Filename>wine-Programy-WSCAD 5.0-Szkolna.desktop</Filename>
    <Filename>wine-Programy-Free Download Manager-Uninstall Free Download Manager.desktop</Filename>
    <Filename>wine-Programy-MySQL Oracle Import, Export & Convert Software-Uninstall MySQL Oracle Import.desktop</Filename>
    <Filename>wine-Programy-Unreal-Unreal Editor.desktop</Filename>
    <Filename>wine-Programy-Unreal-Unreal Safe Mode.desktop</Filename>
    <Filename>wine-Programy-Fallout Saga DVD-Fallout-Uruchom grę Fallout.desktop</Filename>
    <Filename>wine-Programy-Fallout Saga DVD-Fallout-Usuń grę Fallout.desktop</Filename>
    <Filename>wine-Programy-WSCAD 5.0-Usuń WSCAD 5.0.desktop</Filename>
    <Filename>wine-Programy-WIBU-KEY-WIBU-KEY Help (English).desktop</Filename>
    <Filename>wine-WinRAR.desktop</Filename>
    <Filename>wine-Programy-WSCAD 5.0-WSCAD File Viewer.desktop</Filename>
    <Filename>wine-Programy-WSCAD 5.0-Przejęcie danych.desktop</Filename>
    <Filename>wine-winecfg.desktop</Filename>
    </Exclude>
    <Include/>
    <Layout>
    <Merge type="files"/>
    <Filename>screensavers-biof.desktop</Filename>
    <Filename>screensavers-busyspheres.desktop</Filename>
    <Filename>screensavers-colorfire.desktop</Filename>
    <Filename>screensavers-cyclone.desktop</Filename>
    <Filename>screensavers-pixelcity.desktop</Filename>
    <Filename>screensavers-drempels.desktop</Filename>
    <Filename>screensavers-euphoria.desktop</Filename>
    <Filename>screensavers-feedback.desktop</Filename>
    <Filename>screensavers-fieldlines.desktop</Filename>
    <Filename>screensavers-flocks.desktop</Filename>
    <Filename>screensavers-flux.desktop</Filename>
    <Filename>screensavers-helios.desktop</Filename>
    <Filename>screensavers-hufo_smoke.desktop</Filename>
    <Filename>screensavers-hufo_tunnel.desktop</Filename>
    <Filename>screensavers-hyperspace.desktop</Filename>
    <Filename>screensavers-lattice.desktop</Filename>
    <Filename>screensavers-lorenz.desktop</Filename>
    <Filename>screensavers-matrixview.desktop</Filename>
    <Filename>screensavers-plasma.desktop</Filename>
    <Filename>screensavers-skyrocket.desktop</Filename>
    <Filename>screensavers-solarwinds.desktop</Filename>
    <Filename>screensavers-spirographx.desktop</Filename>
    <Filename>screensavers-sundancer2.desktop</Filename>
    </Layout>
    </Menu>
    <Menu>
    <Name>.hidden</Name>
    <Include>
    <Filename>wine-Programy-4shared Service-4shared Uploader.desktop</Filename>
    <Filename>wine-Programy-K-Lite Codec Pack-Configuration-AC3Filter.desktop</Filename>
    <Filename>wine-Programy-AutoCAD R14-AutoCAD R14.desktop</Filename>
    <Filename>wine-Programy-K-Lite Codec Pack-Tools-Xvid StatsReader.desktop</Filename>
    <Filename>wine-Programy-AutoHotkey-AutoHotkey.desktop</Filename>
    <Filename>wine-Programy-AutoCAD R14-AutoCAD Readme.desktop</Filename>
    <Filename>wine-Programy-Larian Studios-Beyond Divinity Demo-Configuration.desktop</Filename>
    <Filename>wine-Programy-K-Lite Codec Pack-Configuration-Cyberlink MPEG-2 decoder.desktop</Filename>
    <Filename>wine-Programy-DeliPlayer-DeliPlayer.desktop</Filename>
    <Filename>wine-Programy-Miranda IM-Database Tool.desktop</Filename>
    <Filename>wine-Programy-Free Download Manager-Documentation.desktop</Filename>
    <Filename>wine-Programy-K-Lite Codec Pack-Configuration-DirectVobSub.desktop</Filename>
    <Filename>wine-Programy-AviSynth 2.5-Folder wtyczek.desktop</Filename>
    <Filename>wine-Programy-Atmel AVR Tools-AVR QTouch Studio.desktop</Filename>
    <Filename>wine-Programy-Audacity.desktop</Filename>
    <Filename>wine-Programy-AviSynth 2.5-Angielska dokumentacja.desktop</Filename>
    <Filename>wine-Programy-AutoHotkey-AutoIt3 Window Spy.desktop</Filename>
    <Filename>wine-Programy-SubEdit-Player-SubEdit Pomoc.desktop</Filename>
    <Filename>wine-Programy-AutoHotkey-AutoHotkey Help File.desktop</Filename>
    <Filename>wine-Programy-AutoHotkey-AutoScriptWriter (recorder).desktop</Filename>
    <Filename>wine-Programy-Atmel AVR Tools-AVR Battery Studio.desktop</Filename>
    <Filename>wine-Programy-Startup-ST5UNST Uninstaller.desktop</Filename>
    <Filename>wine-Programy-Borland Delphi 7-Help-Error Messages & Warnings.desktop</Filename>
    <Filename>wine-Programy-Free Download Manager-Free Download Manager.desktop</Filename>
    <Filename>wine-Programy-Free Download Manager-FDM remote control server.desktop</Filename>
    <Filename>wine-Programy-Free Download Manager-Free Download Manager on the Web.desktop</Filename>
    <Filename>wine-Programy-Free Download Manager-Free Upload Manager.desktop</Filename>
    <Filename>wine-Programy-WSCAD 5.0-Instalacja.desktop</Filename>
    <Filename>wine-Programy-MySQL Oracle Import, Export & Convert Software-MySQL Oracle Import, Export & Convert Software.desktop</Filename>
    <Filename>wine-Programy-WSCAD 5.0-Pierwsze kroki.desktop</Filename>
    <Filename>wine-Programy-WSCAD 5.0-Pomoc online.desktop</Filename>
    <Filename>wine-Programy-Fallout Saga DVD-Fallout-Dokumentacja-Pomoc techniczna offline.desktop</Filename>
    <Filename>wine-Programy-Unreal-Play Unreal.desktop</Filename>
    <Filename>wine-Programy-Fallout Saga DVD-Fallout-Dokumentacja-Poradnik do gry (trzynasty schron).desktop</Filename>
    <Filename>wine-Programy-WSCAD 5.0-Readme.desktop</Filename>
    <Filename>wine-Programy-Unreal-Information-Release Notes.desktop</Filename>
    <Filename>oraclexe-runsql.desktop</Filename>
    <Filename>alacarte-made.desktop</Filename>
    <Filename>Shareaza.desktop</Filename>
    <Filename>wine-Programy-Fallout Saga DVD-Fallout-Dokumentacja-Słownik Fallout.desktop</Filename>
    <Filename>oraclexe-startdb.desktop</Filename>
    <Filename>wine-Programy-WSCAD 5.0-Szkolna.desktop</Filename>
    <Filename>wine-Programy-Free Download Manager-Uninstall Free Download Manager.desktop</Filename>
    <Filename>wine-Programy-MySQL Oracle Import, Export & Convert Software-Uninstall MySQL Oracle Import.desktop</Filename>
    <Filename>wine-Programy-Unreal-Unreal Editor.desktop</Filename>
    <Filename>wine-Programy-Unreal-Unreal Safe Mode.desktop</Filename>
    <Filename>wine-Programy-Fallout Saga DVD-Fallout-Uruchom grę Fallout.desktop</Filename>
    <Filename>wine-Programy-Fallout Saga DVD-Fallout-Usuń grę Fallout.desktop</Filename>
    <Filename>wine-Programy-WSCAD 5.0-Usuń WSCAD 5.0.desktop</Filename>
    <Filename>wine-Programy-WIBU-KEY-WIBU-KEY Help (English).desktop</Filename>
    <Filename>wine-WinRAR.desktop</Filename>
    <Filename>wine-Programy-WSCAD 5.0-WSCAD File Viewer.desktop</Filename>
    <Filename>wine-Programy-WSCAD 5.0-Przejęcie danych.desktop</Filename>
    </Include>
    </Menu>
    <Menu>
    <Name>wine-wine</Name>
    <Menu>
    <Name>wine-Programy</Name>
    <Layout>
    <Merge type="menus"/>
    <Menuname>wine-Programy-Bulk Rename Utility</Menuname>
    <Menuname>wine-Programy-K-Lite Codec Pack</Menuname>
    <Menuname>wine-Programy-Microsoft Office</Menuname>
    <Menuname>wine-Programy-PowerISO</Menuname>
    <Menuname>wine-Programy-Shareaza</Menuname>
    <Menuname>wine-Programy-Startup</Menuname>
    <Menuname>wine-Programy-TED Notepad</Menuname>
    <Menuname>wine-Programy-WinRAR</Menuname>
    <Menuname>wine-Programy-WinUAE</Menuname>
    <Menuname>wine-Programy-XnView</Menuname>
    <Menuname>wine-Programy-Xvid</Menuname>
    <Merge type="files"/>
    <Filename>wine-Programy-Windows Media Player.desktop</Filename>
    </Layout>
    <Menu>
    <Name>wine-Programy-Startup</Name>
    <Layout/>
    <Exclude>
    <Filename>wine-Programy-Startup-ST5UNST Uninstaller.desktop</Filename>
    </Exclude>
    </Menu>
    <Deleted/>
    <Menu>
    <Name>wine-Programy-4shared Service</Name>
    <Deleted/>
    </Menu>
    <Menu>
    <Name>wine-Programy-Atari</Name>
    <Deleted/>
    </Menu>
    <Menu>
    <Name>wine-Programy-Atmel AVR Tools</Name>
    <Deleted/>
    </Menu>
    <Menu>
    <Name>wine-Programy-AutoCAD R14</Name>
    <Deleted/>
    </Menu>
    <Menu>
    <Name>wine-Programy-AutoCAD R14.0 - odinstalowanie</Name>
    <Deleted/>
    </Menu>
    <Menu>
    <Name>wine-Programy-AutoHotkey</Name>
    <Deleted/>
    </Menu>
    <Menu>
    <Name>wine-Programy-Black Isle</Name>
    <Deleted/>
    </Menu>
    <Menu>
    <Name>wine-Programy-Borland Delphi 7</Name>
    <Deleted/>
    </Menu>
    <Menu>
    <Name>wine-Programy-Bullfrog</Name>
    <Deleted/>
    </Menu>
    <Menu>
    <Name>wine-Programy-DeliPlayer</Name>
    <Deleted/>
    </Menu>
    <Menu>
    <Name>wine-Programy-Diablo</Name>
    <Deleted/>
    </Menu>
    <Menu>
    <Name>wine-Programy-DreamCatcher</Name>
    <Deleted/>
    </Menu>
    <Menu>
    <Name>wine-Programy-EuroPlus+ Angielski z Cambridge</Name>
    <Deleted/>
    </Menu>
    <Menu>
    <Name>wine-Programy-femm 4.2</Name>
    <Deleted/>
    </Menu>
    <Menu>
    <Name>wine-Programy-Heroes of Might and Magic III</Name>
    <Deleted/>
    </Menu>
    <Menu>
    <Name>wine-Programy-Intelligent Converters</Name>
    <Deleted/>
    </Menu>
    <Menu>
    <Name>wine-Programy-Interplay</Name>
    <Deleted/>
    </Menu>
    <Menu>
    <Name>wine-Programy-xp-AntiSpy</Name>
    <Deleted/>
    </Menu>
    <Menu>
    <Name>wine-Programy-Winamp</Name>
    <Deleted/>
    </Menu>
    <Menu>
    <Name>wine-Programy-Unreal Antologia</Name>
    <Deleted/>
    </Menu>
    <Menu>
    <Name>wine-Programy-SubEdit-Player</Name>
    <Deleted/>
    </Menu>
    <Menu>
    <Name>wine-Programy-Sierra</Name>
    <Deleted/>
    </Menu>
    <Menu>
    <Name>wine-Programy-NAPI-PROJEKT</Name>
    <Deleted/>
    </Menu>
    <Menu>
    <Name>wine-Programy-Miranda IM</Name>
    <Deleted/>
    </Menu>
    <Menu>
    <Name>wine-Programy-MicroSim Eval 8</Name>
    <Deleted/>
    </Menu>
    <Menu>
    <Name>wine-Programy-Larian Studios</Name>
    <Deleted/>
    </Menu>
    </Menu>
    <Menu>
    <Name>wine-Programs</Name>
    <Deleted/>
    </Menu>
    <Include>
    <Filename>wine-winecfg.desktop</Filename>
    <Filename>dysk C.desktop</Filename>
    </Include>
    <Layout>
    <Merge type="menus"/>
    <Menuname>Programy</Menuname>
    <Merge type="files"/>
    <Filename>dysk C.desktop</Filename>
    <Filename>wine-winecfg.desktop</Filename>
    <Filename>wine-Nowy dokument Office.desktop</Filename>
    <Filename>wine-Otwórz dokument Office.desktop</Filename>
    </Layout>
    <Menu>
    <Name>Programy</Name>
    <NotDeleted/>
    <Layout>
    <Merge type="files"/>
    <Filename>TEDNotepad.desktop</Filename>
    </Layout>
    <Include>
    <Filename>TEDNotepad.desktop</Filename>
    </Include>
    </Menu>
    <Deleted/>
    </Menu>
    <Menu>
    <Name>Programy</Name>
    <Directory>Programy.directory</Directory>
    </Menu>
    <Move>
    <Old>Programy/</Old>
    <New>wine-wine/Programy/</New>
    </Move>
    <Layout>
    <Merge type="menus"/>
    <Menuname>Programy</Menuname>
    <Menuname>Office</Menuname>
    <Menuname>Education</Menuname>
    <Menuname>Graphics</Menuname>
    <Menuname>Games</Menuname>
    <Menuname>Internet</Menuname>
    <Menuname>Multimedia</Menuname>
    <Menuname>Utilities</Menuname>
    <Menuname>Development</Menuname>
    <Menuname>Science</Menuname>
    <Menuname>System</Menuname>
    <Menuname>Settingsmenu</Menuname>
    <Menuname>Arch Linux</Menuname>
    <Menuname>Applications</Menuname>
    <Merge type="files"/>
    <Filename>kde4-Help.desktop</Filename>
    <Filename>kde4-kfind.desktop</Filename>
    </Layout>
    </Menu>
    applications.menu
    <!DOCTYPE Menu
    PUBLIC '-//freedesktop//DTD Menu 1.0//EN'
    'http://standards.freedesktop.org/menu-spec/menu-1.0.dtd'>
    <Menu>
    <Name>Applications</Name>
    <MergeFile type="parent">/etc/xdg/menus/applications.menu</MergeFile>
    <Menu>
    <Name>System</Name>
    <DirectoryDir>/home/bagheera/.local/share/desktop-directories</DirectoryDir>
    </Menu>
    <Menu>
    <Name>Development</Name>
    <DirectoryDir>/home/bagheera/.local/share/desktop-directories</DirectoryDir>
    <Include>
    <Filename>python2.5.desktop</Filename>
    </Include>
    <AppDir>/home/bagheera/.local/share/applications</AppDir>
    </Menu>
    <Menu>
    <Name>Other</Name>
    <DirectoryDir>/home/bagheera/.local/share/desktop-directories</DirectoryDir>
    <Deleted/>
    </Menu>
    <Menu>
    <Name>alacarte-made</Name>
    <Directory>alacarte-made.directory</Directory>
    <Deleted/>
    </Menu>
    <DefaultLayout inline="false"/>
    <Menu>
    <Name>alacarte-made-1</Name>
    <Directory>alacarte-made-1.directory</Directory>
    <Deleted/>
    </Menu>
    <Menu>
    <Name>Multimedia</Name>
    <Include>
    <Filename>cdemu-client.desktop</Filename>
    </Include>
    <AppDir>/home/bagheera/.local/share/applications</AppDir>
    <Include>
    <Filename>vumeter.desktop</Filename>
    </Include>
    </Menu>
    <Menu>
    <Name>Office</Name>
    <Include>
    <Filename>ooo-math.desktop</Filename>
    </Include>
    <AppDir>/home/bagheera/.local/share/applications</AppDir>
    </Menu>
    <Menu>
    <Name>wine-wine</Name>
    <Menu>
    <Name>wine-Programs</Name>
    <DirectoryDir>/home/bagheera/.local/share/desktop-directories</DirectoryDir>
    </Menu>
    <Menu>
    <Name>wine-Programy</Name>
    <Menu>
    <Name>wine-Programy-4shared Service</Name>
    </Menu>
    <Menu>
    <Name>wine-Programy-AutoCAD R14</Name>
    </Menu>
    <Menu>
    <Name>wine-Programy-AutoCAD R14.0 - odinstalowanie</Name>
    </Menu>
    <Menu>
    <Name>wine-Programy-MicroSim Eval 8</Name>
    </Menu>
    <Menu>
    <Name>wine-Programy-Miranda IM</Name>
    </Menu>
    <Include>
    <Filename>EuroPlus+ Angielski z Cambridge.desktop</Filename>
    </Include>
    <Menu>
    <Name>wine-Programy-Intelligent Converters</Name>
    </Menu>
    <Include>
    <Filename>WinRAR.desktop</Filename>
    </Include>
    <Include>
    <Filename>TED Notepad.desktop</Filename>
    </Include>
    <Include>
    <Filename>Shareaza.desktop</Filename>
    </Include>
    <Menu>
    <Name>wine-Programy-WinRAR</Name>
    </Menu>
    <Menu>
    <Name>wine-Programy-TED Notepad</Name>
    </Menu>
    <Menu>
    <Name>wine-Programy-Shareaza</Name>
    </Menu>
    <Menu>
    <Name>wine-Programy-EuroPlus+ Angielski z Cambridge</Name>
    </Menu>
    <Menu>
    <Name>wine-Programy-Atari</Name>
    <Menu>
    <Name>wine-Programy-Atari-Temple of Elemental Evil</Name>
    </Menu>
    </Menu>
    <Menu>
    <Name>wine-Programy-WinUAE</Name>
    </Menu>
    <Menu>
    <Name>wine-Programy-PowerISO</Name>
    </Menu>
    <Menu>
    <Name>wine-Programy-NAPI-PROJEKT</Name>
    </Menu>
    <Menu>
    <Name>wine-Programy-femm 4.2</Name>
    </Menu>
    <Menu>
    <Name>wine-Programy-Diablo</Name>
    </Menu>
    <Menu>
    <Name>wine-Programy-Heroes of Might and Magic III</Name>
    </Menu>
    <Menu>
    <Name>wine-Programy-Xvid</Name>
    </Menu>
    </Menu>
    <AppDir>/home/bagheera/.local/share/applications</AppDir>
    <Exclude>
    <Filename>wine-µTorrent.desktop</Filename>
    </Exclude>
    </Menu>
    <Menu>
    <Name>Education</Name>
    <Include>
    <Filename>alacarte-made.desktop</Filename>
    </Include>
    </Menu>
    </Menu>
    K, i got it!
    I have removed all files from ~/.config/menus/ except applications-kmenuedit.menu, and removed all sections from file except first *menu:
    <!DOCTYPE Menu PUBLIC '-//freedesktop//DTD Menu 1.0//EN' 'http://www.freedesktop.org/standards/menu-spec/1.0/menu.dtd'>
    <Menu>
    <Menu>
    <Name>Development</Name>
    <Include>
    <Filename>pyCrust.desktop</Filename>
    <Filename>IDLE.desktop</Filename>
    </Include>
    <Layout>
    <Merge type="files" />
    <Filename>IDLE.desktop</Filename>
    <Filename>pyCrust.desktop</Filename>
    <Merge type="menus" />
    <Menuname>Web Development</Menuname>
    <Menuname>Translation</Menuname>
    <Menuname>X-KDE-KDevelopIDE</Menuname>
    <Filename>kde4-cervisia.desktop</Filename>
    <Filename>CMake.desktop</Filename>
    <Filename>geany.desktop</Filename>
    <Filename>java-monitoring-and-management-console.desktop</Filename>
    <Filename>java-visualvm.desktop</Filename>
    <Filename>kde4-kcachegrind.desktop</Filename>
    <Filename>kde4-kompare.desktop</Filename>
    <Filename>kde4-akonadiconsole.desktop</Filename>
    <Filename>kde4-kuiviewer.desktop</Filename>
    <Filename>netbeans.desktop</Filename>
    <Filename>kde4-kbugbuster.desktop</Filename>
    <Filename>assistant.desktop</Filename>
    <Filename>designer.desktop</Filename>
    <Filename>kde4-kapptemplate.desktop</Filename>
    <Filename>kde4-umbrello.desktop</Filename>
    </Layout>
    </Menu>
    </Menu>
    *contents may vary
    Now i have wine menu back :]
    Last edited by bagheera (2010-03-15 13:01:08)

    faxmanloveswaffles wrote:bump?
    Please don't do that. Please read the Forum Etiquette, in particular the section on bumping:
    Posting a single word or useless message (bumping) to attract attention to your thread is not allowed. Do your own research, continue to troubleshoot, post the results, and be patient with the community. If people are reading your thread without answering or offering help, you may try supplying more details, or ask to be pointed in the right direction. Often, the reason for posts remaining unanswered is due in large part to the sparse details in the original post itself, or, the obvious availability of solutions in the wiki, on the forum or on the web, and the community's unwillingness to point out the obvious.
    Last edited by 2ManyDogs (2012-10-28 19:47:06)

  • Can't get Wine menu in KDE tried editting menu

    I'm a new Arch User. I followed a YouTube video to get me started and I read the beginners wiki afterwards. I've been using Ubuntu based distros for 1 1/2 - 2 years. I'm loving arch linux since it is very light and I've been able to get most of my packages from either the AUR or the official repos.
    Info:
    ArchLinux x86_64 Kernel 3.6.3-1-ARCH
    QUESTION:
    I installed wine like this
    sudo pacman -S wine winetricks wine_gecko
    I noticed when I opened the KDE menu, no Wine menu was in Applications like in Ubuntu. ?
    I tried following https://wiki.archlinux.org/index.php/Wi … Fix.5B1.5D
    But it did not work.
    Can someone help? Thanks
    Last edited by faxmanloveswaffles (2012-10-28 15:40:59)

    faxmanloveswaffles wrote:bump?
    Please don't do that. Please read the Forum Etiquette, in particular the section on bumping:
    Posting a single word or useless message (bumping) to attract attention to your thread is not allowed. Do your own research, continue to troubleshoot, post the results, and be patient with the community. If people are reading your thread without answering or offering help, you may try supplying more details, or ask to be pointed in the right direction. Often, the reason for posts remaining unanswered is due in large part to the sparse details in the original post itself, or, the obvious availability of solutions in the wiki, on the forum or on the web, and the community's unwillingness to point out the obvious.
    Last edited by 2ManyDogs (2012-10-28 19:47:06)

  • [SOLVED] xfce4 wine menu

    Is there a way I can have a category called Wine on my xfce menu bar that holds all the wine applications i have installed?
    Last edited by efeX (2009-11-06 06:16:04)

    Good to hear.  Please mark the thread as solved by editing your first post and adding [SOLVED] to the beginning of the topic title.

  • [SOLVED] Existing GRUB Win menu entries don't appear

    Hi,
    Just finished a fresh dual boot (Arch-64/Win7-64), dual HDs installation.
    I've installed os-prober prior to installing grub, and indeed a (seemingly) correct menu entry was added (in segment 30-see below).
    Yet after reboot, this entry does NOT appear!
    I've tried adding a respective entry in the 40-custom, (and ran ' grub-mkconfig -o /boot/grub/grub.cfg' afterwards), yet still the same (menu entry appears in grub.cfg yet does NOT appear after reboot!).
    Please advise!
    Thanks!
    my grub.cfg (note existing grub 30 & 40 segments
    # DO NOT EDIT THIS FILE
    # It is automatically generated by grub-mkconfig using templates
    # from /etc/grub.d and settings from /etc/default/grub
    ### BEGIN /etc/grub.d/00_header ###
    insmod part_gpt
    insmod part_msdos
    if [ -s $prefix/grubenv ]; then
    load_env
    fi
    if [ "${next_entry}" ] ; then
    set default="${next_entry}"
    set next_entry=
    save_env next_entry
    set boot_once=true
    else
    set default="0"
    fi
    if [ x"${feature_menuentry_id}" = xy ]; then
    menuentry_id_option="--id"
    else
    menuentry_id_option=""
    fi
    export menuentry_id_option
    if [ "${prev_saved_entry}" ]; then
    set saved_entry="${prev_saved_entry}"
    save_env saved_entry
    set prev_saved_entry=
    save_env prev_saved_entry
    set boot_once=true
    fi
    function savedefault {
    if [ -z "${boot_once}" ]; then
    saved_entry="${chosen}"
    save_env saved_entry
    fi
    function load_video {
    if [ x$feature_all_video_module = xy ]; then
    insmod all_video
    else
    insmod efi_gop
    insmod efi_uga
    insmod ieee1275_fb
    insmod vbe
    insmod vga
    insmod video_bochs
    insmod video_cirrus
    fi
    if [ x$feature_default_font_path = xy ] ; then
    font=unicode
    else
    insmod part_gpt
    insmod ext2
    set root='hd0,gpt2'
    if [ x$feature_platform_search_hint = xy ]; then
    search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt2 --hint-efi=hd0,gpt2 --hint-baremetal=ahci0,gpt2 6ee857d9-95d1-47c4-ad47-18b979f49e74
    else
    search --no-floppy --fs-uuid --set=root 6ee857d9-95d1-47c4-ad47-18b979f49e74
    fi
    font="/usr/share/grub/unicode.pf2"
    fi
    if loadfont $font ; then
    set gfxmode=auto
    load_video
    insmod gfxterm
    fi
    terminal_input console
    terminal_output gfxterm
    set timeout=5
    ### END /etc/grub.d/00_header ###
    ### BEGIN /etc/grub.d/10_linux ###
    menuentry 'Arch Linux, with Linux core repo kernel' --class arch --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-core repo kernel-true-6ee857d9-95d1 -47c4-ad47-18b979f49e74' {
    load_video
    set gfxpayload=keep
    insmod gzio
    insmod part_msdos
    insmod ext2
    set root='hd1,msdos2'
    if [ x$feature_platform_search_hint = xy ]; then
    search --no-floppy --fs-uuid --set=root --hint-bios=hd1,msdos2 --hint-efi=hd1,msdos2 --hint-baremetal=ahci1,msdos2 76af1051-313e-4736-a61c-7c6c8dbaf6ba
    else
    search --no-floppy --fs-uuid --set=root 76af1051-313e-4736-a61c-7c6c8dbaf6ba
    fi
    echo 'Loading Linux core repo kernel ...'
    linux /vmlinuz-linux root=UUID=6ee857d9-95d1-47c4-ad47-18b979f49e74 rw quiet
    echo 'Loading initial ramdisk ...'
    initrd /initramfs-linux.img
    menuentry 'Arch Linux, with Linux core repo kernel (Fallback initramfs)' --class arch --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-core repo kern el-fallback-6ee857d9-95d1-47c4-ad47-18b979f49e74' {
    load_video
    set gfxpayload=keep
    insmod gzio
    insmod part_msdos
    insmod ext2
    set root='hd1,msdos2'
    if [ x$feature_platform_search_hint = xy ]; then
    search --no-floppy --fs-uuid --set=root --hint-bios=hd1,msdos2 --hint-efi=hd1,msdos2 --hint-baremetal=ahci1,msdos2 76af1051-313e-4736-a61c-7c6c8dbaf6ba
    else
    search --no-floppy --fs-uuid --set=root 76af1051-313e-4736-a61c-7c6c8dbaf6ba
    fi
    echo 'Loading Linux core repo kernel ...'
    linux /vmlinuz-linux root=UUID=6ee857d9-95d1-47c4-ad47-18b979f49e74 rw quiet
    echo 'Loading initial ramdisk ...'
    initrd /initramfs-linux-fallback.img
    menuentry 'Arch Linux' --class arch --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-6ee857d9-95d1-47c4-ad47-18b979f49e74' {
    load_video
    set gfxpayload=keep
    insmod gzio
    insmod part_msdos
    insmod ext2
    set root='hd1,msdos2'
    if [ x$feature_platform_search_hint = xy ]; then
    search --no-floppy --fs-uuid --set=root --hint-bios=hd1,msdos2 --hint-efi=hd1,msdos2 --hint-baremetal=ahci1,msdos2 76af1051-313e-4736-a61c-7c6c8dbaf6ba
    else
    search --no-floppy --fs-uuid --set=root 76af1051-313e-4736-a61c-7c6c8dbaf6ba
    fi
    echo 'Loading Linux core repo kernel ...'
    linux /vmlinuz-linux root=UUID=6ee857d9-95d1-47c4-ad47-18b979f49e74 rw quiet
    echo 'Loading initial ramdisk ...'
    initrd /initramfs-linux-fallback.img
    submenu 'Advanced options for Arch Linux' $menuentry_id_option 'gnulinux-advanced-6ee857d9-95d1-47c4-ad47-18b979f49e74' {
    ### END /etc/grub.d/10_linux ###
    ### BEGIN /etc/grub.d/20_linux_xen ###
    ### END /etc/grub.d/20_linux_xen ###
    ### BEGIN /etc/grub.d/30_os-prober ###
    menuentry 'Windows 7 (loader) (on /dev/sdb1)' --class windows --class os $menuentry_id_option 'osprober-chain-67AD726A113E664B' {
    insmod part_msdos
    insmod ntfs
    set root='hd1,msdos1'
    if [ x$feature_platform_search_hint = xy ]; then
    search --no-floppy --fs-uuid --set=root --hint-bios=hd1,msdos1 --hint-efi=hd1,msdos1 --hint-baremetal=ahci1,msdos1 67AD726A113E664B
    else
    search --no-floppy --fs-uuid --set=root 67AD726A113E664B
    fi
    chainloader +1
    ### END /etc/grub.d/30_os-prober ###
    ### BEGIN /etc/grub.d/40_custom ###
    # This file provides an easy way to add custom menu entries. Simply type the
    # menu entries you want to add after this comment. Be careful not to change
    # the 'exec tail' line above.
    # Windows 7
    menuentry "Windows 7" {
    set root=(hd1,1)
    chainloader +1
    ### END /etc/grub.d/40_custom ###
    ### BEGIN /etc/grub.d/41_custom ###
    if [ -f ${config_directory}/custom.cfg ]; then
    source ${config_directory}/custom.cfg
    elif [ -z "${config_directory}" -a -f $prefix/custom.cfg ]; then
    source $prefix/custom.cfg;
    fi
    ### END /etc/grub.d/41_custom ###
    ### BEGIN /etc/grub.d/60_memtest86+ ###
    ### END /etc/grub.d/60_memtest86+ ###
    Last edited by mibadt (2013-12-19 03:00:05)

    i think you have a missing "{" to close the submenu.
    ezik

  • [SOLVED][Openbox] Sub-menus do not appear

    Just switched over to Openbox and was configuring my Menu. The only thing that doesn't want to work are my sub-menus. Using obmenu, I created a link inside an existing menu, with the proper ID of the menu I wanted to be a sub-menu. Saved menu.xml, reconfigured (and even tried restarting) Openbox, but no joy, everything shows but the sub-menus.
    I have 3 sub-menus: apps-office-libreoffice (linked in apps-office-menu), apps-development-qt (linked in apps-development-menu), and apps-games-doom (linked in apps-games-menu)
    I'm pretty confused as to why they wont show up, and google'ing around turned up absolutely no results, so I was hoping someone here could lend a hand. Here's my menu.xml:
    <?xml version="1.0" encoding="utf-8"?>
    <openbox_menu xmlns="http://openbox.org/3.4/menu">
    <menu id="apps-accessories-menu" label="Accessories">
    <item icon="speedcrunch.png" label="SpeedCrunch">
    <action name="Execute">
    <command>speedcrunch</command>
    <startupnotify>
    <enabled>yes</enabled>
    </startupnotify>
    </action>
    </item>
    <item label="Character Map">
    <action name="Execute">
    <command>gucharmap</command>
    <startupnotify>
    <enabled>yes</enabled>
    </startupnotify>
    </action>
    </item>
    <item label="Thunar - Bulk Rename">
    <action name="Execute">
    <execute>/usr/lib/ThunarBulkRename</execute>
    </action>
    </item>
    <item label="PeaZip Archive Manger">
    <action name="Execute">
    <command>ark</command>
    <startupnotify>
    <enabled>yes</enabled>
    </startupnotify>
    </action>
    </item>
    <item label="Xfce Notes">
    <action name="Execute">
    <execute>xfce-notes</execute>
    </action>
    </item>
    </menu>
    <menu id="apps-development-menu" label="Development">
    <item label="GVim">
    <action name="Execute">
    <command>gvim</command>
    <startupnotify>
    <enabled>yes</enabled>
    <wmclass>GVim</wmclass>
    </startupnotify>
    </action>
    </item>
    <separator/>
    <item label="CMake">
    <action name="Execute">
    <execute>cmake-gui</execute>
    </action>
    </item>
    <item label="Meld">
    <action name="Execute">
    <execute>meld</execute>
    </action>
    </item>
    <item label="Kodos">
    <action name="Execute">
    <execute>kodos</execute>
    </action>
    </item>
    <menu id="apps-development-qt"/>
    </menu>
    <menu id="app-games-menu" label="Games">
    <item label="Battle for Wesnoth">
    <action name="Execute">
    <execute>wesnoth</execute>
    </action>
    </item>
    <menu id="apps-games-doom"/>
    <item label="Dwarf Fortress">
    <action name="Execute">
    <execute>dwarffortress</execute>
    </action>
    </item>
    <item label="Minecraft">
    <action name="Execute">
    <execute>minecraft</execute>
    </action>
    </item>
    <item label="Minetest">
    <action name="Execute">
    <execute>minetest</execute>
    </action>
    </item>
    <item label="OpenArena">
    <action name="Execute">
    <execute>openarena</execute>
    </action>
    </item>
    <item label="Skyrim">
    <action name="Execute">
    <execute>wine /games/Skyrim/skse_loader.exe</execute>
    </action>
    </item>
    </menu>
    <menu id="apps-term-menu" label="Terminals">
    <item label="Rxvt Unicode">
    <action name="Execute">
    <command>urxvt</command>
    </action>
    </item>
    <item label="Xfce Terminal">
    <action name="Execute">
    <command>xfce4-terminal</command>
    <startupnotify>
    <enabled>yes</enabled>
    </startupnotify>
    </action>
    </item>
    <item label="TMux">
    <action name="Execute">
    <execute>tmux</execute>
    </action>
    </item>
    </menu>
    <menu id="apps-office-menu" label="Office">
    <menu id="apps-office-libreoffice"/>
    <separator/>
    <item label="Dictionary">
    <action name="Execute">
    <execute>xfce4-dict</execute>
    </action>
    </item>
    <item label="Foxit Reader">
    <action name="Execute">
    <execute>foxitreader</execute>
    </action>
    </item>
    <item label="GNU Cash">
    <action name="Execute">
    <execute>gnucash</execute>
    </action>
    </item>
    <item label="Task Coach">
    <action name="Execute">
    <execute>taskcoach.py</execute>
    </action>
    </item>
    </menu>
    <menu id="apps-net-menu" label="Internet">
    <item label="Firefox">
    <action name="Execute">
    <command>firefox</command>
    <startupnotify>
    <enabled>yes</enabled>
    <wmclass>Firefox</wmclass>
    </startupnotify>
    </action>
    </item>
    <item label="Thunderbird">
    <action name="Execute">
    <execute>thunderbird</execute>
    </action>
    </item>
    <item label="Pidgin">
    <action name="Execute">
    <command>pidgin</command>
    <startupnotify>
    <enabled>yes</enabled>
    </startupnotify>
    </action>
    </item>
    <item label="qBittorrent">
    <action name="Execute">
    <execute>qbittorrent</execute>
    </action>
    </item>
    <separator/>
    <item label="Dropbox">
    <action name="Execute">
    <execute>/opt/dropbox/dropboxd</execute>
    </action>
    </item>
    <item label="Mumble">
    <action name="Execute">
    <execute>mumble</execute>
    </action>
    </item>
    <item label="SpiderOak">
    <action name="Execute">
    <execute>SpiderOak</execute>
    </action>
    </item>
    <item label="Teamspeak">
    <action name="Execute">
    <execute>teamspeak3</execute>
    </action>
    </item>
    <item label="Teamviewer">
    <action name="Execute">
    <execute>/opt/teamviewer/teamviewer/7/bin/teamviewer</execute>
    </action>
    </item>
    </menu>
    <menu id="apps-multimedia-menu" label="Multimedia">
    <item label="Amarok">
    <action name="Execute">
    <command>amarok</command>
    <startupnotify>
    <enabled>yes</enabled>
    </startupnotify>
    </action>
    </item>
    <item label="Audacity">
    <action name="Execute">
    <execute>audacity</execute>
    </action>
    </item>
    <item label="VLC Media Player">
    <action name="Execute">
    <execute>vlc</execute>
    </action>
    </item>
    </menu>
    <menu id="apps-fileman-menu" label="File Managers">
    <item label="Thunar">
    <action name="Execute">
    <command>Thunar</command>
    <startupnotify>
    <enabled>yes</enabled>
    </startupnotify>
    </action>
    </item>
    </menu>
    <menu id="apps-graphics-menu" label="Graphics">
    <item label="Gimp">
    <action name="Execute">
    <command>gimp</command>
    <startupnotify>
    <enabled>yes</enabled>
    </startupnotify>
    </action>
    </item>
    </menu>
    <menu id="system-menu" label="System">
    <item label="Openbox Menu Editor">
    <action name="Execute">
    <execute>obmenu</execute>
    </action>
    </item>
    <item label="Openbox Configuration Manager">
    <action name="Execute">
    <command>obconf</command>
    <startupnotify>
    <enabled>yes</enabled>
    </startupnotify>
    </action>
    </item>
    <item label="tint2 Configuration">
    <action name="Execute">
    <execute>tint2conf</execute>
    </action>
    </item>
    <item label="Xfce Settings">
    <action name="Execute">
    <command>xfce-setting-show</command>
    <startupnotify>
    <enabled>yes</enabled>
    </startupnotify>
    </action>
    </item>
    <separator/>
    <item label="Reconfigure Openbox">
    <action name="Reconfigure"/>
    </item>
    </menu>
    <menu id="apps-wine-menu" label="Wine">
    <item label="Wine Configuration (Q4Wine)">
    <action name="Execute">
    <execute>q4wine -b</execute>
    </action>
    </item>
    <item label="WineCFG">
    <action name="Execute">
    <execute>winecfg</execute>
    </action>
    </item>
    <item label="WineTricks">
    <action name="Execute">
    <execute>winetricks</execute>
    </action>
    </item>
    <separator/>
    <item label="Steam">
    <action name="Execute">
    <execute>wine ~/.wine/drive_c/Program\ Files\ \(x86\)/Steam/Steam.exe -no-dwrite &gt;/dev/null 2&gt;&amp;1 &amp;</execute>
    </action>
    </item>
    </menu>
    <menu id="apps-office-libreoffice" label="LibreOffice">
    <item label="LibreOffice">
    <action name="Execute">
    <execute>libreoffice</execute>
    </action>
    </item>
    <item label="Base">
    <action name="Execute">
    <execute>libreoffice --base</execute>
    </action>
    </item>
    <item label="Calc">
    <action name="Execute">
    <execute>libreoffice --calc</execute>
    </action>
    </item>
    <item label="Draw">
    <action name="Execute">
    <execute>libreoffice --draw</execute>
    </action>
    </item>
    <item label="Impress">
    <action name="Execute">
    <execute>libreoffice --impress</execute>
    </action>
    </item>
    <item label="Math">
    <action name="Execute">
    <execute>libreoffice --math</execute>
    </action>
    </item>
    <item label="Writer">
    <action name="Execute">
    <execute>libreoffice --writer</execute>
    </action>
    </item>
    </menu>
    <menu id="apps-development-qt" label="Qt">
    <item label="Qt Assistant">
    <action name="Execute">
    <execute>assistant</execute>
    </action>
    </item>
    <item label="Qt Designer">
    <action name="Execute">
    <execute>designer</execute>
    </action>
    </item>
    <item label="Qt Linguist">
    <action name="Execute">
    <execute>linguist</execute>
    </action>
    </item>
    </menu>
    <menu id="apps-games-doom" label="DOOM">
    <item label="GZDoom">
    <action name="Execute">
    <execute>gzdoom</execute>
    </action>
    </item>
    <item label="GZDoom (Brutal)">
    <action name="Execute">
    <execute>gzdoom -file /usr/share/games/doom/brutalv017gzdoom.pk3</execute>
    </action>
    </item>
    </menu>
    <menu icon="gtk-execute" id="root-menu" label="Openbox 3">
    <item label="Run Application...">
    <action name="Execute">
    <execute>xfce4-appfinder</execute>
    </action>
    </item>
    <separator label="Applications"/>
    <menu id="apps-accessories-menu"/>
    <menu id="apps-development-menu"/>
    <menu id="app-games-menu"/>
    <menu id="apps-net-menu"/>
    <menu id="apps-multimedia-menu"/>
    <menu id="apps-graphics-menu"/>
    <menu id="apps-office-menu"/>
    <menu id="apps-fileman-menu"/>
    <separator label="System"/>
    <menu id="system-menu"/>
    <menu id="apps-term-menu"/>
    <menu id="apps-wine-menu"/>
    <separator/>
    <item label="Restart">
    <action name="Restart"/>
    </item>
    <item label="Log Out">
    <action name="Exit">
    <prompt>yes</prompt>
    </action>
    </item>
    </menu>
    </openbox_menu>
    Last edited by ZeroKnight (2012-11-09 08:05:29)

    I figured out the issue. I did have all three menus defined separately, and I linked to them the same way all the other menus were linked to the root menu:
    <menu icon="gtk-execute" id="root-menu" label="Openbox 3">
    <item label="Run Application...">
    <action name="Execute">
    <execute>xfce4-appfinder</execute>
    </action>
    </item>
    <separator label="Applications"/>
    <menu id="apps-accessories-menu"/>
    <menu id="apps-development-menu"/>
    <menu id="app-games-menu"/>
    <menu id="apps-net-menu"/>
    <menu id="apps-multimedia-menu"/>
    <menu id="apps-graphics-menu"/>
    <menu id="apps-office-menu"/>
    <menu id="apps-fileman-menu"/>
    <separator label="System"/>
    <menu id="system-menu"/>
    <menu id="apps-term-menu"/>
    <menu id="apps-wine-menu"/>
    <separator/>
    <item label="Restart">
    <action name="Restart"/>
    </item>
    <item label="Log Out">
    <action name="Exit">
    <prompt>yes</prompt>
    </action>
    </item>
    </menu>
    As you can see, all of them are defined, and then linked into the root window with the: <menu id="..."/> lines. I did the same with my Qt, Doom, and LibreOffice menus; defined them separately, then linked them into my other menus that way, ie. <menu id="apps-games-doom"/>
    Defined later, near the bottom of the file:
    <menu id="apps-development-qt" label="Qt">
    <item label="Qt Assistant">
    <action name="Execute">
    <execute>assistant</execute>
    </action>
    </item>
    <item label="Qt Designer">
    <action name="Execute">
    <execute>designer</execute>
    </action>
    </item>
    <item label="Qt Linguist">
    <action name="Execute">
    <execute>linguist</execute>
    </action>
    </item>
    </menu>
    Then "linked" earlier in the file, in the "Development" menu definition:
    <menu id="apps-development-menu" label="Development">
    <item label="GVim">
    <action name="Execute">
    <command>gvim</command>
    <startupnotify>
    <enabled>yes</enabled>
    <wmclass>GVim</wmclass>
    </startupnotify>
    </action>
    </item>
    <separator/>
    <item label="CMake">
    <action name="Execute">
    <execute>cmake-gui</execute>
    </action>
    </item>
    <item label="Meld">
    <action name="Execute">
    <execute>meld</execute>
    </action>
    </item>
    <item label="Kodos">
    <action name="Execute">
    <execute>kodos</execute>
    </action>
    </item>
    <menu id="apps-development-qt"/> <<-------- just like in the root window definition...yet it doesn't work here.
    </menu>
    Anyway...I tried what you said and just put the whole menu definition itself inside of the previous ones and it worked out, strangely enough. Maybe it's just an ordering error? The definitions did get pushed to the bottom, so I wonder if that was it. Oh well...simple enough fix. Thanks for the suggestion
    I feel somewhat silly, though I really don't know why that didn't work. I guess obmenu is a little misleading
    [EDIT]
    Interestingly enough, yes, ordering was the issue. I tried moving the sub-menu definitions to the top of the file, and kept the "links" where they were, and it worked out. So for clarity:
    Menus must be defined before linking them, OR just put the sub-menu definition inside the parent menu definition.
    Last edited by ZeroKnight (2012-11-09 08:05:04)

  • Menu, Button, Menuitem backgroundcolor

    is there any way to change the menu , button , menuItem background color,
    i know there is hastable for maintaing ui component color. and one can get the
    that defaults value using UIManager.getDefaults(). which returns a hastable . and you can set the key with corresponding value for some component.
    UIManager.getDefaults().put("win.menu.backgroundColor",Color.RED);
    but that doesnt work.
    but the following line works
    UIManager.put("TableHeader.background", Color.RED);
    but the following line doesnt work.
    UIManager.put("ScrollBar.background", Color.RED);
    i dont why swing team exposed the api , and that api doesnt works. :)

    While it would be nice if we could expect all LookAndFeel implementations to use the same keys in the UIDefaults table, and while most implementations I've seen do make every honest effort to do so, it's not guaranteed. There's no reason why an LAF couldn't use a completely arbitrary set of keys, as long as all its associated UIs were geared for it. So... when you're trying to make changes to the UIDefaults table, it's always a good idea to check the LAF class. For example, let's pretend like we're working with the Metal look and feel (javax.swing.plaf.metal.MetalLookAndFeel class). It subclasses the javax.swing.plaf.basic.BasicLookAndFeel class, so remember to look up the heirarchy.
    And we'll see that the key for the background color of a JMenuItem is "MenuItem.background", a JButton is "Button.background", and JMenu is "Menu.background". Those are the keys you set in the UIManager.
    Personally, I prefer putting in a javax.swing.plaf.ColorUIResource instead of a straight java.awt.Color. But that's me.
    As for why "ScrollBar.background" isn't working for you, well, it seems like it should, but you might double-check the ScrollBarUI for the LAF you're using and see if maybe it's not looking somewhere else.

  • [SOLVED] Running wine prog from Openbox menu

    Hello everyone. I was wondering if there's a way to run a program installed through wine from the openbox menu? The problem I'm having is that you have to be in the directory with the .exe in order to run it properly. I can run it fine from the terminal but not openbox.
    I've tried the suggestions here: http://crunchbang.org/forums/viewtopic.php?id=24893
    Any ideas?
    Last edited by Somnus (2013-12-28 01:37:39)

    Probably the best formal way to do this is by creating a .desktop file for your Wine application and putting it in the ~/.local/share/applications directory.
    In this file you would specify a Path key to change to the .exe directory, and then the Exec key to run: wine /path/name.exe etc
    In the Openbox menu you'd then make an entry which runs a command - like xdg-open - which can launch the .desktop file.
    (My own launcher fyr can do this, for example, but there are others.)
    Using .desktop files is the "modern" way to launch applications!

  • Scan for and connect to networks from an openbox pipe menu (netcfg)

    So the other day when i was using wifi-select (awesome tool) to connect to a friends hot-spot, i realized "hey! this would be great as an openbox pipe menu."  i'm fairly decent in bash and i knew both netcfg and wifi-select were in bash so why not rewrite it that way?
    Wifi-Pipe
    A simplified version of wifi-select which will scan for networks and populate an openbox right-click menu item with available networks.  displays security type and signal strength.  click on a network to connect via netcfg the same way wifi-select does it.
    zenity is used to ask for a password and notify of a bad connection.  one can optionally remove the netcfg profile if the connection fails.
    What's needed
    -- you have to be using netcfg to manage your wireless
    -- you have to install zenity
    -- you have to save the script as ~/.config/openbox/wifi-pipe and make it executable:
    chmod +x ~/.config/openbox/wifi-pipe
    -- you have to add a sudoers entry to allow passwordless sudo on this script and netcfg (!)
    USERNAME ALL=(ALL) NOPASSWD: /usr/bin/netcfg
    USERNAME ALL=(ALL) NOPASSWD: /home/USERNAME/.config/openbox/wifi-pipe
    -- you have to adjust  ~/.config/openbox/menu.xml like so:
    <menu id="root-menu" label="Openbox 3">
    <menu id="pipe-wifi" label="Wifi" execute="sudo /home/USERNAME/.config/openbox/wifi-pipe INTERFACE" />
    <menu id="term-menu"/>
    <item label="Run...">
    <action name="Execute">
    <command>gmrun</command>
    </action>
    </item>
    where USERNAME is you and INTERFACE is probably wlan0 or similar
    openbox --reconfigure and you should be good to go.
    The script
    #!/bin/bash
    # pbrisbin 2009
    # simplified version of wifi-select designed to output as an openbox pipe menu
    # required:
    # netcfg
    # zenity
    # NOPASSWD entries for this and netcfg through visudo
    # the following in menu.xml:
    # <menu id="pipe-wifi" label="Wifi" execute="sudo /path/to/wifi.pipe interface"/>
    # the idea is to run this script once to scan/print, then again immediately to connect.
    # therefore, if you scan but don't connect, a temp file is left in /tmp. the next scan
    # will overwrite it, and the next connect will remove it.
    # source this just to get PROFILE_DIR
    . /usr/lib/network/network
    [ -z "$PROFILE_DIR" ] && PROFILE_DIR='/etc/network.d/'
    # awk code for parsing iwlist output
    # putting it here removes the wifi-select dependency
    # and allows for my own tweaking
    # prints a list "essid=security=quality_as_percentage"
    PARSER='
    BEGIN { FS=":"; OFS="="; }
    /\<Cell/ { if (essid) print essid, security, quality[2]/quality[3]*100; security="none" }
    /\<ESSID:/ { essid=substr($2, 2, length($2) - 2) } # discard quotes
    /\<Quality=/ { split($1, quality, "[=/]") }
    /\<Encryption key:on/ { security="wep" }
    /\<IE:.*WPA.*/ { security="wpa" }
    END { if (essid) print essid, security, quality[2]/quality[3]*100 }
    errorout() {
    echo "<openbox_pipe_menu>"
    echo "<item label=\"$1\" />"
    echo "</openbox_pipe_menu>"
    exit 1
    create_profile() {
    ESSID="$1"; INTERFACE="$2"; SECURITY="$3"; KEY="$4"
    PROFILE_FILE="$PROFILE_DIR$ESSID"
    cat > "$PROFILE_FILE" << END_OF_PROFILE
    CONNECTION="wireless"
    ESSID="$ESSID"
    INTERFACE="$INTERFACE"
    DESCRIPTION="Automatically generated profile"
    SCAN="yes"
    IP="dhcp"
    TIMEOUT="10"
    SECURITY="$SECURITY"
    END_OF_PROFILE
    # i think wifi-select should adopt these perms too...
    if [ -n "$KEY" ]; then
    echo "KEY=\"$KEY\"" >> "$PROFILE_FILE"
    chmod 600 "$PROFILE_FILE"
    else
    chmod 644 "$PROFILE_FILE"
    fi
    print_menu() {
    # scan for networks
    iwlist $INTERFACE scan 2>/dev/null | awk "$PARSER" | sort -t= -nrk3 > /tmp/networks.tmp
    # exit if none found
    if [ ! -s /tmp/networks.tmp ]; then
    rm /tmp/networks.tmp
    errorout "no networks found."
    fi
    # otherwise print the menu
    local IFS='='
    echo "<openbox_pipe_menu>"
    while read ESSID SECURITY QUALITY; do
    echo "<item label=\"$ESSID ($SECURITY) ${QUALITY/.*/}%\">" # trim decimals
    echo " <action name=\"Execute\">"
    echo " <command>sudo $0 $INTERFACE connect \"$ESSID\"</command>"
    echo " </action>"
    echo "</item>"
    done < /tmp/networks.tmp
    echo "</openbox_pipe_menu>"
    connect() {
    # check for an existing profile
    PROFILE_FILE="$(grep -REl "ESSID=[\"']?$ESSID[\"']?" "$PROFILE_DIR" | grep -v '~$' | head -n1)"
    # if found use it, else create a new profile
    if [ -n "$PROFILE_FILE" ]; then
    PROFILE=$(basename "$PROFILE_FILE")
    else
    PROFILE="$ESSID"
    SECURITY="$(awk -F '=' "/$ESSID/"'{print $2}' /tmp/networks.tmp | head -n1)"
    # ask for the security key if needed
    if [ "$SECURITY" != "none" ]; then
    KEY="$(zenity --entry --title="Authentication" --text="Please enter $SECURITY key for $ESSID" --hide-text)"
    fi
    # create the new profile
    create_profile "$ESSID" "$INTERFACE" "$SECURITY" "$KEY"
    fi
    # connect
    netcfg2 "$PROFILE" >/tmp/output.tmp
    # if failed, ask about removal of created profile
    if [ $? -ne 0 ]; then
    zenity --question \
    --title="Connection failed" \
    --text="$(grep -Eo "[\-\>]\ .*$" /tmp/output.tmp) \n Remove $PROFILE_FILE?" \
    --ok-label="Remove profile"
    [ $? -eq 0 ] && rm $PROFILE_FILE
    fi
    rm /tmp/output.tmp
    rm /tmp/networks.tmp
    [ $(id -u) -ne 0 ] && errorout "root access required."
    [ -z "$1" ] && errorout "usage: $0 [interface]"
    INTERFACE="$1"; shift
    # i added a sleep if we need to explicitly bring it up
    # b/c youll get "no networks found" when you scan right away
    # this only happens if we aren't up already
    if ! ifconfig | grep -q $INTERFACE; then
    ifconfig $INTERFACE up &>/dev/null || errorout "$INTERFACE not up"
    while ! ifconfig | grep -q $INTERFACE; do sleep 1; done
    fi
    if [ "$1" = "connect" ]; then
    ESSID="$2"
    connect
    else
    print_menu
    fi
    Screenshots
    removed -- Hi-res shots available on my site
    NOTE - i have not tested this extensively but it was working for me in most cases.  any updates/fixes will be edited right into this original post.  enjoy!
    UPDATE - 10/24/2009: i moved the awk statement from wifi-select directly into the script.  this did two things: wifi-select is no longer needed on the system, and i could tweak the awk statement to be more accurate.  it now prints a true percentange.  iwlist prints something like Quality=17/70 and the original awk statement would just output 17 as the quality.  i changed to print (17/70)*100 then bash trims the decimals so you get a true percentage.
    Last edited by brisbin33 (2010-05-09 01:28:20)

    froli wrote:
    I think the script's not working ... When I type
    sh wifi-pipe
    in a term it returns nothing
    well, just to be sure you're doing it right...
    he above is only an adjustment to the OB script's print_menu() function, it's not an entire script to itself.  so, if the original OB script shows output for you with
    sh ./wifi-pipe
    then using the above pint_menu() function (with all the other supporting code) should also show output, (only really only changes the echo's so they print the info in the pekwm format).
    oh, and if neither version shows output when you rut it in a term, then you've got other issues... ;P
    here's an entire [untested] pekwm script:
    #!/bin/bash
    # pbrisbin 2009
    # simplified version of wifi-select designed to output as an pekwm pipe menu
    # required:
    # netcfg
    # zenity
    # NOPASSWD entries for this and netcfg through visudo
    # the following in pekwm config file:
    # SubMenu = "WiFi" {
    # Entry = { Actions = "Dynamic /path/to/wifi-pipe" }
    # the idea is to run this script once to scan/print, then again immediately to connect.
    # therefore, if you scan but don't connect, a temp file is left in /tmp. the next scan
    # will overwrite it, and the next connect will remove it.
    # source this to get PROFILE_DIR and SUBR_DIR
    . /usr/lib/network/network
    errorout() {
    echo "Dynamic {"
    echo " Entry = \"$1\""
    echo "}"
    exit 1
    create_profile() {
    ESSID="$1"; INTERFACE="$2"; SECURITY="$3"; KEY="$4"
    PROFILE_FILE="$PROFILE_DIR$ESSID"
    cat > "$PROFILE_FILE" << END_OF_PROFILE
    CONNECTION="wireless"
    ESSID="$ESSID"
    INTERFACE="$INTERFACE"
    DESCRIPTION="Automatically generated profile"
    SCAN="yes"
    IP="dhcp"
    TIMEOUT="10"
    SECURITY="$SECURITY"
    END_OF_PROFILE
    # i think wifi-select should adopt these perms too...
    if [ -n "$KEY" ]; then
    echo "KEY=\"$KEY\"" >> "$PROFILE_FILE"
    chmod 600 "$PROFILE_FILE"
    else
    chmod 644 "$PROFILE_FILE"
    fi
    print_menu() {
    # scan for networks
    iwlist $INTERFACE scan 2>/dev/null | awk -f $SUBR_DIR/parse-iwlist.awk | sort -t= -nrk3 > /tmp/networks.tmp
    # exit if none found
    if [ ! -s /tmp/networks.tmp ]; then
    rm /tmp/networks.tmp
    errorout "no networks found."
    fi
    # otherwise print the menu
    echo "Dynamic {"
    IFS='='
    cat /tmp/networks.tmp | while read ESSID SECURITY QUALITY; do
    echo "Entry = \"$ESSID ($SECURITY) $QUALITY%\" {"
    echo " Actions = \"Exec sudo $0 $INTERFACE connect \\\"$ESSID\\\"\"</command>"
    echo "}"
    done
    unset IFS
    echo "}"
    connect() {
    # check for an existing profile
    PROFILE_FILE="$(grep -REl "ESSID=[\"']?$ESSID[\"']?" "$PROFILE_DIR" | grep -v '~$' | head -n1)"
    # if found use it, else create a new profile
    if [ -n "$PROFILE_FILE" ]; then
    PROFILE=$(basename "$PROFILE_FILE")
    else
    PROFILE="$ESSID"
    SECURITY="$(awk -F '=' "/$ESSID/"'{print $2}' /tmp/networks.tmp | head -n1)"
    # ask for the security key if needed
    if [ "$SECURITY" != "none" ]; then
    KEY="$(zenity --entry --title="Authentication" --text="Please enter $SECURITY key for $ESSID" --hide-text)"
    fi
    # create the new profile
    create_profile "$ESSID" "$INTERFACE" "$SECURITY" "$KEY"
    fi
    # connect
    netcfg2 "$PROFILE" >/tmp/output.tmp
    # if failed, ask about removal of created profile
    if [ $? -ne 0 ]; then
    zenity --question \
    --title="Connection failed" \
    --text="$(grep -Eo "[\-\>]\ .*$" /tmp/output.tmp) \n Remove $PROFILE_FILE?" \
    --ok-label="Remove profile"
    [ $? -eq 0 ] && rm $PROFILE_FILE
    fi
    rm /tmp/output.tmp
    rm /tmp/networks.tmp
    [ $(id -u) -ne 0 ] && errorout "root access required."
    [ -z "$1" ] && errorout "usage: $0 [interface]"
    INTERFACE="$1"; shift
    # i added a sleep if we need to explicitly bring it up
    # b/c youll get "no networks found" when you scan right away
    # this only happens if we aren't up already
    if ! ifconfig | grep -q $INTERFACE; then
    ifconfig $INTERFACE up &>/dev/null || errorout "$INTERFACE not up"
    sleep 3
    fi
    if [ "$1" = "connect" ]; then
    ESSID="$2"
    connect
    else
    print_menu
    fi
    exit 0

  • Openbox menu etc doesn´t show [SOLVED]

    Hi, I really need some help here.
    I can´t figure out what the hell is wrong with my openbox.
    I had it running smooth, and because Im new to Linux and Arch I played around I guess and configured.
    Somehow I guess I have configured somesthing totally wrong and now my Openbox don´t work as it should.
    I have tried to replace the rc.xml, menu.xml and the autostart.sh with the defaults and still it doesn´t help!
    When I start Openbox pypanel is supposed to be started, it worked before.
    The only thing that comes up when I log in on openbox now is Conky and nothing else. The right click menu nothing works.
    I will post some configs that is related to the subject and I would be very glad if someone could guide me
    Btw im running Openbox with Gnome.
    rc.xml
    <?xml version="1.0" encoding="UTF-8"?>
    <!-- Do not edit this file, it will be overwritten on install.
    Copy the file to $HOME/.config/openbox/ instead. -->
    <openbox_config xmlns="http://openbox.org/3.4/rc">
    <resistance>
    <strength>10</strength>
    <screen_edge_strength>20</screen_edge_strength>
    </resistance>
    <focus>
    <focusNew>yes</focusNew>
    <!-- always try to focus new windows when they appear. other rules do
    apply -->
    <followMouse>no</followMouse>
    <!-- move focus to a window when you move the mouse into it -->
    <focusLast>yes</focusLast>
    <!-- focus the last used window when changing desktops, instead of the one
    under the mouse pointer. when followMouse is enabled -->
    <underMouse>no</underMouse>
    <!-- move focus under the mouse, even when the mouse is not moving -->
    <focusDelay>200</focusDelay>
    <!-- when followMouse is enabled, the mouse must be inside the window for
    this many milliseconds (1000 = 1 sec) before moving focus to it -->
    <raiseOnFocus>no</raiseOnFocus>
    <!-- when followMouse is enabled, and a window is given focus by moving the
    mouse into it, also raise the window -->
    </focus>
    <placement>
    <policy>Smart</policy>
    <!-- 'Smart' or 'UnderMouse' -->
    <center>yes</center>
    <!-- whether to place windows in the center of the free area found or
    the top left corner -->
    <monitor>Any</monitor>
    <!-- with Smart placement on a multi-monitor system, try to place new windows
    on: 'Any' - any monitor, 'Mouse' - where the mouse is, 'Active' - where
    the active window is -->
    </placement>
    <theme>
    <name>Clearlooks</name>
    <titleLayout>NLIMC</titleLayout>
    <!--
    available characters are NDSLIMC, each can occur at most once.
    N: window icon
    L: window label (AKA title).
    I: iconify
    M: maximize
    C: close
    S: shade (roll up/down)
    D: omnipresent (on all desktops).
    -->
    <keepBorder>yes</keepBorder>
    <animateIconify>yes</animateIconify>
    <font place="ActiveWindow">
    <name>sans</name>
    <size>8</size>
    <!-- font size in points -->
    <weight>bold</weight>
    <!-- 'bold' or 'normal' -->
    <slant>normal</slant>
    <!-- 'italic' or 'normal' -->
    </font>
    <font place="InactiveWindow">
    <name>sans</name>
    <size>8</size>
    <!-- font size in points -->
    <weight>bold</weight>
    <!-- 'bold' or 'normal' -->
    <slant>normal</slant>
    <!-- 'italic' or 'normal' -->
    </font>
    <font place="MenuHeader">
    <name>sans</name>
    <size>9</size>
    <!-- font size in points -->
    <weight>normal</weight>
    <!-- 'bold' or 'normal' -->
    <slant>normal</slant>
    <!-- 'italic' or 'normal' -->
    </font>
    <font place="MenuItem">
    <name>sans</name>
    <size>9</size>
    <!-- font size in points -->
    <weight>normal</weight>
    <!-- 'bold' or 'normal' -->
    <slant>normal</slant>
    <!-- 'italic' or 'normal' -->
    </font>
    <font place="OnScreenDisplay">
    <name>sans</name>
    <size>9</size>
    <!-- font size in points -->
    <weight>bold</weight>
    <!-- 'bold' or 'normal' -->
    <slant>normal</slant>
    <!-- 'italic' or 'normal' -->
    </font>
    </theme>
    <desktops>
    <!-- this stuff is only used at startup, pagers allow you to change them
    during a session
    these are default values to use when other ones are not already set
    by other applications, or saved in your session
    use obconf if you want to change these without having to log out
    and back in -->
    <number>4</number>
    <firstdesk>1</firstdesk>
    <names>
    <!-- set names up here if you want to, like this:
    <name>desktop 1</name>
    <name>desktop 2</name>
    -->
    </names>
    <popupTime>875</popupTime>
    <!-- The number of milliseconds to show the popup for when switching
    desktops. Set this to 0 to disable the popup. -->
    </desktops>
    <resize>
    <drawContents>yes</drawContents>
    <popupShow>Nonpixel</popupShow>
    <!-- 'Always', 'Never', or 'Nonpixel' (xterms and such) -->
    <popupPosition>Center</popupPosition>
    <!-- 'Center', 'Top', or 'Fixed' -->
    <popupFixedPosition>
    <!-- these are used if popupPosition is set to 'Fixed' -->
    <x>10</x>
    <!-- positive number for distance from left edge, negative number for
    distance from right edge, or 'Center' -->
    <y>10</y>
    <!-- positive number for distance from top edge, negative number for
    distance from bottom edge, or 'Center' -->
    </popupFixedPosition>
    </resize>
    <!-- You can reserve a portion of your screen where windows will not cover when
    they are maximized, or when they are initially placed.
    Many programs reserve space automatically, but you can use this in other
    cases. -->
    <margins>
    <top>0</top>
    <bottom>0</bottom>
    <left>0</left>
    <right>0</right>
    </margins>
    <dock>
    <position>TopLeft</position>
    <!-- (Top|Bottom)(Left|Right|)|Top|Bottom|Left|Right|Floating -->
    <floatingX>0</floatingX>
    <floatingY>0</floatingY>
    <noStrut>no</noStrut>
    <stacking>Above</stacking>
    <!-- 'Above', 'Normal', or 'Below' -->
    <direction>Vertical</direction>
    <!-- 'Vertical' or 'Horizontal' -->
    <autoHide>no</autoHide>
    <hideDelay>300</hideDelay>
    <!-- in milliseconds (1000 = 1 second) -->
    <showDelay>300</showDelay>
    <!-- in milliseconds (1000 = 1 second) -->
    <moveButton>Middle</moveButton>
    <!-- 'Left', 'Middle', 'Right' -->
    </dock>
    <keyboard>
    <chainQuitKey>C-g</chainQuitKey>
    <!-- Keybindings for desktop switching -->
    <keybind key="C-A-Left">
    <action name="DesktopLeft"><dialog>no</dialog><wrap>no</wrap></action>
    </keybind>
    <keybind key="C-A-Right">
    <action name="DesktopRight"><dialog>no</dialog><wrap>no</wrap></action>
    </keybind>
    <keybind key="C-A-Up">
    <action name="DesktopUp"><dialog>no</dialog><wrap>no</wrap></action>
    </keybind>
    <keybind key="C-A-Down">
    <action name="DesktopDown"><dialog>no</dialog><wrap>no</wrap></action>
    </keybind>
    <keybind key="S-A-Left">
    <action name="SendToDesktopLeft"><dialog>no</dialog><wrap>no</wrap></action>
    </keybind>
    <keybind key="S-A-Right">
    <action name="SendToDesktopRight"><dialog>no</dialog><wrap>no</wrap></action>
    </keybind>
    <keybind key="S-A-Up">
    <action name="SendToDesktopUp"><dialog>no</dialog><wrap>no</wrap></action>
    </keybind>
    <keybind key="S-A-Down">
    <action name="SendToDesktopDown"><dialog>no</dialog><wrap>no</wrap></action>
    </keybind>
    <keybind key="W-F1">
    <action name="Desktop"><desktop>1</desktop></action>
    </keybind>
    <keybind key="W-F2">
    <action name="Desktop"><desktop>2</desktop></action>
    </keybind>
    <keybind key="W-F3">
    <action name="Desktop"><desktop>3</desktop></action>
    </keybind>
    <keybind key="W-F4">
    <action name="Desktop"><desktop>4</desktop></action>
    </keybind>
    <keybind key="W-d">
    <action name="ToggleShowDesktop"/>
    </keybind>
    <!-- Keybindings for windows -->
    <keybind key="A-F4">
    <action name="Close"/>
    </keybind>
    <keybind key="A-Escape">
    <action name="Lower"/>
    <action name="FocusToBottom"/>
    <action name="Unfocus"/>
    </keybind>
    <keybind key="A-space">
    <action name="ShowMenu"><menu>client-menu</menu></action>
    </keybind>
    <!-- Keybindings for window switching -->
    <keybind key="A-Tab">
    <action name="NextWindow"/>
    </keybind>
    <keybind key="A-S-Tab">
    <action name="PreviousWindow"/>
    </keybind>
    <keybind key="C-A-Tab">
    <action name="NextWindow">
    <panels>yes</panels><desktop>yes</desktop>
    </action>
    </keybind>
    <!-- Keybindings for running applications -->
    <keybind key="W-e">
    <action name="Execute">
    <startupnotify>
    <enabled>true</enabled>
    <name>Konqueror</name>
    </startupnotify>
    <command>kfmclient openProfile filemanagement</command>
    </action>
    </keybind>
    </keyboard>
    <mouse>
    <dragThreshold>8</dragThreshold>
    <!-- number of pixels the mouse must move before a drag begins -->
    <doubleClickTime>200</doubleClickTime>
    <!-- in milliseconds (1000 = 1 second) -->
    <screenEdgeWarpTime>400</screenEdgeWarpTime>
    <!-- Time before changing desktops when the pointer touches the edge of the
    screen while moving a window, in milliseconds (1000 = 1 second).
    Set this to 0 to disable warping -->
    <context name="Frame">
    <mousebind button="A-Left" action="Press">
    <action name="Focus"/>
    <action name="Raise"/>
    </mousebind>
    <mousebind button="A-Left" action="Click">
    <action name="Unshade"/>
    </mousebind>
    <mousebind button="A-Left" action="Drag">
    <action name="Move"/>
    </mousebind>
    <mousebind button="A-Right" action="Press">
    <action name="Focus"/>
    <action name="Raise"/>
    <action name="Unshade"/>
    </mousebind>
    <mousebind button="A-Right" action="Drag">
    <action name="Resize"/>
    </mousebind>
    <mousebind button="A-Middle" action="Press">
    <action name="Lower"/>
    <action name="FocusToBottom"/>
    <action name="Unfocus"/>
    </mousebind>
    <mousebind button="A-Up" action="Click">
    <action name="DesktopPrevious"/>
    </mousebind>
    <mousebind button="A-Down" action="Click">
    <action name="DesktopNext"/>
    </mousebind>
    <mousebind button="C-A-Up" action="Click">
    <action name="DesktopPrevious"/>
    </mousebind>
    <mousebind button="C-A-Down" action="Click">
    <action name="DesktopNext"/>
    </mousebind>
    <mousebind button="A-S-Up" action="Click">
    <action name="SendToDesktopPrevious"/>
    </mousebind>
    <mousebind button="A-S-Down" action="Click">
    <action name="SendToDesktopNext"/>
    </mousebind>
    </context>
    <context name="Titlebar">
    <mousebind button="Left" action="Press">
    <action name="Focus"/>
    <action name="Raise"/>
    </mousebind>
    <mousebind button="Left" action="Drag">
    <action name="Move"/>
    </mousebind>
    <mousebind button="Left" action="DoubleClick">
    <action name="ToggleMaximizeFull"/>
    </mousebind>
    <mousebind button="Middle" action="Press">
    <action name="Lower"/>
    <action name="FocusToBottom"/>
    <action name="Unfocus"/>
    </mousebind>
    <mousebind button="Up" action="Click">
    <action name="Shade"/>
    <action name="FocusToBottom"/>
    <action name="Unfocus"/>
    <action name="Lower"/>
    </mousebind>
    <mousebind button="Down" action="Click">
    <action name="Unshade"/>
    <action name="Raise"/>
    </mousebind>
    <mousebind button="Right" action="Press">
    <action name="Focus"/>
    <action name="Raise"/>
    <action name="ShowMenu"><menu>client-menu</menu></action>
    </mousebind>
    </context>
    <context name="Top">
    <mousebind button="Left" action="Press">
    <action name="Focus"/>
    <action name="Raise"/>
    <action name="Unshade"/>
    </mousebind>
    <mousebind button="Left" action="Drag">
    <action name="Resize"><edge>top</edge></action>
    </mousebind>
    </context>
    <context name="Left">
    <mousebind button="Left" action="Press">
    <action name="Focus"/>
    <action name="Raise"/>
    </mousebind>
    <mousebind button="Left" action="Drag">
    <action name="Resize"><edge>left</edge></action>
    </mousebind>
    </context>
    <context name="Right">
    <mousebind button="Left" action="Press">
    <action name="Focus"/>
    <action name="Raise"/>
    </mousebind>
    <mousebind button="Left" action="Drag">
    <action name="Resize"><edge>right</edge></action>
    </mousebind>
    </context>
    <context name="Bottom">
    <mousebind button="Left" action="Press">
    <action name="Focus"/>
    <action name="Raise"/>
    </mousebind>
    <mousebind button="Left" action="Drag">
    <action name="Resize"><edge>bottom</edge></action>
    </mousebind>
    <mousebind button="Middle" action="Press">
    <action name="Lower"/>
    <action name="FocusToBottom"/>
    <action name="Unfocus"/>
    </mousebind>
    <mousebind button="Right" action="Press">
    <action name="Focus"/>
    <action name="Raise"/>
    <action name="ShowMenu"><menu>client-menu</menu></action>
    </mousebind>
    </context>
    <context name="BLCorner">
    <mousebind button="Left" action="Press">
    <action name="Focus"/>
    <action name="Raise"/>
    </mousebind>
    <mousebind button="Left" action="Drag">
    <action name="Resize"/>
    </mousebind>
    </context>
    <context name="BRCorner">
    <mousebind button="Left" action="Press">
    <action name="Focus"/>
    <action name="Raise"/>
    </mousebind>
    <mousebind button="Left" action="Drag">
    <action name="Resize"/>
    </mousebind>
    </context>
    <context name="TLCorner">
    <mousebind button="Left" action="Press">
    <action name="Focus"/>
    <action name="Raise"/>
    <action name="Unshade"/>
    </mousebind>
    <mousebind button="Left" action="Drag">
    <action name="Resize"/>
    </mousebind>
    </context>
    <context name="TRCorner">
    <mousebind button="Left" action="Press">
    <action name="Focus"/>
    <action name="Raise"/>
    <action name="Unshade"/>
    </mousebind>
    <mousebind button="Left" action="Drag">
    <action name="Resize"/>
    </mousebind>
    </context>
    <context name="Client">
    <mousebind button="Left" action="Press">
    <action name="Focus"/>
    <action name="Raise"/>
    </mousebind>
    <mousebind button="Middle" action="Press">
    <action name="Focus"/>
    <action name="Raise"/>
    </mousebind>
    <mousebind button="Right" action="Press">
    <action name="Focus"/>
    <action name="Raise"/>
    </mousebind>
    </context>
    <context name="Icon">
    <mousebind button="Left" action="Press">
    <action name="Focus"/>
    <action name="Raise"/>
    <action name="Unshade"/>
    <action name="ShowMenu"><menu>client-menu</menu></action>
    </mousebind>
    <mousebind button="Right" action="Press">
    <action name="Focus"/>
    <action name="Raise"/>
    <action name="ShowMenu"><menu>client-menu</menu></action>
    </mousebind>
    </context>
    <context name="AllDesktops">
    <mousebind button="Left" action="Press">
    <action name="Focus"/>
    <action name="Raise"/>
    <action name="Unshade"/>
    </mousebind>
    <mousebind button="Left" action="Click">
    <action name="ToggleOmnipresent"/>
    </mousebind>
    </context>
    <context name="Shade">
    <mousebind button="Left" action="Press">
    <action name="Focus"/>
    <action name="Raise"/>
    </mousebind>
    <mousebind button="Left" action="Click">
    <action name="ToggleShade"/>
    </mousebind>
    </context>
    <context name="Iconify">
    <mousebind button="Left" action="Press">
    <action name="Focus"/>
    <action name="Raise"/>
    </mousebind>
    <mousebind button="Left" action="Click">
    <action name="Iconify"/>
    </mousebind>
    </context>
    <context name="Maximize">
    <mousebind button="Left" action="Press">
    <action name="Focus"/>
    <action name="Raise"/>
    <action name="Unshade"/>
    </mousebind>
    <mousebind button="Middle" action="Press">
    <action name="Focus"/>
    <action name="Raise"/>
    <action name="Unshade"/>
    </mousebind>
    <mousebind button="Right" action="Press">
    <action name="Focus"/>
    <action name="Raise"/>
    <action name="Unshade"/>
    </mousebind>
    <mousebind button="Left" action="Click">
    <action name="ToggleMaximizeFull"/>
    </mousebind>
    <mousebind button="Middle" action="Click">
    <action name="ToggleMaximizeVert"/>
    </mousebind>
    <mousebind button="Right" action="Click">
    <action name="ToggleMaximizeHorz"/>
    </mousebind>
    </context>
    <context name="Close">
    <mousebind button="Left" action="Press">
    <action name="Focus"/>
    <action name="Raise"/>
    <action name="Unshade"/>
    </mousebind>
    <mousebind button="Left" action="Click">
    <action name="Close"/>
    </mousebind>
    </context>
    <context name="Desktop">
    <mousebind button="Up" action="Click">
    <action name="DesktopPrevious"/>
    </mousebind>
    <mousebind button="Down" action="Click">
    <action name="DesktopNext"/>
    </mousebind>
    <mousebind button="A-Up" action="Click">
    <action name="DesktopPrevious"/>
    </mousebind>
    <mousebind button="A-Down" action="Click">
    <action name="DesktopNext"/>
    </mousebind>
    <mousebind button="C-A-Up" action="Click">
    <action name="DesktopPrevious"/>
    </mousebind>
    <mousebind button="C-A-Down" action="Click">
    <action name="DesktopNext"/>
    </mousebind>
    <mousebind button="Left" action="Press">
    <action name="Focus"/>
    <action name="Raise"/>
    </mousebind>
    <mousebind button="Right" action="Press">
    <action name="Focus"/>
    <action name="Raise"/>
    </mousebind>
    </context>
    <context name="Root">
    <!-- Menus -->
    <mousebind button="Middle" action="Press">
    <action name="ShowMenu"><menu>client-list-combined-menu</menu></action>
    </mousebind>
    <mousebind button="Right" action="Press">
    <action name="ShowMenu"><menu>root-menu</menu></action>
    </mousebind>
    </context>
    <context name="MoveResize">
    <mousebind button="Up" action="Click">
    <action name="DesktopPrevious"/>
    </mousebind>
    <mousebind button="Down" action="Click">
    <action name="DesktopNext"/>
    </mousebind>
    <mousebind button="A-Up" action="Click">
    <action name="DesktopPrevious"/>
    </mousebind>
    <mousebind button="A-Down" action="Click">
    <action name="DesktopNext"/>
    </mousebind>
    </context>
    </mouse>
    <menu>
    <!-- You can specify more than one menu file in here and they are all loaded,
    just don't make menu ids clash or, well, it'll be kind of pointless -->
    <!-- default menu file (or custom one in $HOME/.config/openbox/) -->
    <file>menu.xml</file>
    <hideDelay>200</hideDelay>
    <!-- if a press-release lasts longer than this setting (in milliseconds), the
    menu is hidden again -->
    <middle>no</middle>
    <!-- center submenus vertically about the parent entry -->
    <submenuShowDelay>100</submenuShowDelay>
    <!-- this one is easy, time to delay before showing a submenu after hovering
    over the parent entry -->
    <applicationIcons>yes</applicationIcons>
    <!-- controls if icons appear in the client-list-(combined-)menu -->
    <manageDesktops>yes</manageDesktops>
    <!-- show the manage desktops section in the client-list-(combined-)menu -->
    </menu>
    <applications>
    <!--
    # this is an example with comments through out. use these to make your
    # own rules, but without the comments of course.
    <application name="first element of window's WM_CLASS property (see xprop)"
    class="second element of window's WM_CLASS property (see xprop)"
    role="the window's WM_WINDOW_ROLE property (see xprop)"
    type="the window's _NET_WM_WINDOW_TYPE (if unspecified, then
    it is dialog for child windows)">
    # the name or the class can be set, or both. this is used to match
    # windows when they appear. role can optionally be set as well, to
    # further restrict your matches.
    # the name, class, and role use simple wildcard matching such as those
    # used by a shell. you can use * to match any characters and ? to match
    # any single character.
    # the type is one of: normal, dialog, splash, utility, menu, toolbar, dock,
    # or desktop
    # when multiple rules match a window, they will all be applied, in the
    # order that they appear in this list
    # each element can be left out or set to 'default' to specify to not
    # change that attribute of the window
    <decor>yes</decor>
    # enable or disable window decorations
    <shade>no</shade>
    # make the window shaded when it appears, or not
    <position force="no">
    # the position is only used if both an x and y coordinate are provided
    # (and not set to 'default')
    # when force is "yes", then the window will be placed here even if it
    # says you want it placed elsewhere. this is to override buggy
    # applications who refuse to behave
    <x>center</x>
    # a number like 50, or 'center' to center on screen. use a negative number
    # to start from the right (or bottom for <y>), ie -50 is 50 pixels from the
    # right edge (or bottom).
    <y>200</y>
    <monitor>1</monitor>
    # specifies the monitor in a xinerama setup.
    # 1 is the first head, or 'mouse' for wherever the mouse is
    </position>
    <focus>yes</focus>
    # if the window should try be given focus when it appears. if this is set
    # to yes it doesn't guarantee the window will be given focus. some
    # restrictions may apply, but Openbox will try to
    <desktop>1</desktop>
    # 1 is the first desktop, 'all' for all desktops
    <layer>normal</layer>
    # 'above', 'normal', or 'below'
    <iconic>no</iconic>
    # make the window iconified when it appears, or not
    <skip_pager>no</skip_pager>
    # asks to not be shown in pagers
    <skip_taskbar>no</skip_taskbar>
    # asks to not be shown in taskbars. window cycling actions will also
    # skip past such windows
    <fullscreen>yes</fullscreen>
    # make the window in fullscreen mode when it appears
    <maximized>true</maximized>
    # 'Horizontal', 'Vertical' or boolean (yes/no)
    </application>
    # end of the example
    -->
    </applications>
    </openbox_config>
    menu.xml
    <?xml version="1.0" encoding="UTF-8"?>
    <openbox_menu xmlns="http://openbox.org/3.4/menu">
    <menu id="apps-accessories-menu" label="Accessories">
    <item label="Calculator">
    <action name="Execute">
    <command>gnome-calculator</command>
    <startupnotify>
    <enabled>yes</enabled>
    </startupnotify>
    </action>
    </item>
    <item label="Character Map">
    <action name="Execute">
    <command>gnome-character-map</command>
    <startupnotify>
    <enabled>yes</enabled>
    </startupnotify>
    </action>
    </item>
    <item label="Ark File Archiver">
    <action name="Execute">
    <command>ark</command>
    <startupnotify>
    <enabled>yes</enabled>
    </startupnotify>
    </action>
    </item>
    </menu>
    <menu id="apps-editors-menu" label="Editors">
    <item label="GVim">
    <action name="Execute">
    <command>gvim</command>
    <startupnotify>
    <enabled>yes</enabled>
    <wmclass>GVim</wmclass>
    </startupnotify>
    </action>
    </item>
    <item label="Emacs">
    <action name="Execute">
    <command>emacs</command>
    <startupnotify>
    <enabled>yes</enabled>
    <wmclass>Emacs</wmclass>
    </startupnotify>
    </action>
    </item>
    <item label="GEdit">
    <action name="Execute">
    <command>gedit</command>
    <startupnotify>
    <enabled>yes</enabled>
    </startupnotify>
    </action>
    </item>
    <item label="Kate">
    <action name="Execute">
    <command>kate</command>
    <startupnotify>
    <enabled>yes</enabled>
    </startupnotify>
    </action>
    </item>
    <item label="Kwrite">
    <action name="Execute">
    <command>kwrite</command>
    <startupnotify>
    <enabled>yes</enabled>
    </startupnotify>
    </action>
    </item>
    </menu>
    <menu id="apps-term-menu" label="Terminals">
    <item label="Rxvt Unicode">
    <action name="Execute">
    <command>urxvt</command>
    </action>
    </item>
    <item label="Gnome Terminal">
    <action name="Execute">
    <command>gnome-terminal</command>
    <startupnotify>
    <enabled>yes</enabled>
    </startupnotify>
    </action>
    </item>
    <item label="Xfce Terminal">
    <action name="Execute">
    <command>xfce4-terminal</command>
    <startupnotify>
    <enabled>yes</enabled>
    </startupnotify>
    </action>
    </item>
    <item label="Konsole">
    <action name="Execute">
    <command>konsole</command>
    <startupnotify>
    <enabled>yes</enabled>
    </startupnotify>
    </action>
    </item>
    <item label="Xterm">
    <action name="Execute"><command>xterm</command></action>
    </item>
    </menu>
    <menu id="apps-net-menu" label="Internet">
    <item label="Firefox">
    <action name="Execute">
    <command>firefox</command>
    <startupnotify>
    <enabled>yes</enabled>
    <wmclass>Firefox</wmclass>
    </startupnotify>
    </action>
    </item>
    <item label="Opera">
    <action name="Execute">
    <command>opera</command>
    <startupnotify>
    <enabled>yes</enabled>
    <wmclass>Opera</wmclass>
    </startupnotify>
    </action>
    </item>
    <item label="Konqueror">
    <action name="Execute">
    <command>konqueror</command>
    <startupnotify>
    <enabled>yes</enabled>
    </startupnotify>
    </action>
    </item>
    <item label="Epiphany">
    <action name="Execute">
    <command>epiphany</command>
    <startupnotify>
    <enabled>yes</enabled>
    </startupnotify>
    </action>
    </item>
    <item label="Pidgin Instant Messenger">
    <action name="Execute">
    <command>pidgin</command>
    <startupnotify>
    <enabled>yes</enabled>
    </startupnotify>
    </action>
    </item>
    <item label="Kopete Instant Messenger">
    <action name="Execute">
    <command>kopete</command>
    <startupnotify>
    <enabled>yes</enabled>
    </startupnotify>
    </action>
    </item>
    <item label="XChat">
    <action name="Execute">
    <command>xchat</command>
    <startupnotify>
    <enabled>yes</enabled>
    </startupnotify>
    </action>
    </item>
    </menu>
    <menu id="apps-office-menu" label="Office">
    <item label="OpenOffice Base">
    <action name="Execute">
    <command>ooffice -base</command>
    </action>
    </item>
    <item label="OpenOffice Calc">
    <action name="Execute">
    <command>ooffice -calc</command>
    </action>
    </item>
    <item label="OpenOffice Draw">
    <action name="Execute">
    <command>ooffice -draw</command>
    </action>
    </item>
    <item label="OpenOffice Impress">
    <action name="Execute">
    <command>ooffice -impress</command>
    </action>
    </item>
    <item label="OpenOffice Math">
    <action name="Execute">
    <command>ooffice -math</command>
    </action>
    </item>
    <item label="OpenOffice Printer Administration">
    <action name="Execute">
    <command>ooffice-printeradmin</command>
    </action>
    </item>
    <item label="OpenOffice Writer">
    <action name="Execute">
    <command>ooffice -writer</command>
    </action>
    </item>
    </menu>
    <menu id="apps-multimedia-menu" label="Multimedia">
    <item label="Amarok">
    <action name="Execute">
    <command>amarok</command>
    <startupnotify>
    <enabled>yes</enabled>
    </startupnotify>
    </action>
    </item>
    <item label="Rhythmbox">
    <action name="Execute">
    <command>rhythmbox</command>
    <startupnotify>
    <enabled>yes</enabled>
    </startupnotify>
    </action>
    </item>
    <item label="K3b">
    <action name="Execute">
    <command>k3b</command>
    <startupnotify>
    <enabled>yes</enabled>
    </startupnotify>
    </action>
    </item>
    <item label="MPlayer">
    <action name="Execute">
    <command>gmplayer</command>
    <startupnotify>
    <enabled>yes</enabled>
    <wmclass>MPlayer</wmclass>
    </startupnotify>
    </action>
    </item>
    <item label="Totem">
    <action name="Execute">
    <command>totem</command>
    <startupnotify>
    <enabled>yes</enabled>
    </startupnotify>
    </action>
    </item>
    </menu>
    <menu id="apps-fileman-menu" label="File Managers">
    <item label="Nautilus">
    <action name="Execute">
    <command>nautilus --no-desktop --browser</command>
    <startupnotify>
    <enabled>yes</enabled>
    </startupnotify>
    </action>
    </item>
    <item label="Thunar">
    <action name="Execute">
    <command>Thunar</command>
    <startupnotify>
    <enabled>yes</enabled>
    </startupnotify>
    </action>
    </item>
    <item label="KDE File Manager">
    <action name="Execute">
    <command>kfmclient openURL ~</command>
    <startupnotify>
    <enabled>yes</enabled>
    </startupnotify>
    </action>
    </item>
    <item label="Rox">
    <action name="Execute">
    <command>rox</command>
    <startupnotify>
    <enabled>yes</enabled>
    <wmclass>ROX-Filer</wmclass>
    </startupnotify>
    </action>
    </item>
    <item label="PCMan File Manager">
    <action name="Execute">
    <command>pcmanfm</command>
    <startupnotify>
    <enabled>yes</enabled>
    </startupnotify>
    </action>
    </item>
    </menu>
    <menu id="apps-graphics-menu" label="Graphics">
    <item label="Gimp">
    <action name="Execute">
    <command>gimp</command>
    <startupnotify>
    <enabled>yes</enabled>
    </startupnotify>
    </action>
    </item>
    <item label="Gwenview">
    <action name="Execute">
    <command>gwenview</command>
    <startupnotify>
    <enabled>yes</enabled>
    </startupnotify>
    </action>
    </item>
    <item label="Dia Diagram Editor">
    <action name="Execute">
    <command>dia</command>
    <startupnotify>
    <enabled>yes</enabled>
    </startupnotify>
    </action>
    </item>
    <item label="Inkscape">
    <action name="Execute">
    <command>inkscape</command>
    <startupnotify>
    <enabled>yes</enabled>
    </startupnotify>
    </action>
    </item>
    </menu>
    <menu id="system-menu" label="System">
    <item label="Openbox Configuration Manager">
    <action name="Execute">
    <command>obconf</command>
    <startupnotify><enabled>yes</enabled></startupnotify>
    </action>
    </item>
    <item label="Gnome Control Center">
    <action name="Execute">
    <command>gnome-control-center</command>
    <startupnotify><enabled>yes</enabled></startupnotify>
    </action>
    </item>
    <item label="KDE Control Center">
    <action name="Execute">
    <command>kcontrol</command>
    <startupnotify><enabled>yes</enabled></startupnotify>
    </action>
    </item>
    <item label="Xfce Settings">
    <action name="Execute">
    <command>xfce-setting-show</command>
    <startupnotify><enabled>yes</enabled></startupnotify>
    </action>
    </item>
    <item label="Manage Cups Printers">
    <action name="Execute">
    <command>xdg-open http://localhost:631/</command>
    <startupnotify>
    <enabled>no</enabled>
    <icon>cups</icon>
    </startupnotify>
    </action>
    </item>
    <separator />
    <item label="Reconfigure Openbox">
    <action name="Reconfigure" />
    </item>
    <item label="Exit Openbox">
    <action name="Exit">
    <prompt>yes</prompt>
    </action>
    </item>
    </menu>
    <menu id="root-menu" label="Openbox 3">
    <separator label="Applications" />
    <menu id="apps-accessories-menu"/>
    <menu id="apps-editors-menu"/>
    <menu id="apps-graphics-menu"/>
    <menu id="apps-net-menu"/>
    <menu id="apps-office-menu"/>
    <menu id="apps-multimedia-menu"/>
    <menu id="apps-term-menu"/>
    <menu id="apps-fileman-menu"/>
    <separator label="System" />
    <menu id="system-menu"/>
    <separator />
    <item label="Log Out">
    <action name="SessionLogout">
    <prompt>yes</prompt>
    </action>
    </item>
    </menu>
    </openbox_menu>
    autostart.sh
    # This shell script is run before Openbox launches.
    # Environment variables set here are passed to the Openbox session.
    # Set a background color
    BG=""
    if which hsetroot >/dev/null; then
    BG=hsetroot
    else
    if which esetroot >/dev/null; then
    BG=esetroot
    else
    if which xsetroot >/dev/null; then
    BG=xsetroot
    fi
    fi
    fi
    test -z $BG || $BG -solid "#303030"
    # D-bus
    if which dbus-launch >/dev/null && test -z "$DBUS_SESSION_BUS_ADDRESS"; then
    eval `dbus-launch --sh-syntax --exit-with-session`
    fi
    # Make GTK apps look and behave how they were set up in the gnome config tools
    if test -x /usr/libexec/gnome-settings-daemon >/dev/null; then
    /usr/libexec/gnome-settings-daemon &
    elif which gnome-settings-daemon >/dev/null; then
    gnome-settings-daemon &
    # Make GTK apps look and behave how they were set up in the XFCE config tools
    elif which xfce-mcs-manager >/dev/null; then
    xfce-mcs-manager n &
    fi
    # Preload stuff for KDE apps
    if which start_kdeinit >/dev/null; then
    LD_BIND_NOW=true start_kdeinit --new-startup +kcminit_startup &
    fi
    # Run XDG autostart things. By default don't run anything desktop-specific
    # See xdg-autostart --help more info
    DESKTOP_ENV=""
    if which /usr/lib/openbox/xdg-autostart >/dev/null; then
    /usr/lib/openbox/xdg-autostart $DESKTOP_ENV
    fi
    pypanel &
    eval `cat $HOME/.fehbg` &
    setxkbmap se
    conky
    I don´t know really what info you need to help me but please let me know what you need and I will get it for you.
    I want my Openbox back
    /Neuwerld
    Last edited by neuwerld (2009-03-25 17:35:59)

    neuwerld wrote:
    Ohh thanks guys!
    It worked as a charm, and thanks Brisbin33 for the autostart.sh tip.
    So the thing that caused my whole system not to work as it should was that I forgot to put a "&" after conky?
    haha that´s kinda anoying I have been sitting and looking through like a milllion files looking for the answer
    But again, really thanks!
    /Neuwerld
    that little "&" sends the conky process to the background freeing up the current process (your autostart.sh script) to finish doing what it's doing so you can move on to running openbox itself.  with this in mind, it should be obvious why keeping conky in the foreground would cause problems.
    also, replacing it with (sleep 1 && conky) & means... wait a second, when that's done successfully (&&) run conky, and put all of that () to the background.  that way openbox comes up immediatly and only a second later you've got your panel and monitor.
    all this after .xinitrc and before openbox

  • Python openbox pipe menu

    I somewhat hijacked a different thread and my question is more suited here.
    I'm using a python script to check gmail in a pipe menu. At first it was creating problems because it would create a cache but would then not load until the file was removed. To fix this, I removed the last line (which created the cache) and it all works. However, I would prefer to have it work like it was intended.
    The script:
    #!/usr/bin/python
    # Authors: [email protected] [email protected]
    # License: GPL 2.0
    # Usage:
    # Put an entry in your ~/.config/openbox/menu.xml like this:
    # <menu id="gmail" label="gmail" execute="~/.config/openbox/scripts/gmail-openbox.py" />
    # And inside <menu id="root-menu" label="openbox">, add this somewhere (wherever you want it on your menu)
    # <menu id="gmail" />
    import os
    import sys
    import logging
    name = "111111"
    pw = "000000"
    browser = "firefox3"
    filename = "/tmp/.gmail.cache"
    login = "\'https://mail.google.com/mail\'"
    # Allow us to run using installed `libgmail` or the one in parent directory.
    try:
    import libgmail
    except ImportError:
    # Urghhh...
    sys.path.insert(1,
    os.path.realpath(os.path.join(os.path.dirname(__file__),
    os.path.pardir)))
    import libgmail
    if __name__ == "__main__":
    import sys
    from getpass import getpass
    if not os.path.isfile(filename):
    ga = libgmail.GmailAccount(name, pw)
    try:
    ga.login()
    except libgmail.GmailLoginFailure:
    print "<?xml version=\"1.0\" encoding=\"UTF-8\"?>"
    print "<openbox_pipe_menu>"
    print " <item label=\"login failed.\">"
    print " <action name=\"Execute\"><execute>" + browser + " " + login + "</execute></action>"
    print " </item>"
    print "</openbox_pipe_menu>"
    raise SystemExit
    else:
    ga = libgmail.GmailAccount(
    state = libgmail.GmailSessionState(filename = filename))
    msgtotals = ga.getUnreadMsgCount()
    print "<?xml version=\"1.0\" encoding=\"UTF-8\"?>"
    print "<openbox_pipe_menu>"
    print "<separator label=\"Gmail\"/>"
    if msgtotals == 0:
    print " <item label=\"no new messages.\">"
    elif msgtotals == 1:
    print " <item label=\"1 new message.\">"
    else:
    print " <item label=\"" + str(msgtotals) + " new messages.\">"
    print " <action name=\"Execute\"><execute>" + browser + " " + login + "</execute></action>"
    print " </item>"
    print "</openbox_pipe_menu>"
    state = libgmail.GmailSessionState(account = ga).save(filename)
    The line I removed:
    state = libgmail.GmailSessionState(account = ga).save(filename)
    The error I'd get if the cache existed:
    Traceback (most recent call last):
    File "/home/shawn/.config/openbox/scripts/gmail.py", line 56, in <module>
    msgtotals = ga.getUnreadMsgCount()
    File "/home/shawn/.config/openbox/scripts/libgmail.py", line 547, in getUnreadMsgCount
    q = "is:" + U_AS_SUBSET_UNREAD)
    File "/home/shawn/.config/openbox/scripts/libgmail.py", line 428, in _parseSearchResult
    return self._parsePage(_buildURL(**params))
    File "/home/shawn/.config/openbox/scripts/libgmail.py", line 401, in _parsePage
    items = _parsePage(self._retrievePage(urlOrRequest))
    File "/home/shawn/.config/openbox/scripts/libgmail.py", line 369, in _retrievePage
    if self.opener is None:
    AttributeError: GmailAccount instance has no attribute 'opener'
    EDIT - you might need the libgmail.py
    #!/usr/bin/env python
    # libgmail -- Gmail access via Python
    ## To get the version number of the available libgmail version.
    ## Reminder: add date before next release. This attribute is also
    ## used in the setup script.
    Version = '0.1.8' # (Nov 2007)
    # Original author: [email protected]
    # Maintainers: Waseem ([email protected]) and Stas Z ([email protected])
    # License: GPL 2.0
    # NOTE:
    # You should ensure you are permitted to use this script before using it
    # to access Google's Gmail servers.
    # Gmail Implementation Notes
    # ==========================
    # * Folders contain message threads, not individual messages. At present I
    # do not know any way to list all messages without processing thread list.
    LG_DEBUG=0
    from lgconstants import *
    import os,pprint
    import re
    import urllib
    import urllib2
    import mimetypes
    import types
    from cPickle import load, dump
    from email.MIMEBase import MIMEBase
    from email.MIMEText import MIMEText
    from email.MIMEMultipart import MIMEMultipart
    GMAIL_URL_LOGIN = "https://www.google.com/accounts/ServiceLoginBoxAuth"
    GMAIL_URL_GMAIL = "https://mail.google.com/mail/?ui=1&"
    # Set to any value to use proxy.
    PROXY_URL = None # e.g. libgmail.PROXY_URL = 'myproxy.org:3128'
    # TODO: Get these on the fly?
    STANDARD_FOLDERS = [U_INBOX_SEARCH, U_STARRED_SEARCH,
    U_ALL_SEARCH, U_DRAFTS_SEARCH,
    U_SENT_SEARCH, U_SPAM_SEARCH]
    # Constants with names not from the Gmail Javascript:
    # TODO: Move to `lgconstants.py`?
    U_SAVEDRAFT_VIEW = "sd"
    D_DRAFTINFO = "di"
    # NOTE: All other DI_* field offsets seem to match the MI_* field offsets
    DI_BODY = 19
    versionWarned = False # If the Javascript version is different have we
    # warned about it?
    RE_SPLIT_PAGE_CONTENT = re.compile("D\((.*?)\);", re.DOTALL)
    class GmailError(Exception):
    Exception thrown upon gmail-specific failures, in particular a
    failure to log in and a failure to parse responses.
    pass
    class GmailSendError(Exception):
    Exception to throw if we're unable to send a message
    pass
    def _parsePage(pageContent):
    Parse the supplied HTML page and extract useful information from
    the embedded Javascript.
    lines = pageContent.splitlines()
    data = '\n'.join([x for x in lines if x and x[0] in ['D', ')', ',', ']']])
    #data = data.replace(',,',',').replace(',,',',')
    data = re.sub(',{2,}', ',', data)
    result = []
    try:
    exec data in {'__builtins__': None}, {'D': lambda x: result.append(x)}
    except SyntaxError,info:
    print info
    raise GmailError, 'Failed to parse data returned from gmail.'
    items = result
    itemsDict = {}
    namesFoundTwice = []
    for item in items:
    name = item[0]
    try:
    parsedValue = item[1:]
    except Exception:
    parsedValue = ['']
    if itemsDict.has_key(name):
    # This handles the case where a name key is used more than
    # once (e.g. mail items, mail body etc) and automatically
    # places the values into list.
    # TODO: Check this actually works properly, it's early... :-)
    if len(parsedValue) and type(parsedValue[0]) is types.ListType:
    for item in parsedValue:
    itemsDict[name].append(item)
    else:
    itemsDict[name].append(parsedValue)
    else:
    if len(parsedValue) and type(parsedValue[0]) is types.ListType:
    itemsDict[name] = []
    for item in parsedValue:
    itemsDict[name].append(item)
    else:
    itemsDict[name] = [parsedValue]
    return itemsDict
    def _splitBunches(infoItems):# Is this still needed ?? Stas
    Utility to help make it easy to iterate over each item separately,
    even if they were bunched on the page.
    result= []
    # TODO: Decide if this is the best approach.
    for group in infoItems:
    if type(group) == tuple:
    result.extend(group)
    else:
    result.append(group)
    return result
    class SmartRedirectHandler(urllib2.HTTPRedirectHandler):
    def __init__(self, cookiejar):
    self.cookiejar = cookiejar
    def http_error_302(self, req, fp, code, msg, headers):
    # The location redirect doesn't seem to change
    # the hostname header appropriately, so we do
    # by hand. (Is this a bug in urllib2?)
    new_host = re.match(r'http[s]*://(.*?\.google\.com)',
    headers.getheader('Location'))
    if new_host:
    req.add_header("Host", new_host.groups()[0])
    result = urllib2.HTTPRedirectHandler.http_error_302(
    self, req, fp, code, msg, headers)
    return result
    class CookieJar:
    A rough cookie handler, intended to only refer to one domain.
    Does no expiry or anything like that.
    (The only reason this is here is so I don't have to require
    the `ClientCookie` package.)
    def __init__(self):
    self._cookies = {}
    def extractCookies(self, headers, nameFilter = None):
    # TODO: Do this all more nicely?
    for cookie in headers.getheaders('Set-Cookie'):
    name, value = (cookie.split("=", 1) + [""])[:2]
    if LG_DEBUG: print "Extracted cookie `%s`" % (name)
    if not nameFilter or name in nameFilter:
    self._cookies[name] = value.split(";")[0]
    if LG_DEBUG: print "Stored cookie `%s` value `%s`" % (name, self._cookies[name])
    if self._cookies[name] == "EXPIRED":
    if LG_DEBUG:
    print "We got an expired cookie: %s:%s, deleting." % (name, self._cookies[name])
    del self._cookies[name]
    def addCookie(self, name, value):
    self._cookies[name] = value
    def setCookies(self, request):
    request.add_header('Cookie',
    ";".join(["%s=%s" % (k,v)
    for k,v in self._cookies.items()]))
    def _buildURL(**kwargs):
    return "%s%s" % (URL_GMAIL, urllib.urlencode(kwargs))
    def _paramsToMime(params, filenames, files):
    mimeMsg = MIMEMultipart("form-data")
    for name, value in params.iteritems():
    mimeItem = MIMEText(value)
    mimeItem.add_header("Content-Disposition", "form-data", name=name)
    # TODO: Handle this better...?
    for hdr in ['Content-Type','MIME-Version','Content-Transfer-Encoding']:
    del mimeItem[hdr]
    mimeMsg.attach(mimeItem)
    if filenames or files:
    filenames = filenames or []
    files = files or []
    for idx, item in enumerate(filenames + files):
    # TODO: This is messy, tidy it...
    if isinstance(item, str):
    # We assume it's a file path...
    filename = item
    contentType = mimetypes.guess_type(filename)[0]
    payload = open(filename, "rb").read()
    else:
    # We assume it's an `email.Message.Message` instance...
    # TODO: Make more use of the pre-encoded information?
    filename = item.get_filename()
    contentType = item.get_content_type()
    payload = item.get_payload(decode=True)
    if not contentType:
    contentType = "application/octet-stream"
    mimeItem = MIMEBase(*contentType.split("/"))
    mimeItem.add_header("Content-Disposition", "form-data",
    name="file%s" % idx, filename=filename)
    # TODO: Encode the payload?
    mimeItem.set_payload(payload)
    # TODO: Handle this better...?
    for hdr in ['MIME-Version','Content-Transfer-Encoding']:
    del mimeItem[hdr]
    mimeMsg.attach(mimeItem)
    del mimeMsg['MIME-Version']
    return mimeMsg
    class GmailLoginFailure(Exception):
    Raised whenever the login process fails--could be wrong username/password,
    or Gmail service error, for example.
    Extract the error message like this:
    try:
    foobar
    except GmailLoginFailure,e:
    mesg = e.message# or
    print e# uses the __str__
    def __init__(self,message):
    self.message = message
    def __str__(self):
    return repr(self.message)
    class GmailAccount:
    def __init__(self, name = "", pw = "", state = None, domain = None):
    global URL_LOGIN, URL_GMAIL
    self.domain = domain
    if self.domain:
    URL_LOGIN = "https://www.google.com/a/" + self.domain + "/LoginAction"
    URL_GMAIL = "http://mail.google.com/a/" + self.domain + "/?"
    else:
    URL_LOGIN = GMAIL_URL_LOGIN
    URL_GMAIL = GMAIL_URL_GMAIL
    if name and pw:
    self.name = name
    self._pw = pw
    self._cookieJar = CookieJar()
    if PROXY_URL is not None:
    import gmail_transport
    self.opener = urllib2.build_opener(gmail_transport.ConnectHTTPHandler(proxy = PROXY_URL),
    gmail_transport.ConnectHTTPSHandler(proxy = PROXY_URL),
    SmartRedirectHandler(self._cookieJar))
    else:
    self.opener = urllib2.build_opener(
    urllib2.HTTPHandler(debuglevel=0),
    urllib2.HTTPSHandler(debuglevel=0),
    SmartRedirectHandler(self._cookieJar))
    elif state:
    # TODO: Check for stale state cookies?
    self.name, self._cookieJar = state.state
    else:
    raise ValueError("GmailAccount must be instantiated with " \
    "either GmailSessionState object or name " \
    "and password.")
    self._cachedQuotaInfo = None
    self._cachedLabelNames = None
    def login(self):
    # TODO: Throw exception if we were instantiated with state?
    if self.domain:
    data = urllib.urlencode({'continue': URL_GMAIL,
    'at' : 'null',
    'service' : 'mail',
    'userName': self.name,
    'password': self._pw,
    else:
    data = urllib.urlencode({'continue': URL_GMAIL,
    'Email': self.name,
    'Passwd': self._pw,
    headers = {'Host': 'www.google.com',
    'User-Agent': 'Mozilla/5.0 (Compatible; libgmail-python)'}
    req = urllib2.Request(URL_LOGIN, data=data, headers=headers)
    pageData = self._retrievePage(req)
    if not self.domain:
    # The GV cookie no longer comes in this page for
    # "Apps", so this bottom portion is unnecessary for it.
    # This requests the page that provides the required "GV" cookie.
    RE_PAGE_REDIRECT = 'CheckCookie\?continue=([^"\']+)'
    # TODO: Catch more failure exceptions here...?
    try:
    link = re.search(RE_PAGE_REDIRECT, pageData).group(1)
    redirectURL = urllib2.unquote(link)
    redirectURL = redirectURL.replace('\\x26', '&')
    except AttributeError:
    raise GmailLoginFailure("Login failed. (Wrong username/password?)")
    # We aren't concerned with the actual content of this page,
    # just the cookie that is returned with it.
    pageData = self._retrievePage(redirectURL)
    def _retrievePage(self, urlOrRequest):
    if self.opener is None:
    raise "Cannot find urlopener"
    if not isinstance(urlOrRequest, urllib2.Request):
    req = urllib2.Request(urlOrRequest)
    else:
    req = urlOrRequest
    self._cookieJar.setCookies(req)
    req.add_header('User-Agent',
    'Mozilla/5.0 (Compatible; libgmail-python)')
    try:
    resp = self.opener.open(req)
    except urllib2.HTTPError,info:
    print info
    return None
    pageData = resp.read()
    # Extract cookies here
    self._cookieJar.extractCookies(resp.headers)
    # TODO: Enable logging of page data for debugging purposes?
    return pageData
    def _parsePage(self, urlOrRequest):
    Retrieve & then parse the requested page content.
    items = _parsePage(self._retrievePage(urlOrRequest))
    # Automatically cache some things like quota usage.
    # TODO: Cache more?
    # TODO: Expire cached values?
    # TODO: Do this better.
    try:
    self._cachedQuotaInfo = items[D_QUOTA]
    except KeyError:
    pass
    #pprint.pprint(items)
    try:
    self._cachedLabelNames = [category[CT_NAME] for category in items[D_CATEGORIES][0]]
    except KeyError:
    pass
    return items
    def _parseSearchResult(self, searchType, start = 0, **kwargs):
    params = {U_SEARCH: searchType,
    U_START: start,
    U_VIEW: U_THREADLIST_VIEW,
    params.update(kwargs)
    return self._parsePage(_buildURL(**params))
    def _parseThreadSearch(self, searchType, allPages = False, **kwargs):
    Only works for thread-based results at present. # TODO: Change this?
    start = 0
    tot = 0
    threadsInfo = []
    # Option to get *all* threads if multiple pages are used.
    while (start == 0) or (allPages and
    len(threadsInfo) < threadListSummary[TS_TOTAL]):
    items = self._parseSearchResult(searchType, start, **kwargs)
    #TODO: Handle single & zero result case better? Does this work?
    try:
    threads = items[D_THREAD]
    except KeyError:
    break
    else:
    for th in threads:
    if not type(th[0]) is types.ListType:
    th = [th]
    threadsInfo.append(th)
    # TODO: Check if the total or per-page values have changed?
    threadListSummary = items[D_THREADLIST_SUMMARY][0]
    threadsPerPage = threadListSummary[TS_NUM]
    start += threadsPerPage
    # TODO: Record whether or not we retrieved all pages..?
    return GmailSearchResult(self, (searchType, kwargs), threadsInfo)
    def _retrieveJavascript(self, version = ""):
    Note: `version` seems to be ignored.
    return self._retrievePage(_buildURL(view = U_PAGE_VIEW,
    name = "js",
    ver = version))
    def getMessagesByFolder(self, folderName, allPages = False):
    Folders contain conversation/message threads.
    `folderName` -- As set in Gmail interface.
    Returns a `GmailSearchResult` instance.
    *** TODO: Change all "getMessagesByX" to "getThreadsByX"? ***
    return self._parseThreadSearch(folderName, allPages = allPages)
    def getMessagesByQuery(self, query, allPages = False):
    Returns a `GmailSearchResult` instance.
    return self._parseThreadSearch(U_QUERY_SEARCH, q = query,
    allPages = allPages)
    def getQuotaInfo(self, refresh = False):
    Return MB used, Total MB and percentage used.
    # TODO: Change this to a property.
    if not self._cachedQuotaInfo or refresh:
    # TODO: Handle this better...
    self.getMessagesByFolder(U_INBOX_SEARCH)
    return self._cachedQuotaInfo[0][:3]
    def getLabelNames(self, refresh = False):
    # TODO: Change this to a property?
    if not self._cachedLabelNames or refresh:
    # TODO: Handle this better...
    self.getMessagesByFolder(U_INBOX_SEARCH)
    return self._cachedLabelNames
    def getMessagesByLabel(self, label, allPages = False):
    return self._parseThreadSearch(U_CATEGORY_SEARCH,
    cat=label, allPages = allPages)
    def getRawMessage(self, msgId):
    # U_ORIGINAL_MESSAGE_VIEW seems the only one that returns a page.
    # All the other U_* results in a 404 exception. Stas
    PageView = U_ORIGINAL_MESSAGE_VIEW
    return self._retrievePage(
    _buildURL(view=PageView, th=msgId))
    def getUnreadMessages(self):
    return self._parseThreadSearch(U_QUERY_SEARCH,
    q = "is:" + U_AS_SUBSET_UNREAD)
    def getUnreadMsgCount(self):
    items = self._parseSearchResult(U_QUERY_SEARCH,
    q = "is:" + U_AS_SUBSET_UNREAD)
    try:
    result = items[D_THREADLIST_SUMMARY][0][TS_TOTAL_MSGS]
    except KeyError:
    result = 0
    return result
    def _getActionToken(self):
    try:
    at = self._cookieJar._cookies[ACTION_TOKEN_COOKIE]
    except KeyError:
    self.getLabelNames(True)
    at = self._cookieJar._cookies[ACTION_TOKEN_COOKIE]
    return at
    def sendMessage(self, msg, asDraft = False, _extraParams = None):
    `msg` -- `GmailComposedMessage` instance.
    `_extraParams` -- Dictionary containing additional parameters
    to put into POST message. (Not officially
    for external use, more to make feature
    additional a little easier to play with.)
    Note: Now returns `GmailMessageStub` instance with populated
    `id` (and `_account`) fields on success or None on failure.
    # TODO: Handle drafts separately?
    params = {U_VIEW: [U_SENDMAIL_VIEW, U_SAVEDRAFT_VIEW][asDraft],
    U_REFERENCED_MSG: "",
    U_THREAD: "",
    U_DRAFT_MSG: "",
    U_COMPOSEID: "1",
    U_ACTION_TOKEN: self._getActionToken(),
    U_COMPOSE_TO: msg.to,
    U_COMPOSE_CC: msg.cc,
    U_COMPOSE_BCC: msg.bcc,
    "subject": msg.subject,
    "msgbody": msg.body,
    if _extraParams:
    params.update(_extraParams)
    # Amongst other things, I used the following post to work out this:
    # <http://groups.google.com/groups?
    # selm=mailman.1047080233.20095.python-list%40python.org>
    mimeMessage = _paramsToMime(params, msg.filenames, msg.files)
    #### TODO: Ughh, tidy all this up & do it better...
    ## This horrible mess is here for two main reasons:
    ## 1. The `Content-Type` header (which also contains the boundary
    ## marker) needs to be extracted from the MIME message so
    ## we can send it as the request `Content-Type` header instead.
    ## 2. It seems the form submission needs to use "\r\n" for new
    ## lines instead of the "\n" returned by `as_string()`.
    ## I tried changing the value of `NL` used by the `Generator` class
    ## but it didn't work so I'm doing it this way until I figure
    ## out how to do it properly. Of course, first try, if the payloads
    ## contained "\n" sequences they got replaced too, which corrupted
    ## the attachments. I could probably encode the submission,
    ## which would probably be nicer, but in the meantime I'm kludging
    ## this workaround that replaces all non-text payloads with a
    ## marker, changes all "\n" to "\r\n" and finally replaces the
    ## markers with the original payloads.
    ## Yeah, I know, it's horrible, but hey it works doesn't it? If you've
    ## got a problem with it, fix it yourself & give me the patch!
    origPayloads = {}
    FMT_MARKER = "&&&&&&%s&&&&&&"
    for i, m in enumerate(mimeMessage.get_payload()):
    if not isinstance(m, MIMEText): #Do we care if we change text ones?
    origPayloads[i] = m.get_payload()
    m.set_payload(FMT_MARKER % i)
    mimeMessage.epilogue = ""
    msgStr = mimeMessage.as_string()
    contentTypeHeader, data = msgStr.split("\n\n", 1)
    contentTypeHeader = contentTypeHeader.split(":", 1)
    data = data.replace("\n", "\r\n")
    for k,v in origPayloads.iteritems():
    data = data.replace(FMT_MARKER % k, v)
    req = urllib2.Request(_buildURL(), data = data)
    req.add_header(*contentTypeHeader)
    items = self._parsePage(req)
    # TODO: Check composeid?
    # Sometimes we get the success message
    # but the id is 0 and no message is sent
    result = None
    resultInfo = items[D_SENDMAIL_RESULT][0]
    if resultInfo[SM_SUCCESS]:
    result = GmailMessageStub(id = resultInfo[SM_NEWTHREADID],
    _account = self)
    else:
    raise GmailSendError, resultInfo[SM_MSG]
    return result
    def trashMessage(self, msg):
    # TODO: Decide if we should make this a method of `GmailMessage`.
    # TODO: Should we check we have been given a `GmailMessage` instance?
    params = {
    U_ACTION: U_DELETEMESSAGE_ACTION,
    U_ACTION_MESSAGE: msg.id,
    U_ACTION_TOKEN: self._getActionToken(),
    items = self._parsePage(_buildURL(**params))
    # TODO: Mark as trashed on success?
    return (items[D_ACTION_RESULT][0][AR_SUCCESS] == 1)
    def _doThreadAction(self, actionId, thread):
    # TODO: Decide if we should make this a method of `GmailThread`.
    # TODO: Should we check we have been given a `GmailThread` instance?
    params = {
    U_SEARCH: U_ALL_SEARCH, #TODO:Check this search value always works.
    U_VIEW: U_UPDATE_VIEW,
    U_ACTION: actionId,
    U_ACTION_THREAD: thread.id,
    U_ACTION_TOKEN: self._getActionToken(),
    items = self._parsePage(_buildURL(**params))
    return (items[D_ACTION_RESULT][0][AR_SUCCESS] == 1)
    def trashThread(self, thread):
    # TODO: Decide if we should make this a method of `GmailThread`.
    # TODO: Should we check we have been given a `GmailThread` instance?
    result = self._doThreadAction(U_MARKTRASH_ACTION, thread)
    # TODO: Mark as trashed on success?
    return result
    def _createUpdateRequest(self, actionId): #extraData):
    Helper method to create a Request instance for an update (view)
    action.
    Returns populated `Request` instance.
    params = {
    U_VIEW: U_UPDATE_VIEW,
    data = {
    U_ACTION: actionId,
    U_ACTION_TOKEN: self._getActionToken(),
    #data.update(extraData)
    req = urllib2.Request(_buildURL(**params),
    data = urllib.urlencode(data))
    return req
    # TODO: Extract additional common code from handling of labels?
    def createLabel(self, labelName):
    req = self._createUpdateRequest(U_CREATECATEGORY_ACTION + labelName)
    # Note: Label name cache is updated by this call as well. (Handy!)
    items = self._parsePage(req)
    print items
    return (items[D_ACTION_RESULT][0][AR_SUCCESS] == 1)
    def deleteLabel(self, labelName):
    # TODO: Check labelName exits?
    req = self._createUpdateRequest(U_DELETECATEGORY_ACTION + labelName)
    # Note: Label name cache is updated by this call as well. (Handy!)
    items = self._parsePage(req)
    return (items[D_ACTION_RESULT][0][AR_SUCCESS] == 1)
    def renameLabel(self, oldLabelName, newLabelName):
    # TODO: Check oldLabelName exits?
    req = self._createUpdateRequest("%s%s^%s" % (U_RENAMECATEGORY_ACTION,
    oldLabelName, newLabelName))
    # Note: Label name cache is updated by this call as well. (Handy!)
    items = self._parsePage(req)
    return (items[D_ACTION_RESULT][0][AR_SUCCESS] == 1)
    def storeFile(self, filename, label = None):
    # TODO: Handle files larger than single attachment size.
    # TODO: Allow file data objects to be supplied?
    FILE_STORE_VERSION = "FSV_01"
    FILE_STORE_SUBJECT_TEMPLATE = "%s %s" % (FILE_STORE_VERSION, "%s")
    subject = FILE_STORE_SUBJECT_TEMPLATE % os.path.basename(filename)
    msg = GmailComposedMessage(to="", subject=subject, body="",
    filenames=[filename])
    draftMsg = self.sendMessage(msg, asDraft = True)
    if draftMsg and label:
    draftMsg.addLabel(label)
    return draftMsg
    ## CONTACTS SUPPORT
    def getContacts(self):
    Returns a GmailContactList object
    that has all the contacts in it as
    GmailContacts
    contactList = []
    # pnl = a is necessary to get *all* contacts
    myUrl = _buildURL(view='cl',search='contacts', pnl='a')
    myData = self._parsePage(myUrl)
    # This comes back with a dictionary
    # with entry 'cl'
    addresses = myData['cl']
    for entry in addresses:
    if len(entry) >= 6 and entry[0]=='ce':
    newGmailContact = GmailContact(entry[1], entry[2], entry[4], entry[5])
    #### new code used to get all the notes
    #### not used yet due to lockdown problems
    ##rawnotes = self._getSpecInfo(entry[1])
    ##print rawnotes
    ##newGmailContact = GmailContact(entry[1], entry[2], entry[4],rawnotes)
    contactList.append(newGmailContact)
    return GmailContactList(contactList)
    def addContact(self, myContact, *extra_args):
    Attempts to add a GmailContact to the gmail
    address book. Returns true if successful,
    false otherwise
    Please note that after version 0.1.3.3,
    addContact takes one argument of type
    GmailContact, the contact to add.
    The old signature of:
    addContact(name, email, notes='') is still
    supported, but deprecated.
    if len(extra_args) > 0:
    # The user has passed in extra arguments
    # He/she is probably trying to invoke addContact
    # using the old, deprecated signature of:
    # addContact(self, name, email, notes='')
    # Build a GmailContact object and use that instead
    (name, email) = (myContact, extra_args[0])
    if len(extra_args) > 1:
    notes = extra_args[1]
    else:
    notes = ''
    myContact = GmailContact(-1, name, email, notes)
    # TODO: In the ideal world, we'd extract these specific
    # constants into a nice constants file
    # This mostly comes from the Johnvey Gmail API,
    # but also from the gmail.py cited earlier
    myURL = _buildURL(view='up')
    myDataList = [ ('act','ec'),
    ('at', self._cookieJar._cookies['GMAIL_AT']), # Cookie data?
    ('ct_nm', myContact.getName()),
    ('ct_em', myContact.getEmail()),
    ('ct_id', -1 )
    notes = myContact.getNotes()
    if notes != '':
    myDataList.append( ('ctf_n', notes) )
    validinfokeys = [
    'i', # IM
    'p', # Phone
    'd', # Company
    'a', # ADR
    'e', # Email
    'm', # Mobile
    'b', # Pager
    'f', # Fax
    't', # Title
    'o', # Other
    moreInfo = myContact.getMoreInfo()
    ctsn_num = -1
    if moreInfo != {}:
    for ctsf,ctsf_data in moreInfo.items():
    ctsn_num += 1
    # data section header, WORK, HOME,...
    sectionenum ='ctsn_%02d' % ctsn_num
    myDataList.append( ( sectionenum, ctsf ))
    ctsf_num = -1
    if isinstance(ctsf_data[0],str):
    ctsf_num += 1
    # data section
    subsectionenum = 'ctsf_%02d_%02d_%s' % (ctsn_num, ctsf_num, ctsf_data[0]) # ie. ctsf_00_01_p
    myDataList.append( (subsectionenum, ctsf_data[1]) )
    else:
    for info in ctsf_data:
    if validinfokeys.count(info[0]) > 0:
    ctsf_num += 1
    # data section
    subsectionenum = 'ctsf_%02d_%02d_%s' % (ctsn_num, ctsf_num, info[0]) # ie. ctsf_00_01_p
    myDataList.append( (subsectionenum, info[1]) )
    myData = urllib.urlencode(myDataList)
    request = urllib2.Request(myURL,
    data = myData)
    pageData = self._retrievePage(request)
    if pageData.find("The contact was successfully added") == -1:
    print pageData
    if pageData.find("already has the email address") > 0:
    raise Exception("Someone with same email already exists in Gmail.")
    elif pageData.find("https://www.google.com/accounts/ServiceLogin"):
    raise Exception("Login has expired.")
    return False
    else:
    return True
    def _removeContactById(self, id):
    Attempts to remove the contact that occupies
    id "id" from the gmail address book.
    Returns True if successful,
    False otherwise.
    This is a little dangerous since you don't really
    know who you're deleting. Really,
    this should return the name or something of the
    person we just killed.
    Don't call this method.
    You should be using removeContact instead.
    myURL = _buildURL(search='contacts', ct_id = id, c=id, act='dc', at=self._cookieJar._cookies['GMAIL_AT'], view='up')
    pageData = self._retrievePage(myURL)
    if pageData.find("The contact has been deleted") == -1:
    return False
    else:
    return True
    def removeContact(self, gmailContact):
    Attempts to remove the GmailContact passed in
    Returns True if successful, False otherwise.
    # Let's re-fetch the contact list to make
    # sure we're really deleting the guy
    # we think we're deleting
    newContactList = self.getContacts()
    newVersionOfPersonToDelete = newContactList.getContactById(gmailContact.getId())
    # Ok, now we need to ensure that gmailContact
    # is the same as newVersionOfPersonToDelete
    # and then we can go ahead and delete him/her
    if (gmailContact == newVersionOfPersonToDelete):
    return self._removeContactById(gmailContact.getId())
    else:
    # We have a cache coherency problem -- someone
    # else now occupies this ID slot.
    # TODO: Perhaps signal this in some nice way
    # to the end user?
    print "Unable to delete."
    print "Has someone else been modifying the contacts list while we have?"
    print "Old version of person:",gmailContact
    print "New version of person:",newVersionOfPersonToDelete
    return False
    ## Don't remove this. contact stas
    ## def _getSpecInfo(self,id):
    ## Return all the notes data.
    ## This is currently not used due to the fact that it requests pages in
    ## a dos attack manner.
    ## myURL =_buildURL(search='contacts',ct_id=id,c=id,\
    ## at=self._cookieJar._cookies['GMAIL_AT'],view='ct')
    ## pageData = self._retrievePage(myURL)
    ## myData = self._parsePage(myURL)
    ## #print "\nmyData form _getSpecInfo\n",myData
    ## rawnotes = myData['cov'][7]
    ## return rawnotes
    class GmailContact:
    Class for storing a Gmail Contacts list entry
    def __init__(self, name, email, *extra_args):
    Returns a new GmailContact object
    (you can then call addContact on this to commit
    it to the Gmail addressbook, for example)
    Consider calling setNotes() and setMoreInfo()
    to add extended information to this contact
    # Support populating other fields if we're trying
    # to invoke this the old way, with the old constructor
    # whose signature was __init__(self, id, name, email, notes='')
    id = -1
    notes = ''
    if len(extra_args) > 0:
    (id, name) = (name, email)
    email = extra_args[0]
    if len(extra_args) > 1:
    notes = extra_args[1]
    else:
    notes = ''
    self.id = id
    self.name = name
    self.email = email
    self.notes = notes
    self.moreInfo = {}
    def __str__(self):
    return "%s %s %s %s" % (self.id, self.name, self.email, self.notes)
    def __eq__(self, other):
    if not isinstance(other, GmailContact):
    return False
    return (self.getId() == other.getId()) and \
    (self.getName() == other.getName()) and \
    (self.getEmail() == other.getEmail()) and \
    (self.getNotes() == other.getNotes())
    def getId(self):
    return self.id
    def getName(self):
    return self.name
    def getEmail(self):
    return self.email
    def getNotes(self):
    return self.notes
    def setNotes(self, notes):
    Sets the notes field for this GmailContact
    Note that this does NOT change the note
    field on Gmail's end; only adding or removing
    contacts modifies them
    self.notes = notes
    def getMoreInfo(self):
    return self.moreInfo
    def setMoreInfo(self, moreInfo):
    moreInfo format
    Use special key values::
    'i' = IM
    'p' = Phone
    'd' = Company
    'a' = ADR
    'e' = Email
    'm' = Mobile
    'b' = Pager
    'f' = Fax
    't' = Title
    'o' = Other
    Simple example::
    moreInfo = {'Home': ( ('a','852 W Barry'),
    ('p', '1-773-244-1980'),
    ('i', 'aim:brianray34') ) }
    Complex example::
    moreInfo = {
    'Personal': (('e', 'Home Email'),
    ('f', 'Home Fax')),
    'Work': (('d', 'Sample Company'),
    ('t', 'Job Title'),
    ('o', 'Department: Department1'),
    ('o', 'Department: Department2'),
    ('p', 'Work Phone'),
    ('m', 'Mobile Phone'),
    ('f', 'Work Fax'),
    ('b', 'Pager')) }
    self.moreInfo = moreInfo
    def getVCard(self):
    """Returns a vCard 3.0 for this
    contact, as a string"""
    # The \r is is to comply with the RFC2425 section 5.8.1
    vcard = "BEGIN:VCARD\r\n"
    vcard += "VERSION:3.0\r\n"
    ## Deal with multiline notes
    ##vcard += "NOTE:%s\n" % self.getNotes().replace("\n","\\n")
    vcard += "NOTE:%s\r\n" % self.getNotes()
    # Fake-out N by splitting up whatever we get out of getName
    # This might not always do 'the right thing'
    # but it's a *reasonable* compromise
    fullname = self.getName().split()
    fullname.reverse()
    vcard += "N:%s" % ';'.join(fullname) + "\r\n"
    vcard += "FN:%s\r\n" % self.getName()
    vcard += "EMAIL;TYPE=INTERNET:%s\r\n" % self.getEmail()
    vcard += "END:VCARD\r\n\r\n"
    # Final newline in case we want to put more than one in a file
    return vcard
    class GmailContactList:
    Class for storing an entire Gmail contacts list
    and retrieving contacts by Id, Email address, and name
    def __init__(self, contactList):
    self.contactList = contactList
    def __str__(self):
    return '\n'.join([str(item) for item in self.contactList])
    def getCount(self):
    Returns number of contacts
    return len(self.contactList)
    def getAllContacts(self):
    Returns an array of all the
    GmailContacts
    return self.contactList
    def getContactByName(self, name):
    Gets the first contact in the
    address book whose name is 'name'.
    Returns False if no contact
    could be found
    nameList = self.getContactListByName(name)
    if len(nameList) > 0:
    return nameList[0]
    else:
    return False
    def getContactByEmail(self, email):
    Gets the first contact in the
    address book whose name is 'email'.
    As of this writing, Gmail insists
    upon a unique email; i.e. two contacts
    cannot share an email address.
    Returns False if no contact
    could be found
    emailList = self.getContactListByEmail(email)
    if len(emailList) > 0:
    return emailList[0]
    else:
    return False
    def getContactById(self, myId):
    Gets the first contact in the
    address book whose id is 'myId'.
    REMEMBER: ID IS A STRING
    Returns False if no contact
    could be found
    idList = self.getContactListById(myId)
    if len(idList) > 0:
    return idList[0]
    else:
    return False
    def getContactListByName(self, name):
    This function returns a LIST
    of GmailContacts whose name is
    'name'.
    Returns an empty list if no contacts
    were found
    nameList = []
    for entry in self.contactList:
    if entry.getName() == name:
    nameList.append(entry)
    return nameList
    def getContactListByEmail(self, email):
    This function returns a LIST
    of GmailContacts whose email is
    'email'. As of this writing, two contacts
    cannot share an email address, so this
    should only return just one item.
    But it doesn't hurt to be prepared?
    Returns an empty list if no contacts
    were found
    emailList = []
    for entry in self.contactList:
    if entry.getEmail() == email:
    emailList.append(entry)
    return emailList
    def getContactListById(self, myId):
    This function returns a LIST
    of GmailContacts whose id is
    'myId'. We expect there only to
    be one, but just in case!
    Remember: ID IS A STRING
    Returns an empty list if no contacts
    were found
    idList = []
    for entry in self.contactList:
    if entry.getId() == myId:
    idList.append(entry)
    return idList
    def search(self, searchTerm):
    This function returns a LIST
    of GmailContacts whose name or
    email address matches the 'searchTerm'.
    Returns an empty list if no matches
    were found.
    searchResults = []
    for entry in self.contactList:
    p = re.compile(searchTerm, re.IGNORECASE)
    if p.search(entry.getName()) or p.search(entry.getEmail()):
    searchResults.append(entry)
    return searchResults
    class GmailSearchResult:
    def __init__(self, account, search, threadsInfo):
    `threadsInfo` -- As returned from Gmail but unbunched.
    #print "\nthreadsInfo\n",threadsInfo
    try:
    if not type(threadsInfo[0]) is types.ListType:
    threadsInfo = [threadsInfo]
    except IndexError:
    print "No messages found"
    self._account = account
    self.search = search # TODO: Turn into object + format nicely.
    self._threads = []
    for thread in threadsInfo:
    self._threads.append(GmailThread(self, thread[0]))
    def __iter__(self):
    return iter(self._threads)
    def __len__(self):
    return len(self._threads)
    def __getitem__(self,key):
    return self._threads.__getitem__(key)
    class GmailSessionState:
    def __init__(self, account = None, filename = ""):
    if account:
    self.state = (account.name, account._cookieJar)
    elif filename:
    self.state = load(open(filename, "rb"))
    else:
    raise ValueError("GmailSessionState must be instantiated with " \
    "either GmailAccount object or filename.")
    def save(self, filename):
    dump(self.state, open(filename, "wb"), -1)
    class _LabelHandlerMixin(object):
    Note: Because a message id can be used as a thread id this works for
    messages as well as threads.
    def __init__(self):
    self._labels = None
    def _makeLabelList(self, labelList):
    self._labels = labelList
    def addLabel(self, labelName):
    # Note: It appears this also automatically creates new labels.
    result = self._account._doThreadAction(U_ADDCATEGORY_ACTION+labelName,
    self)
    if not self._labels:
    self._makeLabelList([])
    # TODO: Caching this seems a little dangerous; suppress duplicates maybe?
    self._labels.append(labelName)
    return result
    def removeLabel(self, labelName):
    # TODO: Check label is already attached?
    # Note: An error is not generated if the label is not already attached.
    result = \
    self._account._doThreadAction(U_REMOVECATEGORY_ACTION+labelName,
    self)
    removeLabel = True
    try:
    self._labels.remove(labelName)
    except:
    removeLabel = False
    pass
    # If we don't check both, we might end up in some weird inconsistent state
    return result and removeLabel
    def getLabels(self):
    return self._labels
    class GmailThread(_LabelHandlerMixin):
    Note: As far as I can tell, the "canonical" thread id is always the same
    as the id of the last message in the thread. But it appears that
    the id of any message in the thread can be used to retrieve
    the thread information.
    def __init__(self, parent, threadsInfo):
    _LabelHandlerMixin.__init__(self)
    # TODO Handle this better?
    self._parent = parent
    self._account = self._parent._account
    self.id = threadsInfo[T_THREADID] # TODO: Change when canonical updated?
    self.subject = threadsInfo[T_SUBJECT_HTML]
    self.snippet = threadsInfo[T_SNIPPET_HTML]
    #self.extraSummary = threadInfo[T_EXTRA_SNIPPET] #TODO: What is this?
    # TODO: Store other info?
    # Extract number of messages in thread/conversation.
    self._authors = threadsInfo[T_AUTHORS_HTML]
    self.info = threadsInfo
    try:
    # TODO: Find out if this information can be found another way...
    # (Without another page request.)
    self._length = int(re.search("\((\d+?)\)\Z",
    self._authors).group(1))
    except AttributeError,info:
    # If there's no message count then the thread only has one message.
    self._length = 1
    # TODO: Store information known about the last message (e.g. id)?
    self._messages = []
    # Populate labels
    self._makeLabelList(threadsInfo[T_CATEGORIES])
    def __getattr__(self, name):
    Dynamically dispatch some interesting thread properties.
    attrs = { 'unread': T_UNREAD,
    'star': T_STAR,
    'date': T_DATE_HTML,
    'authors': T_AUTHORS_HTML,
    'flags': T_FLAGS,
    'subject': T_SUBJECT_HTML,
    'snippet': T_SNIPPET_HTML,
    'categories': T_CATEGORIES,
    'attach': T_ATTACH_HTML,
    'matching_msgid': T_MATCHING_MSGID,
    'extra_snippet': T_EXTRA_SNIPPET }
    if name in attrs:
    return self.info[ attrs[name] ];
    raise AttributeError("no attribute %s" % name)
    def __len__(self):
    return self._length
    def __iter__(self):
    if not self._messages:
    self._messages = self._getMessages(self)
    return iter(self._messages)
    def __getitem__(self, key):
    if not self._messages:
    self._messages = self._getMessages(self)
    try:
    result = self._messages.__getitem__(key)
    except IndexError:
    result = []
    return result
    def _getMessages(self, thread):
    # TODO: Do this better.
    # TODO: Specify the query folder using our specific search?
    items = self._account._parseSearchResult(U_QUERY_SEARCH,
    view = U_CONVERSATION_VIEW,
    th = thread.id,
    q = "in:anywhere")
    result = []
    # TODO: Handle this better?
    # Note: This handles both draft & non-draft messages in a thread...
    for key, isDraft in [(D_MSGINFO, False), (D_DRAFTINFO, True)]:
    try:
    msgsInfo = items[key]
    except KeyError:
    # No messages of this type (e.g. draft or non-draft)
    continue
    else:
    # TODO: Handle special case of only 1 message in thread better?
    if type(msgsInfo[0]) != types.ListType:
    msgsInfo = [msgsInfo]
    for msg in msgsInfo:
    result += [GmailMessage(thread, msg, isDraft = isDraft)]
    return result
    class GmailMessageStub(_LabelHandlerMixin):
    Intended to be used where not all message information is known/required.
    NOTE: This may go away.
    # TODO: Provide way to convert this to a full `GmailMessage` instance
    # or allow `GmailMessage` to be created without all info?
    def __init__(self, id = None, _account = None):
    _LabelHandlerMixin.__init__(self)
    self.id = id
    self._account = _account
    class GmailMessage(object):
    def __init__(self, parent, msgData, isDraft = False):
    Note: `msgData` can be from either D_MSGINFO or D_DRAFTINFO.
    # TODO: Automatically detect if it's a draft or not?
    # TODO Handle this better?
    self._parent = parent
    self._account = self._parent._account
    self.author = msgData[MI_AUTHORFIRSTNAME]
    self.id = msgData[MI_MSGID]
    self.number = msgData[MI_NUM]
    self.subject = msgData[MI_SUBJECT]
    self.to = msgData[MI_TO]
    self.cc = msgData[MI_CC]
    self.bcc = msgData[MI_BCC]
    self.sender = msgData[MI_AUTHOREMAIL]
    self.attachments = [GmailAttachment(self, attachmentInfo)
    for attachmentInfo in msgData[MI_ATTACHINFO]]
    # TODO: Populate additional fields & cache...(?)
    # TODO: Handle body differently if it's from a draft?
    self.isDraft = isDraft
    self._source = None
    def _getSource(self):
    if not self._source:
    # TODO: Do this more nicely...?
    # TODO: Strip initial white space & fix up last line ending
    # to make it legal as per RFC?
    self._source = self._account.getRawMessage(self.id)
    return self._source
    source = property(_getSource, doc = "")
    class GmailAttachment:
    def __init__(self, parent, attachmentInfo):
    # TODO Handle this better?
    self._parent = parent
    self._account = self._parent._account
    self.id = attachmentInfo[A_ID]
    self.filename = attachmentInfo[A_FILENAME]
    self.mimetype = attachmentInfo[A_MIMETYPE]
    self.filesize = attachmentInfo[A_FILESIZE]
    self._content = None
    def _getContent(self):
    if not self._content:
    # TODO: Do this a more nicely...?
    self._content = self._account._retrievePage(
    _buildURL(view=U_ATTACHMENT_VIEW, disp="attd",
    attid=self.id, th=self._parent._parent.id))
    return self._content
    content = property(_getContent, doc = "")
    def _getFullId(self):
    Returns the "full path"/"full id" of the attachment. (Used
    to refer to the file when forwarding.)
    The id is of the form: "<thread_id>_<msg_id>_<attachment_id>"
    return "%s_%s_%s" % (self._parent._parent.id,
    self._parent.id,
    self.id)
    _fullId = property(_getFullId, doc = "")
    class GmailComposedMessage:
    def __init__(self, to, subject, body, cc = None, bcc = None,
    filenames = None, files = None):
    `filenames` - list of the file paths of the files to attach.
    `files` - list of objects implementing sub-set of
    `email.Message.Message` interface (`get_filename`,
    `get_content_type`, `get_payload`). This is to
    allow use of payloads from Message instances.
    TODO: Change this to be simpler class we define ourselves?
    self.to = to
    self.subject = subject
    self.body = body
    self.cc = cc
    self.bcc = bcc
    self.filenames = filenames
    self.files = files
    if __name__ == "__main__":
    import sys
    from getpass import getpass
    try:
    name = sys.argv[1]
    except IndexError:
    name = raw_input("Gmail account name: ")
    pw = getpass("Password: ")
    domain = raw_input("Domain? [leave blank for Gmail]: ")
    ga = GmailAccount(name, pw, domain=domain)
    print "\nPlease wait, logging in..."
    try:
    ga.login()
    except GmailLoginFailure,e:
    print "\nLogin failed. (%s)" % e.message
    else:
    print "Login successful.\n"
    # TODO: Use properties instead?
    quotaInfo = ga.getQuotaInfo()
    quotaMbUsed = quotaInfo[QU_SPACEUSED]
    quotaMbTotal = quotaInfo[QU_QUOTA]
    quotaPercent = quotaInfo[QU_PERCENT]
    print "%s of %s used. (%s)\n" % (quotaMbUsed, quotaMbTotal, quotaPercent)
    searches = STANDARD_FOLDERS + ga.getLabelNames()
    name = None
    while 1:
    try:
    print "Select folder or label to list: (Ctrl-C to exit)"
    for optionId, optionName in enumerate(searches):
    print " %d. %s" % (optionId, optionName)
    while not name:
    try:
    name = searches[int(raw_input("Choice: "))]
    except ValueError,info:
    print info
    name = None
    if name in STANDARD_FOLDERS:
    result = ga.getMessagesByFolder(name, True)
    else:
    result = ga.getMessagesByLabel(name, True)
    if not len(result):
    print "No threads found in `%s`." % name
    break
    name = None
    tot = len(result)
    i = 0
    for thread in result:
    print "%s messages in thread" % len(thread)
    print thread.id, len(thread), thread.subject
    for msg in thread:
    print "\n ", msg.id, msg.number, msg.author,msg.subject
    # Just as an example of other usefull things
    #print " ", msg.cc, msg.bcc,msg.sender
    i += 1
    print
    print "number of threads:",tot
    print "number of messages:",i
    except KeyboardInterrupt:
    break
    print "\n\nDone."
    Last edited by Reasons (2008-03-20 01:18:27)

    Thought it might help to give lines 369-relevant of the libgmail so it's easier to read
    def _retrievePage(self, urlOrRequest):
    if self.opener is None:
    raise "Cannot find urlopener"
    if not isinstance(urlOrRequest, urllib2.Request):
    req = urllib2.Request(urlOrRequest)
    else:
    req = urlOrRequest
    self._cookieJar.setCookies(req)
    req.add_header('User-Agent',
    'Mozilla/5.0 (Compatible; libgmail-python)')
    try:
    resp = self.opener.open(req)
    except urllib2.HTTPError,info:
    print info
    return None
    pageData = resp.read()
    # Extract cookies here
    self._cookieJar.extractCookies(resp.headers)
    # TODO: Enable logging of page data for debugging purposes?
    return pageData
    def _parsePage(self, urlOrRequest):
    Retrieve & then parse the requested page content.
    items = _parsePage(self._retrievePage(urlOrRequest))
    # Automatically cache some things like quota usage.
    # TODO: Cache more?
    # TODO: Expire cached values?
    # TODO: Do this better.
    try:
    self._cachedQuotaInfo = items[D_QUOTA]
    except KeyError:
    pass
    #pprint.pprint(items)
    try:
    self._cachedLabelNames = [category[CT_NAME] for category in items[D_CATEGORIES][0]]
    except KeyError:
    pass
    return items
    def _parseSearchResult(self, searchType, start = 0, **kwargs):
    params = {U_SEARCH: searchType,
    U_START: start,
    U_VIEW: U_THREADLIST_VIEW,
    params.update(kwargs)
    return self._parsePage(_buildURL(**params))

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

  • Obmocmenu: Music on Console (moc) pipe menu for Openbox

    Sourceforge Project Page
    AUR Package
    Screenshot
    This is a simple menu for controlling the music player moc. I use moc version 2.5.0-alpha4 (found in the AUR) which has quite a few more features than 2.4.4 in [extra]. Still, this script should work fine with the moc in the official repos.
    You may also be interested in obdevicemenu: Udisks pipe menu for Openbox.
    Let me know if there are any bugs, or any additions or improvements you'd like to see.
    Last edited by jnguyen (2011-03-10 15:31:57)

    0.8.4 released, with the ability to add a random album/directory/song to the playlist, a feature which moc itself is missing. If zenity is installed, a dialog box pops up that allows you to add the specified number of random entries (e.g. 3 random albums). See the configuration file for details.

  • 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!

Maybe you are looking for

  • What is the difference between non-blocking and 1:1 oversubscribed?

    Could someone tell me what the difference is between a non-blocked port and one with 1:1 oversubscription?

  • Pages vs PDF: Colors look different in the print out

    I'm currently creating some templates for letters in pages and I encountered irregularities when printing directly from pages versus printing the PDF from Acrobat. This is the workflow: I created the Logo in Adobe Illustrator CS4 using CMYK color def

  • Stopwatch Font too thin!

    Is it possible to change the font for the stopwatch spp for the ipohone in I OS 7. I have changed the phone to bold, and it does not effect the stopwatch application. The lap counter is currently presented in a thin grey font, that is almost impossib

  • Mini Sound Output

    I have a Mac Mini and I have hooked up the sound output to my JVC Home Theatre systems so I can play iTunes through it. The problem is that the sound level is very low even with all the outputs turned up to max. I need to have the JVC up to near max

  • Flex Peripheral Device Support

    I'm trying to decide whether Flex is the right tool for me on a new development project I'm thinking about. I have a couple of requirements that I'm not sure if Flex will be able to meet. It's also possible that a combination of technologies with Fle