You are not logged in.

#1 2009-01-28 20:18:16

u_no_hu
Member
Registered: 2008-06-15
Posts: 453

Poor man's Tiling Window manager

Basically a simple python script which does tiling on any windowmanager (Perfectly on pekwm and openbox. Partly on compiz due to the fact that compiz says it has a single desktop even if there are 4 virtual desktops, which means all the windows you have will be tiled).
It uses wmctrl to get the info and manage the windows. Bind it to a key or to autowhatever-on-window-creation-hook.

Currently options are

left,right   - Does the new windows7 ish style of sticking to the sides.
swap     -   Basic tiling layout on first call, then swaps the active window to main pane on subsequent calls
cycle     - Cycle all the windows in the master pane
vertical   - Simple vertical tiling
horizontal   - Simple horizontal tiling
maximize   - Maximize the active window/ for openbox which doesn't permit resizing of max windows
max_all     - Maximize all windows

simple( obsolete, swap works better tongue )     - The basic tiling layout . 1 Main + all other at the side.


If you need other layouts modify get_simple_tile

On first run it will create a config file ~/.managerc. Modify the values to suit your window decorations/Desktop padding

Github
Clone usrl: git://github.com/TheWanderer/stiler.git

Aur http://aur.archlinux.org/packages.php?ID=25038

soulfx's fork of the grid branch with dualmonitor support and grid layout
http://github.com/soulfx/stiler/tree/grid

Last edited by u_no_hu (2009-05-12 11:35:22)


Don't be a HELP VAMPIRE. Please search before you ask.

Subscribe to The Arch Daily News.

Offline

#2 2009-01-28 20:25:44

haxit
Member
From: /home/haxit
Registered: 2008-03-04
Posts: 1,247
Website

Re: Poor man's Tiling Window manager

I get this error when I try to run it:

Traceback (most recent call last):
  File "tiling", line 24, in <module>
    (DESKTOP,OrigXstr,OrigYstr,MaxWidthStr,MaxHeightStr) = get_desktop()
  File "tiling", line 15, in get_desktop
    current =  filter(lambda x: x.split()[1] == "*" , output)[0].split()
IndexError: list index out of range


Archi686 User | Old Screenshots | Old .Configs
Vi veri universum vivus vici.

Offline

#3 2009-01-28 20:29:01

u_no_hu
Member
Registered: 2008-06-15
Posts: 453

Re: Poor man's Tiling Window manager

which windowmanager?
can you post wmctrl -d


Don't be a HELP VAMPIRE. Please search before you ask.

Subscribe to The Arch Daily News.

Offline

#4 2009-01-28 20:32:00

finferflu
Forum Fellow
From: Manchester, UK
Registered: 2007-06-21
Posts: 1,899
Website

Re: Poor man's Tiling Window manager

Hey this is cool! I will try it out as soon as I get some time smile


Have you Syued today?
Free music for free people! | Earthlings

"Perfection is achieved, not when there is nothing more to add, but when there is nothing left to take away." -- A. de Saint-Exupery

Offline

#5 2009-01-28 20:32:08

haxit
Member
From: /home/haxit
Registered: 2008-03-04
Posts: 1,247
Website

Re: Poor man's Tiling Window manager

haxit@arsenic ~ >  wmctrl -d
0  * DG: 1680x1050  VP: 0,0  WA: 0,0 1680x1031  Main

I am using openbox.

Now getting this:

haxit@arsenic ~ >  python tiling
['0', '*', 'DG:', '1680x1050', 'VP:', '0,0', 'WA:', '0,0', '1680x1031', 'Main']
Traceback (most recent call last):
  File "tiling", line 94, in <module>
    if sys.argv[1] == "left":
IndexError: list index out of range

Never mind.I didn't put any arguments tongue

Last edited by haxit (2009-01-28 20:37:19)


Archi686 User | Old Screenshots | Old .Configs
Vi veri universum vivus vici.

Offline

#6 2009-01-28 20:37:56

rson451
Member
From: Annapolis, MD USA
Registered: 2007-04-15
Posts: 1,233
Website

Re: Poor man's Tiling Window manager

