You are not logged in.
Hey guys - I'd like to share a simple and pragmatic way to tile windows that I have been using for sometime now.
Keyboard Tiler is a simple script which takes in an argument of two keys on your keyboard and places the given window on your screen representative (space-wise) of the box/tiles that those two keys occupy on your keyboard. Look down at your keyboard... The grid is defined as: from 1 to 0 down to / and over to Z. In total you have a 4x10 grid or 40 tiles to work with. For a visual reference you can refer to this post on my site.
Here are some examples so you can get the idea:
Fullscreen: ruby keyboard-tiler.rb 1/
Top Half of Screen: ruby keyboard-tiler.rb 1p
Top Right of Screen: ruby keyboard-tiler.rb 6p
Right Half of Screen: ruby keyboard-tiler.rb 6/
You can hook my script into either xchainkeys or use it with xbindkeys and Dmenu to provide keybindings rather than just running the script from the CLI. With xchainkeys you just hit a hotkey (W-x default) and then the two keys you want and your window moves and resizes there. Also you can configure it with xchainkeys to stay in the "tile" mode in which any keys you hit will continually move the window until Enter/Escape is hit. Alternatively with Dmenu you can just setup xbindkeys to fire Dmenu taking in two keys and then youll have to press enter. So there's one additional keypress if you chose to go the Dmenu route.
Note: This has only been tested on Openbox and PekWM so far though any window manager that works with xdotool should work fine. This script was made mainly for use with floating window managers to provide tiling functionality.
Here's the Source on Github and a project page on my website describing what Keyboard Tiler does more in depth.
Feedback Appreciated!
Miles
bladdo / mil / Miles
userbound.com - blog and projects
Offline
Looks pretty nice. Just had a quick glance at your code and gave it a spin on a testmachine with Openbox here. Seems to do the job just fine.
Not going to continue using it personally (already running a tiling WM which takes care of that for me), but definitely a cool addition for people who want some sort of tiling in a floating WM environment.
Burninate!
Offline
Looks pretty nice. Just had a quick glance at your code and gave it a spin on a testmachine with Openbox here. Seems to do the job just fine.
Not going to continue using it personally (already running a tiling WM which takes care of that for me), but definitely a cool addition for people who want some sort of tiling in a floating WM environment.
Thanks! Yeah, I guess for many on this forum my script doesn't have much applicability as many already use tiling WMs. I've really enjoyed using a floating WM with this though ha.
bladdo / mil / Miles
userbound.com - blog and projects
Offline
Gcool wrote:Looks pretty nice. Just had a quick glance at your code and gave it a spin on a testmachine with Openbox here. Seems to do the job just fine.
Not going to continue using it personally (already running a tiling WM which takes care of that for me), but definitely a cool addition for people who want some sort of tiling in a floating WM environment.
Thanks! Yeah, I guess for many on this forum my script doesn't have much applicability as many already use tiling WMs. I've really enjoyed using a floating WM with this though ha.
Hi there. Out of curiosity, I decided to port keyboard-tiler to python to test out on my own machine ( Port is here: https://github.com/ShadowKyogre/keyboard-tiler ). Oddly, I get an error along these lines if the window I want to tile is offscreen to the left or cut off at the top including the decoration height accounted for:
In the case of cut offscreen to the left:
Traceback (most recent call last):
File "keyboard-tiler.py", line 152, in <module>
place(args)
File "keyboard-tiler.py", line 59, in place
'x' : int(''.join(findall('Absolute upper-left X:\s+(\d+)',xwin)[0])),
IndexError: list index out of range
In the case of cut offscreen to the top:
Traceback (most recent call last):
File "keyboard-tiler.py", line 153, in <module>
place(args)
File "keyboard-tiler.py", line 60, in place
'y' : int(''.join(findall('Absolute upper-left Y:\s+(\d+)',xwin)[0])),
IndexError: list index out of range
You might want to check this on your Ruby version to make sure to account for those particular cases. If it helps any, I also am running this under KDE.
Last edited by ShadowKyogre (2012-05-02 18:02:31)
For every problem, there is a solution that is:
Clean
Simple and most of all...wrong!
Github page
Offline
bladdo wrote:Gcool wrote:Looks pretty nice. Just had a quick glance at your code and gave it a spin on a testmachine with Openbox here. Seems to do the job just fine.
Not going to continue using it personally (already running a tiling WM which takes care of that for me), but definitely a cool addition for people who want some sort of tiling in a floating WM environment.
Thanks! Yeah, I guess for many on this forum my script doesn't have much applicability as many already use tiling WMs. I've really enjoyed using a floating WM with this though ha.
Hi there. Out of curiosity, I decided to port keyboard-tiler to python to test out on my own machine ( Port is here: https://github.com/ShadowKyogre/keyboard-tiler ). Oddly, I get an error along these lines if the window I want to tile is offscreen to the left or cut off at the top including the decoration height accounted for:
In the case of cut offscreen to the left:
Traceback (most recent call last): File "keyboard-tiler.py", line 152, in <module> place(args) File "keyboard-tiler.py", line 59, in place 'x' : int(''.join(findall('Absolute upper-left X:\s+(\d+)',xwin)[0])), IndexError: list index out of range
In the case of cut offscreen to the top:
Traceback (most recent call last): File "keyboard-tiler.py", line 153, in <module> place(args) File "keyboard-tiler.py", line 60, in place 'y' : int(''.join(findall('Absolute upper-left Y:\s+(\d+)',xwin)[0])), IndexError: list index out of range
You might want to check this on your Ruby version to make sure to account for those particular cases. If it helps any, I also am running this under KDE.
Saw your python port, nice! Quite interesting to compare the code! (as I don't do much python)
As far as that error goes, I'm pretty sure that's on only your end. I just checked my ruby script for that use case and it works fine. Only with your python script I get the error.
Not positive on the fix but I know the ruby version works in that use case. Let me know if you figure out what was wrong as the semantics look pretty damn similar as well.
The one use case in my script (and I assume yours) that will not work is multiple monitors arranged in different orientations... I didn't want to have to deal with figuring out where the monitors were placed so I just made my script single/dual monitor because that is all I use. If someone comes along that wants this support I'll probably add it in but otherwise single/dual is fine for me.
bladdo / mil / Miles
userbound.com - blog and projects
Offline
Saw your python port, nice! Quite interesting to compare the code! (as I don't do much python)
As far as that error goes, I'm pretty sure that's on only your end. I just checked my ruby script for that use case and it works fine. Only with your python script I get the error.
Not positive on the fix but I know the ruby version works in that use case. Let me know if you figure out what was wrong as the semantics look pretty damn similar as well.
The one use case in my script (and I assume yours) that will not work is multiple monitors arranged in different orientations... I didn't want to have to deal with figuring out where the monitors were placed so I just made my script single/dual monitor because that is all I use. If someone comes along that wants this support I'll probably add it in but otherwise single/dual is fine for me.
I figured out why the it was breaking after placing the window a little to the right or top. I had to change this (along with the similar regex for the upper-left y):
Absolute upper-left X:\s+(\d+)
to
Absolute upper-left X:\s+(-?\d+)
Which is probably due to a difference in how \d works in python regexes. Also, mine probably doesn't work with multiple monitors either since I don't have a sufficient environment to test it in.
Last edited by ShadowKyogre (2012-05-04 16:53:35)
For every problem, there is a solution that is:
Clean
Simple and most of all...wrong!
Github page
Offline