You are not logged in.

#26 2010-12-08 22:18:41

BurntSushi
Member
From: Massachusetts
Registered: 2009-06-28
Posts: 362
Website

Re: PyTyle 2: On-demand automatic/manual tiling for EWMH compliant WM's

I don't think that error is related to the keybindings failing--the error, I think, stems from not being able to attach a proper monitor to a window (which may in turn stem from not being able to find a valid desktop).

The reason why I say this is that the wmctrl -lG output shows some windows that are on all desktops... While PyTyle 2 skips panels and other such windows, if a regular window is on all desktops, pytyle will probably crash. (Mostly because I don't think I've really added support for windows on all desktops.)

Once my semester is over (this week), I'll have to do some testing with other windows (like guake, conky, etc.)... I think that's where some of the problems are stemming from.


Education is favorable to liberty. Freedom can exist only in a society of knowledge. Without learning, men are incapable of knowing their rights, and where learning is confined to a few people, liberty can be neither equal nor universal.

Tu ne cede malis sed contra audentior ito

Offline

#27 2010-12-09 03:06:47

Julius2
Member
From: Canada
Registered: 2009-05-13
Posts: 68
Website

Re: PyTyle 2: On-demand automatic/manual tiling for EWMH compliant WM's

I've created a wiki page: here. I've basically ripped out the guts of what BurntSushi has said in this thread, but I'd like someone who actually knows about and uses PyTyle to correct any mistakes and to expand on what has been said -- any additions (e.g. troubleshooting, common options) would be welcome.


Blog .:. AUR .:. Wiki Contributions
Registered Linux User #506070.

Offline

#28 2010-12-09 05:03:53

singral
Member
Registered: 2009-09-21
Posts: 27

Re: PyTyle 2: On-demand automatic/manual tiling for EWMH compliant WM's

ngoonee wrote:

Did you kill pytyle before running pytyle2? The error indicates that some other app has already bound those keys (may be pytyle, may be your DE).

Yes, i killed it. even replaced pytyle to pytyle2 in autostart.sh(openbox) and restarted X
Orginal pytyle worked okey with those key bindings(i changed the alt to mod4)

Turned off guake - same
turned off conky - same

Offline

#29 2010-12-09 12:12:07

Howitzer
Member
From: Belgium (Antwerp)
Registered: 2006-09-29
Posts: 43
Website

Re: PyTyle 2: On-demand automatic/manual tiling for EWMH compliant WM's

Wow. I'm so happy I found this.

It's exactly what I need, a simple tiling wm that runs only on the desktops you want it to run.

Very simple, very nice, no bugs found after a full day of usage.

Thanks!

Offline

#30 2010-12-31 02:23:10

hellbuster
Member
From: Chile
Registered: 2010-05-18
Posts: 23

Re: PyTyle 2: On-demand automatic/manual tiling for EWMH compliant WM's

Nice work.

I'm using Gnome with Openbox and I noted 2 things:

· If you set panels to autohide, the tiling lets the panel space empty.
· The borders are drawn above the floating windows.

Last edited by hellbuster (2010-12-31 13:51:59)

Offline

#31 2011-01-03 00:14:13

cephalopoid
Member
Registered: 2009-08-05
Posts: 21

Re: PyTyle 2: On-demand automatic/manual tiling for EWMH compliant WM's

I tried PyTyle 2 and it only spewed "Could not grab key" errors at me. Any ideas on what went wrong?

Offline

#32 2011-01-03 03:11:11

BurntSushi
Member
From: Massachusetts
Registered: 2009-06-28
Posts: 362
Website

Re: PyTyle 2: On-demand automatic/manual tiling for EWMH compliant WM's

PyTyle 2 can't grab a key when another program has already grabbed the same key. You'll have to check if some other program is binding the keys that PyTyle wants to use, and change them in the PyTyle config file.


Education is favorable to liberty. Freedom can exist only in a society of knowledge. Without learning, men are incapable of knowing their rights, and where learning is confined to a few people, liberty can be neither equal nor universal.

Tu ne cede malis sed contra audentior ito

Offline

#33 2011-01-20 02:25:32

Mostly
Member
Registered: 2011-01-20
Posts: 5

Re: PyTyle 2: On-demand automatic/manual tiling for EWMH compliant WM's

Hey, how can I make it run in Ubuntu?.. because the setup.py doesn't recognize the Xpyb.. something to edit?

Offline

#34 2011-01-20 03:48:34

BurntSushi
Member
From: Massachusetts
Registered: 2009-06-28
Posts: 362
Website