Seems to be a similar project as http://wumwum.sourceforge.net/.  I know this is in perl, but maybe you can take ideas from here?


archlinux - please read this and this — twice — then ask questions.
--
http://rsontech.net | http://github.com/rson

Offline

#7 2009-01-28 20:43:49

u_no_hu
Member
Registered: 2008-06-15
Posts: 453

Re: Poor man's Tiling Window manager

@haxit
I tried with your configuration and it worked fine. You have to pass a parameter to the script. pass simple,left or right as parameter

$wmctrl -d
0  * DG: 1440x900  VP: 0,0  WA: 0,0 1440x900  Browse

try  $tiling simple

@rson
Thanks

Last edited by u_no_hu (2009-01-28 20:45:07)


Don't be a HELP VAMPIRE. Please search before you ask.

Subscribe to The Arch Daily News.

Offline

#8 2009-01-28 23:23:36

phrakture
Arch Overlord
From: behind you
Registered: 2003-10-29
Posts: 7,879
Website

Re: Poor man's Tiling Window manager

This is pretty neat. smile

Offline

#9 2009-01-28 23:36:14

haxit
Member
From: /home/haxit
Registered: 2008-03-04
Posts: 1,247
Website

Re: Poor man's Tiling Window manager

phrakture wrote:

This is pretty neat. smile

Indeed. It is actually really good. Good job man!

Last edited by haxit (2009-01-28 23:36:22)


Archi686 User | Old Screenshots | Old .Configs
Vi veri universum vivus vici.

Offline

#10 2009-01-29 01:30:04

marxav
Member
From: Gatineau, PQ, Canada
Registered: 2006-09-24
Posts: 386

Re: Poor man's Tiling Window manager

That is impressing.  Had to pacman -S wmctrl first though.

Offline

#11 2009-01-29 12:46:10

u_no_hu
Member
Registered: 2008-06-15
Posts: 453

Re: Poor man's Tiling Window manager

Hey guys... New functionality added. now you can swap windows around.  Pass swap as parameter and bind it to a shortcut. The active window will be swapped with  the master window.

You will need to install xdotool and wmctrl

Please try it out and let me know if there are any bugs.  smile

These three are the only functionality i use mainly in tiling windowmanagers (apart from tagging, but i can adjust with workspaces ). So if there is anything else that you have in mind, please share.

I have bound Win+h to simple tiling, win + down to swap the current window as active and win + (left,right) to stick left and right. And i am done.   

And can anybody of you using gnome/KDE  test it and let me know if it works or not. I dont have them installed and have no intention of downloading 1+GB for this .  smile ..
Output of wmctrl -lG , wmctrl -l and wmctrl -d from gnome/kde desktop would also be great...

Thanks in advance smile

Last edited by u_no_hu (2009-01-29 12:47:44)


Don't be a HELP VAMPIRE. Please search before you ask.

Subscribe to The Arch Daily News.

Offline

#12 2009-01-29 20:28:49

Weteor
Member
Registered: 2008-01-05
Posts: 5

Re: Poor man's Tiling Window manager

Thats a real nice script. Tested it with gnome and it works fine.
Here is the output of wmctrl -l -lG and -d in gnome.

$ wmctrl -l
0x00e00003 -1 lab Unteres Kanten-Panel, ausgedehnt
0x00e00026 -1 lab Oberes Kanten-Panel, ausgedehnt
0x0100001d -1 lab x-nautilus-desktop
0x02800009  2 lab urxvt
0x02a00009  2 lab urxvt
0x02e00009  0 lab WeeChat 0.2.6
0x02c00255  0 lab Help - - Gran Paradiso
0x03000009  2 lab urxvt
0x03200009  2 lab urxvt

$ wmctrl -lG
0x00e00003 -1 0     1496 1024 20   lab Unteres Kanten-Panel, ausgedehnt
0x00e00026 -1 0     0    1024 24   lab Oberes Kanten-Panel, ausgedehnt
0x0100001d -1 0     0    1024 768  lab x-nautilus-desktop
0x02800009  2 516   313  508  208  lab urxvt
0x02a00009  2 508   554  508  208  lab urxvt
0x02e00009  0 2     72   508  688  lab WeeChat 0.2.6
0x02c00255  0 0     72   1024 700  lab Arch Linux Forums / Post a reply - Gran Paradiso
0x03000009  2 2     72   508  688  lab urxvt
0x03200009  2 516   72   508  208  lab urxvt

