Openbox TwinView behaviour like xmonad

Hey all
I was looking for a way to improve my experience with my second monitor that I recently aquired, and I stumbled upon this article that explains how xmonad handles multiple monitors. My question is rather simple, can I get this behaviour in Openbox too? If so how?
Each additional monitor allows another workspace to be visible
Each monitor displays one workspace at a time (ex: monitor 1 currently showing workspace 3 and monitor 2 currently showing workspace 1)
When the workspace on one monitor changes the workspace on the other monitor does not need to change
When removing a monitor, one less workspace will be displayed
Last edited by robrene (2010-01-31 16:48:29)

It's not unique to xmonad: scrotwm does it too -- if you apply my cumulative patch from message #170 here http://bbs.archlinux.org/viewtopic.php?id=64645&p=7
(use patch --ignore-whitespace)
Last edited by Aedit (2010-02-01 00:50:42)

Similar Messages

  • Looking for wmii-like xmonad config

    Hi everyone.
    I've been using wmii for 1-2 weeks and I feel right at home. The only thing I configured was to change the mod-key from Mod1 to Mod4. It manages windows well in a way that seems natural to me. However, it's limited. I can't resize clients with the keyboard.
    I can do that in xmonad! Plus, I'm slowly learning Haskell, and configuring through understanding the short source code of the WM seems ideal.
    I want to try xmonad. I don't have the courage to understand everything before having a comfortable environment, and I don't want to spend time in an uncomfortable environment in the hope that I will improve it in the future. So I'm asking your help for a jumpstart.
    Please, I'd like a config that manages my windows like this:
    * The clients do not move around from one column to another unless I tell them explicitly. They do not move or resize upon getting focus.
    * I can move focus between clients with Mod4+h,j,k,l
    * I can resize clients with something like Shift-Mod4+h,j,k,l
    That's all I need to get comfortable. Does anyone have this at hand? Otherwise I'll stay with wmii and slowly RTFHaskellM.

    Windows don't normally resize when you focus them
    The docs are pretty good; if you follow the examples, nothing goes wrong, and if you have an idea of what is going on, you can make quite flexible, and safe changes.
    I use something like this, (except the mosaicAlt layout) with a couple more extensions (submap, prompts, windowNavigation...) and keybindings added on.
    import XMonad
    import XMonad.Hooks.DynamicLog
    import XMonad.Hooks.UrgencyHook
    import XMonad.Hooks.ManageDocks
    import XMonad.Layout.ResizableTile
    import XMonad.Layout.NoBorders
    import XMonad.Util.EZConfig
    import XMonad.Util.Run
    import System.IO (hPutStrLn)
    main = do
    xmobar <- spawnPipe "xmobar"
    xmonad $ withUrgencyHook NoUrgencyHook $ defaults xmobar
    defaults xmobar = defaultConfig
    { modMask = mod4Mask
    , layoutHook = smartBorders $ avoidStruts $ ResizableTall 1 (3/100) (1/2) [] ||| Full
    , logHook = dynamicLogWithPP defaultPP
    { ppCurrent = xmobarColor "white" ""
    , ppOutput = hPutStrLn xmobar
    , ppTitle = xmobarColor "orange" "" . shorten 110
    , ppVisible = wrap "(" ")"
    , ppUrgent = xmobarColor "green" "" . wrap "^" ""
    , ppLayout = xmobarColor "green" ""
    `additionalKeysP`
    [("M-h", sendMessage MirrorShrink)
    ,("M-l", sendMessage MirrorExpand)
    ,("M-b", sendMessage ToggleStruts)
    And no nasty piping via shell script to the status bar! Yay haskell.
    So it appears that xmonad is succeeding at increasing the use of haskell.
    PS: you need xmobar (since that is easiest to set up).
    ~/.xmobarrc:
    Config { font = "-*-profont-*-*-*-*-11-*-*-*-*-*-*-*"
    , bgColor = "black"
    , fgColor = "grey"
    , position = Top
    , commands = [ Run Weather "CYYZ" ["-L","18","-H","27","--normal","green","--high","red","--low","lightblue"] 36000
    , Run Network "wlan0" ["-L","0","-H","32","--normal","green","--high","red"] 10
    , Run Network "eth0" ["-L","0","-H","32","--normal","green","--high","red"] 10
    , Run Cpu ["-L","3","-H","50","--normal","green","--high","red"] 10
    , Run Memory ["-t","Mem: <usedratio>%"] 10
    , Run Battery ["-L","50","-H","75","--high","green","--normal","yellow", "--low", "red"] 10
    , Run Swap [] 10
    , Run Com "uname" ["-s","-r"] "" 36000
    , Run Date "%a %b %_d %Y * %H:%M:%S" "mydate" 10
    , Run PipeReader "/home/adamvo/.xmonad.log" "xlog"
    , Run StdinReader
    , sepChar = "%"
    , alignSep = "}{"
    , template = " %StdinReader% }{ %cpu% | %memory% - %swap% | %eth0% - %wlan0% | <fc=orange>%mydate%</fc> | %battery% "
    edit: import System.IO will bring hPutStrLn into scope. Odd, since it did work for me without it.
    Last edited by vogt (2008-06-12 21:17:17)

  • Make openbox fonts look like the ones in XFCE/GNOME

    Recently I did (once again) a li'l bit of DE shuffling, and I've discovered that fonts look nicer on XFCE and GNOME compared to ones in openbox. Of course, OB doesn't tweak your font config, but leaves it "as is", but I'd really like to get the "hidden stuff" from XFCE/GNOME. Those fonts look really nice...
    Any ideas on how to do that?
    Last edited by mandalic (2011-11-04 19:48:38)

    Naah... XFCE does something odd with fonts, so I installed freetype2-infinality from AUR. It works like a charm!!!
    Last edited by mandalic (2011-11-05 13:21:42)

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

    (When I say none before I mean none that I could find. If I could find one, I wouldn't have to make this then. Anyway..)
    Hey guys, I'm here to present my project 'obtap'. It's inspired by obmenugen, a great menu generator written in D which I've used before obtap. The reason I don't use it anymore is because it wasn't as customizable as I'd of liked it to be and that's why I've made obtap.
    I've developed a small (under <150KiB, only using the C++ standard library which means you don't have to install any dependencies) Openbox menu generator that's grown to do many things:
    obtap can generate pipe menus, static menus, a dynamically updating menu (basically a menu with it's contents a pipe menu).
    obtap can easily add separators for menu layout and edit entries in such ways of renaming/merging categories, setting entry categories, renaming entries and deleting entries.
    obtap has command line options to specify menu type (pipe, static, dynamic), the configuration file and the output.
    The selling point, I'd say at least, is that obtap can (but doesn't have to) load desktop files from directories as entries, which you can then process with the above methods.
    Here's my menu:
    That's created using this configuration file:
    # Jookia's obtap configuration file.
    output(~/.config/openbox/menu.xml)
    type(openboxDynamic)
    locations(/usr/share/applications,/usr/share/applications/kde4)
    extensions(desktop)
    obeyOnlyShowIn(GNOME,KDE,XFCE)
    ignoreCategories(GTK,GNOME,Qt)
    alphabetize(true)
    customEntry(Logout;shutdown-dialog.py)
    customEntry(Reconfigure Openbox;openbox --reconfigure;Utilities)
    customEntry(Nitrogen;nitrogen;Settings)
    replaceCategoryName(AudioVideo;Multimedia)
    replaceCategoryName(Game;Games)
    replaceCategoryName(Graphics;Multimedia)
    replaceCategoryName(Utility;Utilities)
    replaceCategoryName(System;Utilities)
    replaceEntryName(GNU Image Manipulation Program;GIMP)
    deleteEntry(Root Terminal)
    deleteEntry(Open Folder with Thunar)
    menuEntry(separator;Applications)
    menuEntry(categories)
    menuEntry(separator)
    menuEntry(entry;Logout)
    Here's how to get it from the GitHub page.
    git clone git://github.com/Jookia/obtap.git
    cd obtap
    make
    bin/obtap -c goodies/example.conf
    openbox --reconfigure
    That'll create a dynamic example menu and update Openbox.
    To edit it, edit example.conf or copy it to ~/.config/obtap.conf and run obtap without the '-c goodies/example.conf'.
    You can also install it by using the PKGBUILD in the goodies folder.
    I don't have much to say. Uh.. Thanks for reading and if you do use it, I'd love to know.
    Last edited by Jookia (2010-11-07 22:35:46)

    Ok here's for the verbose result, it's pointing to "`/.config/obtap.conf" which is resulting
    XML
    <?xml version="1.0" encoding="UTF-8"?>
    <openbox_menu xmlns="http://openbox.org/3.4/menu">
    <menu id="root-menu" label="" execute=
    "/home/martin/obtap -c /home/martin/.config/obtap.conf -t openboxpipe -o -"
    />
    </openbox_menu>
    It's have an exactly same results like when you first time invoke obtap before install it to your /usr/bin
    Here's the obtap output schema
    <openbox_pipe_menu>
    <separator label="Applications"/>
    <menu id="menu-utilities" label="Utilities">
    <item label="Shutter">
    <action name="Execute">
    <command>shutter</command>
    </action>
    </item>
    <item label="Bulk Rename">
    <action name="Execute">
    <command>/usr/lib/ThunarBulkRename</command>
    </action>
    </item>
    <item label="UNetbootin">
    <action name="Execute">
    <command>su -c /usr/sbin/unetbootin</command>
    </action>
    </item>
    <item label="Cairo Composite Manager">
    <action name="Execute">
    <command>cairo-compmgr</command>
    </action>
    </item>
    <item label="SUSE Studio Imagewriter">
    <action name="Execute">
    <command>imagewriter</command>
    </action>
    </item>
    <item label="Avahi Zeroconf Browser">
    <action name="Execute">
    <command>/usr/bin/avahi-discover</command>
    </action>
    </item>
    <item label="Htop">
    <action name="Execute">
    <command>htop</command>
    </action>
    </item>
    <item label="Terminator">
    <action name="Execute">
    <command>terminator</command>
    </action>
    </item>
    <item label="GSmartControl">
    <action name="Execute">
    <command>"/usr/bin/gsmartcontrol-root"</command>
    </action>
    </item>
    <item label="GParted">
    <action name="Execute">
    <command>gksu /usr/sbin/gparted</command>
    </action>
    </item>
    <item label="gVim">
    <action name="Execute">
    <command>gvim</command>
    </action>
    </item>
    <item label="Thunar File Manager">
    <action name="Execute">
    <command>Thunar</command>
    </action>
    </item>
    <item label="CoverGloobus">
    <action name="Execute">
    <command>covergloobus</command>
    </action>
    </item>
    <item label="Squeeze">
    <action name="Execute">
    <command>squeeze</command>
    </action>
    </item>
    <item label="Disk Utility">
    <action name="Execute">
    <command>palimpsest</command>
    </action>
    </item>
    </menu>
    <menu id="menu-settings" label="Settings">
    <item label="Notifications">
    <action name="Execute">
    <command>xfce4-notifyd-config</command>
    </action>
    </item>
    <item label="Openbox Configuration Manager">
    <action name="Execute">
    <command>obconf</command>
    </action>
    </item>
    <item label="TintWizard">
    <action name="Execute">
    <command>tintwizard</command>
    </action>
    </item>
    <item label="File Manager">
    <action name="Execute">
    <command>thunar-settings</command>
    </action>
    </item>
    <item label="Removable Drives and Media">
    <action name="Execute">
    <command>/usr/lib/xfce4/thunar-volman-settings</command>
    </action>
    </item>
    <item label="Qt Config ">
    <action name="Execute">
    <command>/usr/bin/qtconfig</command>
    </action>
    </item>
    <item label="CoverGloobus Configuration">
    <action name="Execute">
    <command>covergloobus-config</command>
    </action>
    </item>
    <item label="Preferred Applications">
    <action name="Execute">
    <command>libfm-pref-apps</command>
    </action>
    </item>
    <item label="Customize Look and Feel">
    <action name="Execute">
    <command>lxappearance</command>
    </action>
    </item>
    </menu>
    <menu id="menu-network" label="Network">
    <item label="IcedTea Web Start">
    <action name="Execute">
    <command>/usr/bin/javaws</command>
    </action>
    </item>
    <item label="Avahi VNC Server Browser">
    <action name="Execute">
    <command>/usr/bin/bvnc</command>
    </action>
    </item>
    <item label="Firefox - Safe Mode">
    <action name="Execute">
    <command>firefox -safe-mode</command>
    </action>
    </item>
    <item label="Avahi SSH Server Browser">
    <action name="Execute">
    <command>/usr/bin/bssh</command>
    </action>
    </item>
    <item label="Firefox">
    <action name="Execute">
    <command>firefox</command>
    </action>
    </item>
    <item label="Midori">
    <action name="Execute">
    <command>midori</command>
    </action>
    </item>
    <item label="XChat IRC">
    <action name="Execute">
    <command>xchat</command>
    </action>
    </item>
    <item label="Pidgin Internet Messenger">
    <action name="Execute">
    <command>pidgin</command>
    </action>
    </item>
    </menu>
    <menu id="menu-development" label="Development">
    <item label="Qt Designer">
    <action name="Execute">
    <command>/usr/bin/designer</command>
    </action>
    </item>
    <item label="CMake">
    <action name="Execute">
    <command>cmake-gui</command>
    </action>
    </item>
    <item label="Qt Linguist">
    <action name="Execute">
    <command>/usr/bin/linguist</command>
    </action>
    </item>
    <item label="OpenJDK Monitoring &amp; Management Console">
    <action name="Execute">
    <command>/usr/bin/jconsole</command>
    </action>
    </item>
    <item label="Geany">
    <action name="Execute">
    <command>geany</command>
    </action>
    </item>
    <item label="Qt Assistant">
    <action name="Execute">
    <command>/usr/bin/assistant</command>
    </action>
    </item>
    <item label="OpenJDK Policy Tool">
    <action name="Execute">
    <command>/usr/bin/policytool</command>
    </action>
    </item>
    </menu>
    <menu id="menu-multimedia" label="Multimedia">
    <item label="Document Viewer">
    <action name="Execute">
    <command>evince</command>
    </action>
    </item>
    <item label="DeaDBeeF">
    <action name="Execute">
    <command>deadbeef</command>
    </action>
    </item>
    <item label="Mirage">
    <action name="Execute">
    <command>mirage</command>
    </action>
    </item>
    <item label="VLC media player">
    <action name="Execute">
    <command>vlc</command>
    </action>
    </item>
    <item label="GIMP">
    <action name="Execute">
    <command>gimp-2.6</command>
    </action>
    </item>
    </menu>
    <menu id="menu-openbox" label="Openbox">
    <item label="Reconfigure Openbox">
    <action name="Execute">
    <command>openbox --reconfigure</command>
    </action>
    </item>
    </menu>
    <separator/>
    <menu id="menu-openbox" label="Openbox">
    <item label="Reconfigure Openbox">
    <action name="Execute">
    <command>openbox --reconfigure</command>
    </action>
    </item>
    </menu>
    <item label="Logout">
    <action name="Execute">
    <command>shutdown-dialog.py</command>
    </action>
    </item>
    </openbox_pipe_menu>
    I guess the problem is "Htop" is a CLi program and normally when i want to invoke unetbootin / imagewriter, i'm using "gksu <command>" using manual menu.xml configuration.
    Hope it's help

  • [SOLVED] Strange Openbox menu behaviour

    Hi,
    so, I've searched the forums in order to find a solution for my problem, but not found anythihg that works for me. So, problem is that my openbox menu won't execute any commands that I add to ~/.config/openbox/menu.xml file. After editing that file, I run
    openbox --reconfigure
    command (no any error messages), but again, it simply won't execute the command that I've written. I have also changed permissions, so that I have read/write access. But, strange is that if I delete menus in menu.xml that I don't need, save those changes, and run reconfigure command, those menus are not any more in openbox menu, just as it should be.
    It seems that only commands that I want to execute will not work. I' ve also installed obmenu and tried editing stuff there, but again the same problem-deleting menus works fine, but executing commands not. It is obviously that problem is not in obmenu, but in menu.xml file or somewhere else, but I don't know
    where.
    So, any ideas? Did someone experienced the same problem and found a solution? All ideas are welcome
    Last edited by brunux (2010-05-09 16:32:54)

    In my menu.xml all the programs are surrounded by <command></command> tags instead of  <execute></execute>tags.
    I've tried with your suggestion, but it doesn't work. For example, running firefox works fine with <command></command> tags, but it is the default
    part of the code, where I didn't change anything.
    <item label="Firefox">
    <action name="Execute">
    <command>firefox</command>
    <startupnotify>
    <enabled>yes</enabled>
    <wmclass>Firefox</wmclass>
    </startupnotify>
    </action>
    </item>

  • Openbox - switch desktop like in Xfce [SOLVED]

    Hey all
    I've been using Xfce for a while now and I'm trying out Openbox, everything is great exept one feature that I miss.
    In Xfce I can move the mouse outside the screen to switch virtual desktops, which I've really gotten used to do, but I haven't found a way to do this in Openbox.
    Only way to switch seems to be with the keyboard (alt+ctrl+arrows) and mouse scroller over the desktop.
    Any ideas?
    (Great job on Archlinux Been an Archer for almost a year now and I love it!)
    Last edited by Shodan (2008-08-28 15:50:59)

    Shodan wrote:
    Hey all
    I've been using Xfce for a while now and I'm trying out Openbox, everything is great exept one feature that I miss.
    In Xfce I can move the mouse outside the screen to switch virtual desktops, which I've really gotten used to do, but I haven't found a way to do this in Openbox.
    Only way to switch seems to be with the keyboard (alt+ctrl+arrows) and mouse scroller over the desktop.
    Any ideas?
    (Great job on Archlinux Been an Archer for almost a year now and I love it!)
    not possible. you can drag windows to other desktops, but not change desktops by moving mouse outside screen.
    btw: you can use brightside under openbox. it's quite light-weight. and it seems to do what you want:
    http://www.linux.com/feature/124478
    vlad
    Last edited by DonVla (2008-08-28 14:14:32)

  • Automatic file download behaviour like firefox

    When I click on a file link which is not a web page in
    firefox it automatically provides me a dialog which allows me save
    the file to the desktop but when clicking on the same link using
    the air browser it does not appear to do anything.
    Does the air browser support this behaviour by default?, if
    not any ideas what the best way to achieve this might be?
    Cheers
    Tony

    RunDownload :: Add-ons for Firefox -- https://addons.mozilla.org/en-US/firefox/addon/10329/

  • Simulating visual behaviour of buttons on button bar, like Firefox.

    I want to introduce visual behaviour like the Firefox button bar, where the buttons display with no background and no border, until you mouse over them.
    I have a panel that I use to display a button bar. The buttons on the button bar are instances of JButton.
    I can use jButton.setBorderPainted(false) and jButton.setBorder(null) to turn off the button frame.
    However, when using a look and feel, set by UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()), then the borders always paint.
    How can I turn off the borders and background for these buttons?

    On windows xp platform
    use JToolBar instead of panel, look at the code below and try to run it on windows xp platform
    import javax.swing.UIManager;
    public class NewJFrame extends javax.swing.JFrame
        public NewJFrame()
            initComponents();   
        /** This method is called from within the constructor to
         * initialize the form.
         * WARNING: Do NOT modify this code. The content of this method is
         * always regenerated by the Form Editor.
        @SuppressWarnings("unchecked")
        // <editor-fold defaultstate="collapsed" desc="Generated Code">
        private void initComponents() {
            jPopupMenu1 = new javax.swing.JPopupMenu();
            jMenuItem1 = new javax.swing.JMenuItem();
            jToolBar1 = new javax.swing.JToolBar();
            jButton1 = new javax.swing.JButton();
            jButton2 = new javax.swing.JButton();
            jButton3 = new javax.swing.JButton();
            jMenuItem1.setText("Item");
            jPopupMenu1.add(jMenuItem1);
            setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
            jToolBar1.setRollover(true);
            jButton1.setText("jButton1");
            jButton1.setFocusable(false);
            jButton1.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
            jButton1.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
            jToolBar1.add(jButton1);
            jButton2.setText("jButton2");
            jButton2.setFocusable(false);
            jButton2.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
            jButton2.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
            jToolBar1.add(jButton2);
            jButton3.setText("jButton3");
            jButton3.setFocusable(false);
            jButton3.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
            jButton3.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
            jToolBar1.add(jButton3);
            getContentPane().add(jToolBar1, java.awt.BorderLayout.NORTH);
            pack();
        }// </editor-fold>
        * @param args the command line arguments
        public static void main(String args[]) {
            try
                UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
            catch(Exception e)
            java.awt.EventQueue.invokeLater(new Runnable() {
                public void run() {
                    new NewJFrame().setVisible(true);
        // Variables declaration - do not modify
        private javax.swing.JButton jButton1;
        private javax.swing.JButton jButton2;
        private javax.swing.JButton jButton3;
        private javax.swing.JMenuItem jMenuItem1;
        private javax.swing.JPopupMenu jPopupMenu1;
        private javax.swing.JToolBar jToolBar1;
        // End of variables declaration
    }

  • How do I setup my system to look like the other Arch user's?

    I just finished installing Arch on my EeePC 100HA and I'm looking how to setup my system like other users have in their screenshots located here: http://bbs.archlinux.org/viewtopic.php?id=75154 . This one in particular: http://fc09.deviantart.com/fs45/f/2009/ … _haxit.png
    I see that he's using some type of window manager like xmonad or openbox, but I can't really tell. He has links to all of his configuration files but I don't know where to paste them on my system. When I look at those config files, I get scared to even attempt this, but I really want a system as slick as that one, or like any of the amazing customized Arch systems I've seen around here.
    Last edited by jwmollman (2009-07-02 06:44:18)

    jwmollman wrote:
    I just finished installing Arch on my EeePC 100HA and I'm looking how to setup my system like other users have in their screenshots located here: http://bbs.archlinux.org/viewtopic.php?id=75154. This one in particular: http://fc09.deviantart.com/fs45/f/2009/ … _haxit.png.
    I see that he's using some type of window manager like xmonad or openbox, but I can't really tell. He has links to all of his configuration files but I don't know where to paste them on my system. When I look at those config files, I get scared to even attempt this, but I really want a system as slick as that one, or like any of the amazing customized Arch systems I've seen around here.
    Remove the period from your 2nd URL. Else it won't work.
    I see he is just using a conky and openbox[I guess] O_o

  • [BUGGED] xmonad tri-screen non-xinerama problems

    Hello All!
    New Archer here.  I'm really enjoying playing with Arch.  Ran it about a week on a VM, and then promptly backed up/tore up/re-created my 3 TB RAID array as a shrine in deciation to its glory.  I haven't posted much along the process, because I've generally been able to put things together to my liking other than a few minor setbacks that I mostly managed to handle myself.  I have even gave Arch the coveted position of my "Laptop Linux."  I have a slightly odd setup and it seems to be tied in with an issue that I am having, so I thought I might post here, especially since some of you seem to be xmonad users.
    The Paragraph
    Most wm's seem to handle non-Xinerama multi-display fine (I've been trying out as many as I could find since switching over to Arch.  I figured new Linux/new Look).  It seems that xmonad handles Xinerama better but has a less friendly non-Xinerama out of the box experience, and it is terribly hard to find the information I am after since when I go looking for multi-monitor resources, I find alot about Xinerama and praise for its Xinerama way of doing things.  Apparently, you still can't enable Composite and Xinerama at the same time, and in general, I prefer funny fade effects and what not to being able to move windows from screen to screen so have opted for a standard non-Xinerama multi-card, multi-display setup of xorg.
    Bullet Points
    1 - Minor Problem:  xmonad only runs on one screen if I don't enable Xinerama
    2 - Entertwined Problem:  Composite extension becomes disabled if I enable Xinerama
    3 - Other Entertwined Problem:  Most wm's I try if they don't support dual screen natively, I can simply put calls in my .xinitrc to load on the various display (ie. 'DISPLAY=:0.2 wmii &; DISPLAY=:0.1 wmii&; exec wmii'), and it's no big.  If I try that with xmonad, the session on DISPLAY :0.0 won't give up control of the keyboard to the displays on the other monitors.  That's pretty weird, since it gives up control to my unmanaged windows just fine, or gives up control to another WM (as I type this, I have openbox managing my second monitor so I have an easy way to resize windows and such, but that is a somewhat imperfect solution in my opinion).  If I leave the screens unmanaged , I can launch apps on them easily enough by 'DISPLAY=:0.1 thunderbird' (like I do with openbox managing them if I don't want to use the menu) through command-line or scripts, but there is no way to move the apps or resize them or anything without some WM (like openbox) attached to the DISPLAY.
    4 - Minor Entertwined Problem That Makes This Whole Mess Harder To Ignore:
    When you go off the screen to an unmanaged window or a window managed by another window manager, apparently xmonad continues to think you are focused on the app that you hovered over last on your way to the other screen (ie. if I go over to Thunderbird now, xmonad will leave the active border around Firefox since I have it on the left side of my primary monitor and the other screen is to the left).  This is no big, although I would prefer it to gray out or whatever.  At the same time, xmobar displays that I am still over my Firefox window.  I am fine with it not knowing that I am over messing around in another WM or on an unmanaged screen.  The big problem is that when I bring the mouse back, it seems to get confused about whether I left or not, and doesn't pass focus back to the app in question.  It still thinks the app has focus (according to its border and xmobar), but keystrokes still go to the other screen and the window on the first screen will no longer even directly respond to mouse clicks.  It is easy to fix, I can simply move to any other window on the same screen, and then back to my firefox and things work fine.  I know that's a weird wall of text, so a quick explanation:
    If I take my mouse off the screen to the left, passing over Firefox, I end up on my Screen 1 that is currently displaying Thunderbird and managed by Openbox.  I can then click message, type things, all no problem.  If I move my mouse back to the Firefox screen, it looks like it is active, but I cannot click on anything (no links work, the buttons that control formatting of this message darken when I hover over them but do nothing on click, the check boxes at the bottom of this compose message window darken but do not respond to clicks, etc).  If I do nothing else other than but my mouse over one of my terminal windows (which will receive the focus border and receive input fine), and then move it back to Firefox - everything in Firefox will at that point work great.
    That last note is the primary reason I can't just let another WM loose on my secondary display and go about my day (I mean, I tend to just leave e-mail up on the thing, and I suppose a valid argument can be made for having a floating manager on your second screen anyway).  It's most annoying when I just barely go off the edge of the main monitor by mistake, say on my way to a tab or something, and can't click my tabs anymore without dragging the mouse back to a terminal and back over to Firefox.  Of course, I would be fine with messing with xmonad on all my screens really if I didn't have to turn off my Composite extension to do it.
    One easy solution is to just use Awesome.  It looks nice and seems to offer some of the same features, but I kind of like xmonad's way of configuring things and the idea that my configs seemingly shouldn't break on minor version numbers.  Awesome has already bit me in my playing around by making widget obselete two days after I put the widgets in my config file, and it seems they have a history of this type of action. 
    I can happily provide any configuration files on request.  My xorg.conf is probably of the most interest, I would think, but if I knew how to fix this, I wouldn't be on here asking for help.  It doesn't appear to be related to xmonad.hs, since I can use the default or a heavily customized one and get the same behavior.  There might be a way to fix the problem somehow in xmonad.hs; I don't know.
    Oh well, sorry my first post was such a wall of text, but I wanted to provide a solid idea of what was going on here.  Any help would be greatly appreciated.
    Lewis
    Last edited by llcawthorne (2009-11-18 02:26:08)

    vogt wrote:
    I have had composite enabled with xinerama.
    Some graphics drivers restrict the size of all screens to fit within 2048x2048 pixels if you still want compositing, but if you have 3 monitors, it is unlikely that that you can find an arrangement that satisfies that driver/hardware limitation.
    Yeah, 2048x2048 woudln't work for me.  My main monitor runs 1920x1200, secondary is 1680x1050, and the tv is at 1920x1080.
    Apparently since the xorg upgrade the other day, I can't even turn on Xinerama anymore.  I know it worked when I tested just to see if things worked in Xinerama mode the other day (but it automatically disabled Composite).  Now I can turn on Xinerama but I get a strange cursor flicker and segfault when trying to go to the other screen.  Apparently some other people have that problem with the latest x-server and xinerama with Nvidia, but I haven't looked into fixing it, since I don't tend to use Xinerama anyway.  It makes testing some solutions a bit harder though not being able to temporarily turn it on.
    I have done some more testing though.  With my current multi-screen Xinerama off X-layout, things definitely work as expected in other Window managers.  I have played around in GNOME, compiz, fluxbox, openbox, awesome and ratpoison with this separate screen X-layout without problems. 
    The problem seems to be more with xmonad accepting the cursor than letting it go.  When I run :0.1 unmanaged or with another window manager, I can switch over to the other display with 100% reliability, but only have the problem when coming back to my xmonad display.  However, if I spawn xmonad to :0.1 in addition to having xmonad on :0.0, I almost always have problems switching over to :0.1, but once I get switched over to :0.1, I have trouble coming back to :0.0.
    Also, strangely enough, I can reliably switch to any other display with two windows on it.  I have taken to running a clock on display :0.1, since 90% of the time when I switch over to my e-mail client I will not get proper focus.  I can fix this 100% of the time by mousing over the clock, then back over the e-mail client.  To come back to my main screen, I will not get focus on my browser 90% of the time, but can reliably get focus to it 100% of the time there is a problem by mousing over one of the terminals to the right of my browser and then coming back to the browser.  Since the problem is predictable, I can work around it, but either way it is annoying.
    The problem is easy to duplicate with both a default xmonad.hs, another xmonad.hs pulled off the site (tried it with andrea's and arossato's, and with my personal customized and overly large xmonad.hs that I have been trying out various features with.
    Curiously enough, since it was a focus problem, I though "maybe if it updated focus more often?" and I tried 'import XMonad.Actions.UpdateFocus" with the proper startupHook's and handleEventHooks to make it attempt to update focus whenever you move the mouse within a window.  This did nothing to alleviate the problem, although it obviously took ince I noticed the change in focus handling when I didn't leave a monitor.
    Oh, and as another test to see if it might relate back to my drivers somehow, I removed nvidia's proprietary drivers and installed Nouveau.  While the Nouveau drivers are pretty neat (the fast frame buffer switching is fun!), I found them annoying since I don't know how to make my console come up on the right monitor with them, but that is unrelated.  I changed around my config and brought up X and was able to duplicate the problem exactly with the alternate drivers (but same configuration otherwise). 
    And lastly, I booted to my Gentoo install (that does use the same hardware are xorg.conf).  I can't get the 0.9 xmonad from the overlay to compile on it for whatever reason, so it conveniently has 0.8 installed.  I see the same behavior with a default config and a sample config swiped from the website (I cannot test with my custom config, since it has multiple 0.9 imports in it, but I have no reason to believe it would react differently).
    I welcome any ideas.
    Lewis Cawthorne

  • Awesome vs. Xmonad

    I've been thinking about trying a tiling window manager (I currently use Openbox) and am thinking especially about trying awesome and xmonad.
    I mostly use 5 main apps (ranked in how much I use them, 1 being the most):
    1. Urxvt
    2. Firefox
    3. Songbird
    4. Pidgin
    5. XChat
    I'm looking for it to have a lot of configurability as far as hotkeys go, I want to try and use the mouse as little as possible.
    Feel free to recommend any other WMs if you want.

    I like xmonad alot personally. 
    Sounds like you run some of the same stuff as me constantly, not that it matters.  I am sitting here with Firefox, three urxvtc terminals and thunderbird open, with pidgin and deluge sitting in my tray.
    I really like in tiling window managers being able to have my browser in its nice little 65% pane, and my three 80 char wide terminal windows on the right-hand side of the screen showing as many lines as they can with no wasted space.  I have pidgin easily set to auto float above everything when I bring it up for something, and then put it away, and it doesn't change my nice stable layout of everything else.  I can hop to other workspaces to do other things and come back to my main WS with my nice happy setup.  I can even "swap screens" with what's on my television, open something, and then swap back. 
    Plus Haskell is pretty fun to mess with really.  If you don't want to learn it, it is easy to base your config on others that are available (which is what I initially did), but I have been working through some Haskell tutorials just because it is a pretty neat language.
    Awesome can act weird when you misconfigure its file though.  So can everything else, really...  But I found that Awesome handled typo's and problems less gracefully than xmonad most of the time.  Xmonad would just chugging with your old config if you typo'd in your new config, unless you messed something up fierce.  Sometimes Awesome would check my file and say it was fine, and then just blow up when I tried to load it.  I am sure that would go away if I learned the syntax better, but I preferred xmonad's more graceful way of dealing with most of my learning mistakes.
    Awesome works though.  It's handy if you like clicking on your bar, and if you prefer configuring in lua (and fixing your config often on update, if you don't hold back the package).  It's notification daemon is a neat touch, and the customizable widgets are sort of fun to play with (after you choose which of the three libraries you want to use to manage updating them, and cross your fingers that it will still be there next release).  I didn't run it terribly long, since I missed xmonad when I tried it and decided to come back and stop trying lots of wm's.  Awesome has pretty sane defaults, I like that.  YMMV.

  • 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

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

  • Xmonad with xinerama: screen order is messed up.

    xmonad seems not to detect the order of my screens properly.
    With nvidia-settings, i have configured the second screen to be 'right of'
    my main screen. The main screen still shows the boot messages.
    However, as soon as i log in, the focus goes to the second screen.
    Also, mod-w refers to the second screen, whereas mod-e refers to the
    main screen. It seems like, xmonad just confuses them both and
    recognizes them in opposite order. The mouse however mouse as
    expected to the right screen.
    Searching the internet, i found that i can remap the keys to refer to
    my screens properly. And for sure, there is a way to configure the
    screen which has the focus on login. However i would rather like to
    understand what the problem is and fix it, then fiddeling with the
    symptoms.
    The second is connected via VGA, just in case, that makes a difference.

    MickeyKnox wrote:But if i'm getting you right, the problem is with xmonad (or rather there is nothing specified
    and xmonad just makes a for me false assumption). So i guess to proper place to fix this is
    indeed xmonad.
    The problem is not Xmonad---it solves the issue by having the "PhysicalScreens" module. The PhysicalScreens module fixes precisely the issue you're having.
    Fixing this on a "grander" scale requires modifying the X extensions themselves (Xinerama and/or RandR). It it not a bug that those extensions report the physical displays in an odd order.
    The window manager must orient the screens how it sees fit; PhysicalScreens does just that.
    MickeyKnox wrote:Another reason was that the solution in the XMonad FAQ looks kind of cryptic to me and i just
    don't like to copy and paste things i don't understand. But i guess sooner or later i have to
    emerse myself in Haskell...
    Use the xmonad-contrib API docs for an example of how to use PhysicalScreens.
    You can only get so far with configuring Xmonad without learning some Haskell. It's a huge upfront cost, I know, but you otherwise end up copying & pasting.

  • Need a pager for Openbox

    I need a simple, nice looking pager for Openbox. Something like fluxter, but that plays nice with Openbox/PyPanel.
    I've tried wampager and fluxter, but neither are what I want.
    Looking for:
    - Transparency (pseudo)
    - Size configuration
    - no window borders
    - icons in windows
    - doesn't change the workspace area
    Thanks!

    miqorz wrote:
    I use fbpanel..
    http://left-foot.org/Images/clearlooks-fun.png
    See it in action there?
    omg! are you using vim, haha (turncoat!)

Maybe you are looking for

  • Since last Update Safari randomly crashes at startup

    Hello there Since the last month or so (I guess since the last software update! But only a guess) Safari has developed the unfortunate habit of crashing every 10th-20th launch. It only happens when I start Safari – when it's running it's stable like

  • When I downloaded 4.3 i lost the sound when I record videos

    When I downloaded 4.3 I lost the sound when I record videos

  • Plant and cost center.

    Can any body tell me where i can see that a plant is mapped with cost center

  • How to create a LOG IN Account???

    Hello friends I am using Mac Client 10.3.9 and Mac Server 10.3.9 I installed client and want to create 2 accounts: 1 account will login to the server and the second will be administrator I could not create login account. Could someone show me how to

  • Transaction PZLE_01, PZLE_02 ......PZLE_05

    Hi Experts, When I execute the the transactions PZLE_01 I get screen for Who'sWho. I am confussed why this is happening. PS: To tun transaction PZLE_01. First run some other transaction, say SE24 and now run /NPZLE_01. Other issue I am facing even wh