Re: PyTyle 2: On-demand automatic/manual tiling for EWMH compliant WM's

You need to be a bit more specific.

PyTyle doesn't care which linux distribution you're running, only that a compatible window manager is running. It's really only been tested with Openbox and KWin.

PyTyle 2 is still in beta. If you want it to run, you'll need to install xpyb or xpyb-ng, along with XCB. Check the Ubuntu repositories.

I'd recommend checking out PyTyle 1: http://pytyle.com -- It uses the Python X Library, which is probably a bit more common.


Education is favorable to liberty. Freedom can exist only in a society of knowledge. Without learning, men are incapable of knowing their rights, and where learning is confined to a few people, liberty can be neither equal nor universal.

Tu ne cede malis sed contra audentior ito

Offline

#35 2011-01-20 22:50:25

Mostly
Member
Registered: 2011-01-20
Posts: 5

Re: PyTyle 2: On-demand automatic/manual tiling for EWMH compliant WM's

Yes, I have Openbox.. but I don't know why Pytyle doesn't recognize neither xpyb nor xpyb-ng (which were installed from source)... I will check pytyle 1..

Thank you!


edit: Well pytyle seems to work with only python-xlib installed.... maybe I have a dependencies problem for pytyle2.
Again, thank you! smile

Last edited by Mostly (2011-01-20 23:34:08)

Offline

#36 2011-01-20 23:43:27

BurntSushi
Member
From: Massachusetts
Registered: 2009-06-28
Posts: 362
Website

Re: PyTyle 2: On-demand automatic/manual tiling for EWMH compliant WM's