$ wmctrl -d
0  - DG: 1024x768  VP: N/A  WA: 0,24 1024x724  Misc
1  - DG: 1024x768  VP: N/A  WA: 0,24 1024x724  Code
2  * DG: 1024x768  VP: 0,0  WA: 0,24 1024x724  MusiK
3  - DG: 1024x768  VP: N/A  WA: 0,24 1024x724  Com

Offline

#13 2009-01-29 22:17:35

oew
Member
From: Norway
Registered: 2006-11-08
Posts: 105

Re: Poor man's Tiling Window manager

I'm having some issues with this script. I have both xdotool and wmctrl installed, and I'm running Openbox.

> ./tiling left puts the active terminal to the left, and > ./tiling right puts the active terminal to the right. Nothing happens to the inactive windows.

> ./tiling simple does nothing.

> ./tiling swap
Traceback (most recent call last):
  File "./tiling", line 169, in <module>
    swap()
  File "./tiling", line 157, in swap
    winlist.remove(active)
ValueError: list.remove(x): x not in list
> wmctrl -l
0x00800001 4294967295 grus Conky (grus)
0x01400000 4294967295  N/A PyPanel
0x01800003  1 grus Deluge
0x01a00003  3 grus xxxxxx - Claws Mail 3.7.0
0x01c00056 30510348159156224 grus Arch Linux Forums / Post a reply - Vimperator

> wmctrl -lG
0x00800001 4294967295 1120 -3   562  14   grus Conky (grus)
0x01400000 4294967295 0    1034 1680 16    N/A PyPanel
0x01800003  1 95   86   1343 851  grus Deluge
0x01a00003  3 291  124  1304 784  grus xxxxxx - Claws Mail 3.7.0
0x01c00056 30510348159156224 110  102  1157 866  grus Arch Linux Forums / Post a reply - Vimperator

> wmctrl -d
0  * DG: N/A  VP: 0,0  WA: 0,11 1680x1023  < one >
1  - DG: N/A  VP: 0,0  WA: 0,11 1680x1023  < two >
2  - DG: N/A  VP: N/A  WA: N/A             < three >
3  - DG: N/A  VP: N/A  WA: N/A             < four >

I ran these with 5 terminals (urxvt) running, and none of them show up in wmctrl -l(G).
Maybe I'm doing something wrong?
___
oew


there's no place like ~/

Offline

#14 2009-01-29 22:46:42

marxav
Member
From: Gatineau, PQ, Canada
Registered: 2006-09-24
Posts: 386

Re: Poor man's Tiling Window manager

I use dual monitors. So I modified a little the script because it would place the windows on the left monitor only. 

[marst@iguane python]$ wmctrl -d   
0  * DG: 2720x1024  VP: 0,0  WA: 1280,24 1440x876  desktop 1
1  - DG: 2720x1024  VP: 0,0  WA: 1280,24 1440x876  desktop 2
2  - DG: 2720x1024  VP: 0,0  WA: 1280,24 1440x876  desktop 3
3  - DG: 2720x1024  VP: 0,0  WA: 1280,24 1440x876  desktop 4

I modified the width as such so that it gets the 2720px width

width =  current[3].split("x")[0]

And set orig_x=0 and orig_y=0.  Otherwise it put windows starting a x=1440

Other things would be ability to set a max width for any window.
My two monitor have different geometry.  That is a little annoying

Offline

#15 2009-01-30 04:43:03

u_no_hu
Member
Registered: 2008-06-15
Posts: 453

Re: Poor man's Tiling Window manager

@ tiling left and right does just that... It mimics the mew windows 7 behaviour .

Since the script uses wmctrl -l to get a list of current windows.. and your urxvt windows are not listed... can you please check xprop of those windows.

@marxav currently i dont uses dual monitors... but i have got an extra one lying around.. so i will try with that and check if there is a way to work around that issue smile

