You are not logged in.
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 ) - 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)
Offline
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
which windowmanager?
can you post wmctrl -d
Offline
Hey this is cool! I will try it out as soon as I get some time
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
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
Last edited by haxit (2009-01-28 20:37:19)
Archi686 User | Old Screenshots | Old .Configs
Vi veri universum vivus vici.
Offline
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
@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)
Offline
Offline
This is pretty neat.
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
That is impressing. Had to pacman -S wmctrl first though.
Offline
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.
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 . ..
Output of wmctrl -lG , wmctrl -l and wmctrl -d from gnome/kde desktop would also be great...
Thanks in advance
Last edited by u_no_hu (2009-01-29 12:47:44)
Offline
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
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
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
@ 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
@Weteor
Thanks a lot for testing and the info
Offline
This works great!
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
@bslagowski
Thanks Please share any features you would like to get implemented.
Offline
@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
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
@oew urxvt seems to be launched with -embed option which embeds it in another window.. how are you launching the applications?
Offline
@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
___
oew
there's no place like ~/
Offline
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...
Offline
Looks great, maybe put it in AUR...
Offline
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!
//github/
Offline
@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 ..and you will recieve a few cookies (or your favourite beer) ...
Offline
@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 ..and you will recieve a few cookies (or your favourite beer) ...
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
very very cool script btw, i'll be using it from now on for sure.
//github/
Offline