Well, can you post the error message? (Make sure you're using python 2!)

Also...

Open a terminal and run python. Then try:

import xcb, xcb.xproto

What happens?


Education is favorable to liberty. Freedom can exist only in a society of knowledge. Without learning, men are incapable of knowing their rights, and where learning is confined to a few people, liberty can be neither equal nor universal.

Tu ne cede malis sed contra audentior ito

Offline

#37 2011-01-21 01:17:23

Mostly
Member
Registered: 2011-01-20
Posts: 5

Re: PyTyle 2: On-demand automatic/manual tiling for EWMH compliant WM's

PyTyle 2 requires the X Python Binding
See: http://cgit.freedesktop.org/xcb/xpyb/
Or xpyb-ng can be used. See https://github.com/dequis/xpyb-ng

And when I try to import xcb.xproto:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/pymodules/python2.6/xcb/xproto.py", line 11, in <module>
    class CHAR2B(xcb.Struct):
AttributeError: 'module' object has no attribute 'Struct'

There's the problem, maybe you know how to solve it.. smile

Offline

#38 2011-01-23 20:18:24

el mariachi
Member
Registered: 2007-11-30
Posts: 595

Re: PyTyle 2: On-demand automatic/manual tiling for EWMH compliant WM's

doesn't work in pekwm, maybe due to conflicting keys (Alt+a is used in pekwm) I'll try changing some keys and give it another try.
it's a great concept, good job big_smile

Offline

#39 2011-05-06 19:58:15

Cloudef
Member
Registered: 2010-10-12
Posts: 636

Re: PyTyle 2: On-demand automatic/manual tiling for EWMH compliant WM's

Anybody having some memory leaks with this? It does wonders for my dual monitor setup, but memory leaks cause problems in the end.

Offline

#40 2011-05-06 20:05:31

BurntSushi
Member
From: Massachusetts
Registered: 2009-06-28
Posts: 362
Website

Re: PyTyle 2: On-demand automatic/manual tiling for EWMH compliant WM's

Cloudef wrote:

Anybody having some memory leaks with this? It does wonders for my dual monitor setup, but memory leaks cause problems in the end.

Yeah, it is not too great on memory at the moment. Unfortunately, I don't know when I'll be able to get around to fixing it.

You may find the original 'pytyle' just as helpful and more stable.


Education is favorable to liberty. Freedom can exist only in a society of knowledge. Without learning, men are incapable of knowing their rights, and where learning is confined to a few people, liberty can be neither equal nor universal.

Tu ne cede malis sed contra audentior ito

Offline

#41 2011-05-06 20:09:12

Cloudef
Member
Registered: 2010-10-12
Posts: 636

Re: PyTyle 2: On-demand automatic/manual tiling for EWMH compliant WM's

Yeah, I have the original too.
However I don't see anything on config about multiple monitors? I can manage with both tiling. But would be nice for only other one to tile. if not, maybe I can take time to look at the sources.

Last edited by Cloudef (2011-05-06 20:09:44)

Offline

#42 2011-05-06 20:50:03

BurntSushi
Member
From: Massachusetts
Registered: 2009-06-28
Posts: 362
Website

Re: PyTyle 2: On-demand automatic/manual tiling for EWMH compliant WM's

Cloudef wrote:

Yeah, I have the original too.
However I don't see anything on config about multiple monitors? I can manage with both tiling. But would be nice for only other one to tile. if not, maybe I can take time to look at the sources.

You should be able to disable tiling on one screen and not the other. Or any way you like.

pytyle configuration docs.

Let me know if you can't get it working; I am quite confident that pytyle 1 will play nicely with multiple screens. That was mostly why I built it in the first place :-)


Education is favorable to liberty. Freedom can exist only in a society of knowledge. Without learning, men are incapable of knowing their rights, and where learning is confined to a few people, liberty can be neither equal nor universal.

Tu ne cede malis sed contra audentior ito

Offline

#43 2011-05-06 21:53:47

Cloudef
Member
Registered: 2010-10-12
Posts: 636

Re: PyTyle 2: On-demand automatic/manual tiling for EWMH compliant WM's

Oh that's just perfect, seemed like I thought screen and workspace as same.

Offline

#44 2011-07-29 10:19:23

GSF1200S
Member
Registered: 2008-12-24
Posts: 474

Re: PyTyle 2: On-demand automatic/manual tiling for EWMH compliant WM's

I cant get pytyle2 to run, though pytyle 1 works fine (slowish as it uses xlib- would love to try the new and improved). Whenever I try to run pytyle2, it complains that it cant grab my keys. I replaced all the Alt keybindings with Ctrl, and then it doesnt complain. However, it still wont work giving me the following python error:

[poeticrpm@geekdom ~]$ pytyle2
Traceback (most recent call last):
  File "/usr/bin/pytyle2", line 59, in <module>
    d = Dispatcher(event_data)
  File "/usr/lib/python2.7/site-packages/pt/dispatcher.py", line 20, in __init__
    getattr(self, self._event_data['event'])()
  File "/usr/lib/python2.7/site-packages/pt/dispatcher.py", line 55, in KeyPressEvent
    Tile.dispatch(state.get_active_monitor(), cmd)
  File "/usr/lib/python2.7/site-packages/pt/state.py", line 37, in get_active_monitor
    return get_monitor(wsid, mid)
  File "/usr/lib/python2.7/site-packages/pt/state.py", line 53, in get_monitor
    return Workspace.WORKSPACES[wsid].get_monitor(mid)
  File "/usr/lib/python2.7/site-packages/pt/workspace.py", line 37, in get_monitor
    return self.monitors[mid]
KeyError: -1


I have a completely up to date system running Openbox. The only thing that I can think of: Im running dual-head separate X via the nvidia drivers. Though again, pytyle 1 works fine. Thanks for pytyle 1 though; I use tiling, but I like how Openbox works and I like great floating support- pytyle makes Openbox perfect for me.

Offline

#45 2011-08-05 00:28:31

BurntSushi
Member
From: Massachusetts
Registered: 2009-06-28
Posts: 362
Website

Re: PyTyle 2: On-demand automatic/manual tiling for EWMH compliant WM's

GSF1200S wrote:

I cant get pytyle2 to run, though pytyle 1 works fine (slowish as it uses xlib- would love to try the new and improved).

Ah. I actually haven't found much of a performance boost from using XCB; I suspect that I'd need to be doing a lot more communication with X to notice much of a difference. In retrospect though, I'm glad I made the switch; xpyb offers nearly complete access to X whereas python-xlib was only a partial port.

If you're happy with pytyle 1, you might want to stick with it; although certainly pytyle 2 might be worth a shot.

GSF1200S wrote:

Whenever I try to run pytyle2, it complains that it cant grab my keys. I replaced all the Alt keybindings with Ctrl, and then it doesnt complain.

Hmmm, this has to be because some other application is grabbing your keys. Do you have pytyle 1 running while you try to run pytyle 2?

GSF1200S wrote:

I have a completely up to date system running Openbox. The only thing that I can think of: Im running dual-head separate X via the nvidia drivers. Though again, pytyle 1 works fine. Thanks for pytyle 1 though; I use tiling, but I like how Openbox works and I like great floating support- pytyle makes Openbox perfect for me.

I am skeptical of separate X screens working, but I'm also surprised that pytyle 1 works with it. Are you sure you aren't using TwinView? Do you need to run pytyle 1 on each screen?

To further debug... Could you show me the output of the following script? (Either make it executable with 'chmod +x blah.py' or run it directly by 'python2 blah.py'.)

#!/usr/bin/env python2

import xcb, xcb.xproto, xcb.xinerama
c = xcb.connect()
xinerama = c(xcb.xinerama.key)
screens = xinerama.QueryScreens().reply()
print 'ROOT: %dx%d' % (c.get_setup().roots[0].width_in_pixels,
                       c.get_setup().roots[0].height_in_pixels)
for i, s in enumerate(screens.screen_info):
    print '%d: %dx%d +%d+%d' % (i, s.width, s.height, s.x_org, s.y_org)

Education is favorable to liberty. Freedom can exist only in a society of knowledge. Without learning, men are incapable of knowing their rights, and where learning is confined to a few people, liberty can be neither equal nor universal.

Tu ne cede malis sed contra audentior ito

Offline

#46 2011-08-05 02:15:29

GSF1200S
Member
Registered: 2008-12-24
Posts: 474

Re: PyTyle 2: On-demand automatic/manual tiling for EWMH compliant WM's

BurntSushi wrote:
GSF1200S wrote:

I cant get pytyle2 to run, though pytyle 1 works fine (slowish as it uses xlib- would love to try the new and improved).

Ah. I actually haven't found much of a performance boost from using XCB; I suspect that I'd need to be doing a lot more communication with X to notice much of a difference. In retrospect though, I'm glad I made the switch; xpyb offers nearly complete access to X whereas python-xlib was only a partial port.

If you're happy with pytyle 1, you might want to stick with it; although certainly pytyle 2 might be worth a shot.

GSF1200S wrote:

Whenever I try to run pytyle2, it complains that it cant grab my keys. I replaced all the Alt keybindings with Ctrl, and then it doesnt complain.

Hmmm, this has to be because some other application is grabbing your keys. Do you have pytyle 1 running while you try to run pytyle 2?

GSF1200S wrote:

I have a completely up to date system running Openbox. The only thing that I can think of: Im running dual-head separate X via the nvidia drivers. Though again, pytyle 1 works fine. Thanks for pytyle 1 though; I use tiling, but I like how Openbox works and I like great floating support- pytyle makes Openbox perfect for me.

I am skeptical of separate X screens working, but I'm also surprised that pytyle 1 works with it. Are you sure you aren't using TwinView? Do you need to run pytyle 1 on each screen?

To further debug... Could you show me the output of the following script? (Either make it executable with 'chmod +x blah.py' or run it directly by 'python2 blah.py'.)

#!/usr/bin/env python2

import xcb, xcb.xproto, xcb.xinerama
c = xcb.connect()
xinerama = c(xcb.xinerama.key)
screens = xinerama.QueryScreens().reply()
print 'ROOT: %dx%d' % (c.get_setup().roots[0].width_in_pixels,
                       c.get_setup().roots[0].height_in_pixels)
for i, s in enumerate(screens.screen_info):
    print '%d: %dx%d +%d+%d' % (i, s.width, s.height, s.x_org, s.y_org)

I see whats going on- I got a little confused last time. Pytyle 2 only complains about the keyboard shortcuts when pytyle2 is ALREADY running on my other X-session. If I run it only on one X-session, it seems to run (and seems to create 2 or 3 processes as well), but it will not work. I am positive im running Separate X-sessions; I have explicitly told the nvidia tool to setup separate X, and it is impossible for Twinview to work since I have an output out of each video card to each monitor (2 video cards, 2 monitors). I have 3d acceleration (not possible under xinerama), and I cannot drag windows between each screen (I prefer separate screens for separate tasks anyway).

Regardless, I freshly downloaded and installed pytyle2-hg from the AUR, and had the above keybind-grab issues. Further, if I have it running solely on one X-session, I get this python error when I attempt to invoke it (Ctrl+A, or Alt+A), and further the process(es) immediately die:

[poeticrpm@geekdom ~]$ pytyle2
Traceback (most recent call last):
  File "/usr/bin/pytyle2", line 59, in <module>
    d = Dispatcher(event_data)
  File "/usr/lib/python2.7/site-packages/pt/dispatcher.py", line 20, in __init__
    getattr(self, self._event_data['event'])()
  File "/usr/lib/python2.7/site-packages/pt/dispatcher.py", line 55, in KeyPressEvent
    Tile.dispatch(state.get_active_monitor(), cmd)
  File "/usr/lib/python2.7/site-packages/pt/state.py", line 37, in get_active_monitor
    return get_monitor(wsid, mid)
  File "/usr/lib/python2.7/site-packages/pt/state.py", line 53, in get_monitor
    return Workspace.WORKSPACES[wsid].get_monitor(mid)
  File "/usr/lib/python2.7/site-packages/pt/workspace.py", line 37, in get_monitor
    return self.monitors[mid]
KeyError: -1

I saved your script and I ran it both with and without pytyle2 running, and I did so on both X-sessions- I got the exact same result every time.:

 [poeticrpm@geekdom ~]$ python2 debug.py
ROOT: 1920x1080

In answer to your questions about pytyle 1, it runs flawlessly and Im quite happy with it. I post this in case youd like to get this going for other Separate-X users, or if you ever plan to depricate pytyle 1 (if you do, let me know! Ill try my best to maintain it myself..). And yes, I have my autostart.sh (for openbox) setup to launch pytyle on each X-session as follows:

DISPLAY=:0.0 pytyle &
DISPLAY=:0.1 pytyle &

Again, im in no rush; pytyle 1 works perfect smile

**EDIT** It is interesting that pytyle1 doesnt have the keyboard-grab issues. It works as one would expect- whatever screen is active responds to pytyle's shortcuts, while the other screen does not. I have no issues with invoking and uninvoking (and everything else), and each pytyle instance operates independently of the other. For one who didnt plan on separate X when he designed it, you sure did a good job wink

Last edited by GSF1200S (2011-08-05 02:26:04)

Offline

#47 2011-09-06 18:48:03

JimmySJ84
Member
Registered: 2010-07-23
Posts: 12

Re: PyTyle 2: On-demand automatic/manual tiling for EWMH compliant WM's

Hello,

I am just loving Pytyle. However, what I am trying to write are 2 small scripts:

1) toggle tiling/untiling
2) launch 'cycle'  (equivalent to type 'Alt+C'

I have tried to use xdotool but it doesnt work. Hope you help me

Thanks

Offline

#48 2011-09-07 03:23:09

BurntSushi
Member
From: Massachusetts
Registered: 2009-06-28
Posts: 362
Website

Re: PyTyle 2: On-demand automatic/manual tiling for EWMH compliant WM's

Could you please post what you tried with xdotool.


Education is favorable to liberty. Freedom can exist only in a society of knowledge. Without learning, men are incapable of knowing their rights, and where learning is confined to a few people, liberty can be neither equal nor universal.

Tu ne cede malis sed contra audentior ito

Offline

#49 2011-09-07 10:11:58

JimmySJ84
Member
Registered: 2010-07-23
Posts: 12

Re: PyTyle 2: On-demand automatic/manual tiling for EWMH compliant WM's

BurntSushi wrote:

Could you please post what you tried with xdotool.

Thanks for your response. I manage to get xdotool to work with

 xdotool key Ctrl+a 

I think I found a "simple" solution (even if it's not the most elegant).

My original target was to toggle the tiling with a single launcher located in my xfce panel. In the end, I opted to create just 2 launchers: tile and untile plus an additional cycle

If you think a better solution it would be much appreciated

Offline

#50 2011-09-19 19:30:27

GSF1200S
Member
Registered: 2008-12-24
Posts: 474

Re: PyTyle 2: On-demand automatic/manual tiling for EWMH compliant WM's

BurntSushi wrote:

I don't think that error is related to the keybindings failing--the error, I think, stems from not being able to attach a proper monitor to a window (which may in turn stem from not being able to find a valid desktop).

The reason why I say this is that the wmctrl -lG output shows some windows that are on all desktops... While PyTyle 2 skips panels and other such windows, if a regular window is on all desktops, pytyle will probably crash. (Mostly because I don't think I've really added support for windows on all desktops.)

Once my semester is over (this week), I'll have to do some testing with other windows (like guake, conky, etc.)... I think that's where some of the problems are stemming from.

I dont know about Pytyle2 as it doesnt work on dual-head separate X sessions (for me), but with pytyle 1 I can have a window on all workspaces and changing workspaces works just fine (openbox). The window in the new workspace (where pytyle isnt invoked) will be in the same location and of the same size as the one on the pytyled workspace, but it works. I can of course manage the size manually/move it around, but when I go back to the pytyle workspace, hitting alt+a causes it to go right back to where it was (as it should be). I just thought Id mention this so if people knew they needed this functionality, they could revert to pytyle 1.

You know BurntSushi, for pytyle 1 being a "bunch of dirty hacks" as you called it (in that the code isnt "clean" etc), it sure works perfect for some of us.

Offline

Board footer

Powered by FluxBB