@Weteor
Thanks a lot for testing and the info smile


Don't be a HELP VAMPIRE. Please search before you ask.

Subscribe to The Arch Daily News.

Offline

#16 2009-01-30 05:38:46

bslagowski
Member
Registered: 2008-02-23
Posts: 102

Re: Poor man's Tiling Window manager

This works great! smile

One thing I've noticed though is if you do "tile simple" while you have a window minimized it leaves a "space" for that window but doesn't bring it up and tile it. Does that make sense? The same behavior happens if you have a window maximized.

Last edited by bslagowski (2009-01-30 05:47:08)

Offline

#17 2009-01-30 05:45:20

u_no_hu
Member
Registered: 2008-06-15
Posts: 453

Re: Poor man's Tiling Window manager

@bslagowski
Thanks  smile  Please share any features you would like to get implemented.


Don't be a HELP VAMPIRE. Please search before you ask.

Subscribe to The Arch Daily News.

Offline

#18 2009-01-30 15:39:09

oew
Member
From: Norway
Registered: 2006-11-08
Posts: 105

Re: Poor man's Tiling Window manager

@u_no_hu
Ah, i see. My bad, i'm not familiar with Windows 7.

Not sure what to check for in xprop, so here you go:

> xprop
_XEMBED_INFO(_XEMBED_INFO) = 0x0, 0x1
WM_STATE(WM_STATE):
        window state: Normal
        icon window: 0x0
_NET_WM_DESKTOP(CARDINAL) = 0
_KDE_NET_WM_FRAME_STRUT(CARDINAL) = 1, 1, 16, 1
_NET_FRAME_EXTENTS(CARDINAL) = 1, 1, 16, 1
_NET_WM_STATE(ATOM) = 
_NET_WM_ALLOWED_ACTIONS(ATOM) = _NET_WM_ACTION_CHANGE_DESKTOP, _NET_WM_ACTION_SHADE, _NET_WM_ACTION_CLOSE, _NET_WM_ACTION_MOVE, _NET_WM_ACTION_MINIMIZE, _NET_WM_ACTION_RESIZE, _NET_WM_ACTION_FULLSCREEN, _NET_WM_ACTION_MAXIMIZE_HORZ, _NET_WM_ACTION_MAXIMIZE_VERT, _NET_WM_ACTION_ABOVE, _NET_WM_ACTION_BELOW, _OB_WM_ACTION_UNDECORATE
_NET_WM_ICON(CARDINAL) = 48, 48, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
[...]
_NET_WM_VISIBLE_ICON_NAME(UTF8_STRING) = 0x6f, 0x65, 0x77, 0x3a, 0x20, 0x7e
_NET_WM_VISIBLE_NAME(UTF8_STRING) = 0x6f, 0x65, 0x77, 0x3a, 0x20, 0x7e
_NET_WM_PID(CARDINAL) = 9652
WM_PROTOCOLS(ATOM): protocols  WM_DELETE_WINDOW, _NET_WM_PING
WM_LOCALE_NAME(STRING) = "en_US.utf8"
WM_CLASS(STRING) = "urxvt", "URxvt"
WM_HINTS(WM_HINTS):
        Client accepts input or input focus: True
        Initial state is Normal State.
        window id # of group leader: 0x1e00015
WM_NORMAL_HINTS(WM_SIZE_HINTS):
        program specified minimum size: 10 by 28
        program specified resize increment: 6 by 12
        program specified base size: 4 by 16
        window gravity: NorthWest
WM_CLIENT_MACHINE(STRING) = "grus"
WM_COMMAND(STRING) = { "urxvt", "-embed", "31457289" }
_NET_WM_ICON_NAME(UTF8_STRING) = 0x6f, 0x65, 0x77, 0x3a, 0x20, 0x7e
WM_ICON_NAME(STRING) = "oew: ~"
_NET_WM_NAME(UTF8_STRING) = 0x6f, 0x65, 0x77, 0x3a, 0x20, 0x7e
WM_NAME(STRING) = "oew: ~"

