BurntSushi / pytyle3

An updated (and much faster) version of pytyle that uses xpybutil and is compatible with Openbox Multihead.
Do What The F*ck You Want To Public License
180 stars 19 forks source link

pytyle3 exits with an IO Error while polling for events. #2

Closed inktrap closed 12 years ago

inktrap commented 12 years ago

pytyle3 exits with an IO Error on a freshly installed CrunchBang system, while calling conn.poll_for_event() from xpybutil.

joe@localhost ~/pytyle3 [n] % pytyle3        
Openbox window manager is running...
Traceback (most recent call last):
  File "/usr/local/bin/pytyle3", line 25, in <module>
    event.main()
  File "/usr/local/lib/python2.6/dist-packages/xpybutil/event.py", line 128, in main
    read(block=True)
  File "/usr/local/lib/python2.6/dist-packages/xpybutil/event.py", line 118, in read
    e = conn.poll_for_event()
IOError: I/O error on X server connection.
BurntSushi commented 12 years ago

What version of xpyb are you running? It should be using the latest from the xpyb git repository: http://cgit.freedesktop.org/xcb/xpyb/

inktrap commented 12 years ago

I used the version of my distro (1.2-2). I had trouble installing from cgit.freedesktop.org (1.3.1) and I'll close this issue if the newest version is fine. Thank you for the quick reply and - by the way - I looove pytyle2 with openbox (switched from scrotwm) and can't wait to use pytyle3!

BurntSushi commented 12 years ago

Ah, okay. I'm not used to Debian, but I take it this is the package you're using?

I had trouble installing from cgit.freedesktop.org (1.3.1)

Yeah, it can be a bit tricky. My first suggestion is to look and see if their is a package that builds a more recent version, or checks out the source from the git repo and builds it from source. Failing that, my PKGBUILD in the AUR might help. I know it's for Archlinux, but it should lead you in the right direction:

git clone git://anongit.freedesktop.org/xcb/xpyb.git
cd xpyb
export PYTHON=/usr/bin/python2
./autogen.sh --prefix=/usr
make
make install

Note that the export PYTHON ... line is needed if your default Python installation is version 3 or higher (i.e., check the version of /usr/bin/python.) Also, you should uninstall the xpyb package first.

You'll also need to make sure that libxcb and xcb-proto are installed for this to work. There may be another Xorg package you need (that has tools required for building with their autogen stuff), but I can't remember which one it is. Oh, it might be 'xorg-util-macros'. Yes, I think that's it.

If you get any errors, I'd be happy to try and work with you on it. You can post them here. I think information on how to build xpyb from source is valuable, particularly for people with Linux distributions that aren't on the bleeding edge.

I'll close this issue if the newest version is fine.

I am pretty sure that the version you have is totally broken (it's years out of date). I'm actually surprised that it worked with pytyle2.

Thank you for the quick reply and - by the way - I looove pytyle2 with openbox (switched from scrotwm) and can't wait to use pytyle3!

No problem. You may actually want to stay with pytyle2. pytyle3 is a bit of a regression in terms of features, but it is also a bit faster and easier on memory usage. I've written a little bit about the differences between versions of pytyle on my homepage. (Scroll a little bit to see pytyle3.) You should also look at pytyle3's default config file; there isn't much there! So if you see something missing that you don't want to be without, pytyle2 would probably serve you better.

Also, if you have multiple heads and you aren't using Openbox Multihead, you cannot use pytyle3. If you just have a single monitor, don't worry about it.

inktrap commented 12 years ago

Ah, okay. I'm not used to Debian, but I take it this is the package you're using?

Yes, you are right. I decided to move from stable to unstable (in crunchbang terms this means moving from statler to waldorf), mainly because I thought it would be fun to send in bug reports ;); beside this i am able to install the much newer xpyb 1.3.1-1 (I really appreciate your offer for help and support for building from source - I am sure other people are glad you posted it) and to come to an end: xpybutils and pytyle3 are working flawlessly. Currently I haven't found a "missing" feature in pytyle3 that i was used from pytyle2. Coming from scrotwm I miss a feature, called stacked mode (I believe it is not in pytyle2 or 3), it is not listed in the keybind.py of pytyle3:

import state
import tile

bindings = {
    'Mod1-a':       tile.cmd('tile'),
    'Mod1-u':       tile.cmd('untile'),
    'Mod1-h':       tile.cmd('decrease_master'),
    'Mod1-l':       tile.cmd('increase_master'),
    'Mod1-j':       tile.cmd('prev_client'),
    'Mod1-k':       tile.cmd('next_client'),
    'Mod1-Shift-j': tile.cmd('switch_prev_client'),
    'Mod1-Shift-k': tile.cmd('switch_next_client'),
    'Mod1-comma':   tile.cmd('remove_master'),
    'Mod1-period':  tile.cmd('add_master'),
    'Mod1-Return':  tile.cmd('make_master'),
    'Mod1-m':       tile.cmd('focus_master'),
    'Mod1-z':       tile.cmd('cycle'),

    'Mod1-q':       tile.debug_state,
    'Mod1-Shift-q': state.quit,
}

Again, good job and thanks for your reply!

BurntSushi commented 12 years ago

Ah, well I'm glad you have everything working and doubly glad that you don't miss anything from pytyle2 :-)

With regard to stacking... pytyle1 has something like this called cascade. However, even something like that just doesn't work well because pytyle isn't a window manager---it has to work with (and fight against) the currently running window manager.

Unfortunately, this makes something like stacking (which is more involved than a simple cascade layout) nearly hopeless outside of the window manager. It might be possible, but it would be an endeavor into masochism :-)

With that said, if you have any feature requests, please post them! I might be able to get to them this summer.