Edit:
I noticed that Firefox also isn't detected by wmctrl -l. When I testet simple in previous post I only had Firefox and urxvt on that desktop, that's the reason it didn't do anything tongue

Did a test with all applications recognized by wmctrl -l on the same desktop, and it worked perfectly.
swap works fine aswell.
There must be something funky with my setup.

___
oew

Last edited by oew (2009-01-30 15:54:34)


there's no place like ~/

Offline

#19 2009-01-30 16:10:37

u_no_hu
Member
Registered: 2008-06-15
Posts: 453

Re: Poor man's Tiling Window manager

@oew  urxvt seems to be launched with -embed option which embeds it in another window.. how are you launching the applications?


Don't be a HELP VAMPIRE. Please search before you ask.

Subscribe to The Arch Daily News.

Offline

#20 2009-01-30 16:50:11

oew
Member
From: Norway
Registered: 2006-11-08
Posts: 105

Re: Poor man's Tiling Window manager

@u_no_hu
Normally I launch it with a keybind defined in openbox' rc.xml.
I tested now with launching from dmenu, the openbox menu and from xterm, all seems to be launched with -embed.

And something even stranger. When xterm is running, Firefox appears in wmctrl -l.
I'm just getting more and more confused tongue


___
oew


there's no place like ~/

Offline

#21 2009-01-30 17:10:41

u_no_hu
Member
Registered: 2008-06-15
Posts: 453

Re: Poor man's Tiling Window manager

strange...can you check which window it is embedding? compare the first field of wmctrl -l to the number after -embed. you many have to convert from hex...


Don't be a HELP VAMPIRE. Please search before you ask.

Subscribe to The Arch Daily News.

Offline

#22 2009-01-30 20:49:59

Duologic
Member
From: Belgium
Registered: 2007-11-11
Posts: 249

Re: Poor man's Tiling Window manager

Looks great, maybe put it in AUR... smile

Offline

#23 2009-01-31 06:25:27

brisbin33
Member
From: boston, ma
Registered: 2008-07-24
Posts: 1,796
Website

Re: Poor man's Tiling Window manager

this is awesome.

took a little messing with the borders at the start of the file... i also adjusted the left and right functions to get some consistancy; i made them like this

def left():
    Width=MaxWidth/2-1
    Height=MaxHeight
    PosX=RightPadding
    PosY=TopPadding
    move_active(PosX,PosY,Width,Height)

def right():
    Width=MaxWidth/2-1
    Height=MaxHeight
    PosX=MaxWidth/2
    PosY=TopPadding
    move_active(PosX,PosY,Width,Height)

cheers!

Offline

#24 2009-01-31 06:43:06

u_no_hu
Member
Registered: 2008-06-15
Posts: 453

Re: Poor man's Tiling Window manager

@brisbin   Thanks a lot for testing. I never noticed that as i have all those padding set to 0. 
PosX=RightPadding  ..... this should be LeftPadding .. shouldn't it? 
Any way thanks for noticing it.

If you send me a git patch, that will add your name as contributor big_smile ..and you will recieve a few cookies (or your favourite beer) wink ...


Don't be a HELP VAMPIRE. Please search before you ask.

Subscribe to The Arch Daily News.

Offline

#25 2009-01-31 18:29:09

brisbin33
Member
From: boston, ma
Registered: 2008-07-24
Posts: 1,796
Website

Re: Poor man's Tiling Window manager

u_no_hu wrote:

@brisbin   Thanks a lot for testing. I never noticed that as i have all those padding set to 0. 
PosX=RightPadding  ..... this should be LeftPadding .. shouldn't it? 
Any way thanks for noticing it.

If you send me a git patch, that will add your name as contributor big_smile ..and you will recieve a few cookies (or your favourite beer) wink ...

haha you're absolutely right that should be LeftPadding, i have them both at 20 so i didn't notice.

i'm familiar with git patches but i've never done one; i'm in the process of upgrading to arch64 today but maybe when i'm done with that i'll look into it.  it's a very minor change so i don't mind if you just implement it w/o crediting me smile

very very cool script btw, i'll be using it from now on for sure.

Offline

Board footer

Powered by FluxBB