-
Notifications
You must be signed in to change notification settings - Fork 16
Hacking the Mavericks version
All keywords are defined in the the "layout_select.py" file in this section:
layouts = [
Layout("togglefullscreen", "Toggle full screen mode", "togglefullscreen"),
Layout("full", "Full", "set:0,0,1,1"),
Layout("left", "Left", "set:0,0,0.5,1"),
Layout("top", "Top", "set:0,0,1,0.5"),
...
You can add any keyword you like by extending this list by another "Layout" object
Layout(<id as it should be typed>, <displayed text>, <parameter passed to layouter>)
The parameters of the layouter are described in the final section below.
Just bind the parameters of the you like to a hotkey and pass them directly to the layouter.
The layout now accepts "commands" with different behaviors. The format is: <command>:<values>
The "set" command is the default and takes four comma-separated coordinates where the current window should be placed: set:<left>,<top>,<right>,<bottom>
The coordinates are relative to the available screen size, i.e. each value is between 0 and 1, where (0,0) is top-left and (1,1) bottom-right of the screen.
Examples:
- set:0,0,0.5,1 = Left side of screen
- set:0.1,0.1,0.9,0.9 = Center of screen with 10% border
- set:0.5,0,1,0.5 = Top-right quarter of screen
For mutli-screen environments the command works just like in single-screen, the layout will "guess" what screen the current window is on based on its visible size.
If you actually want to move (and layout) a window to another screen, the "set" command has an additional parameter: set:<left>,<top>,<right>,<bottom>:<screen offset>
Whereas screen offset
is a positive or negative number.
Examples:
- set:0.1,0.1,0.9,0.9:+1 = Move the window to the center of the next screen (left or right; this still depends on your configuration)
- set:0,0,1,1:-1 = Move the window to the previous screen full size (right or left)
- set:0,0,0.5,0.5:+2 = Move the window to the top-left corner to 2 screens further (if you just have two screens this means that the window just ends on the current screen)
The "move" command takes two comma-separated coordinates defining where the current window should be moved to: move:<x,y>
The coordinates are relative to the available screen size, i.e. each value is between 0 and 1, where (0,0) is top-left and (1,1) bottom-right of the screen. If possible the window is moved so that its center matches the given coordinate, it is ensured that the window is not moved outside the screen.
Examples:
- move:0.5,0.5 = Move window to center of screen
- move:1,1 = Move window to bottom-left of screen
The "resize" command takes four comma-separated coordinates defining the amount the window should be resize in respective directions: resize:<left of window>,<top of window>,<right of window>,<bottom of window>
The values are relative to the available screen size, i.e. each value is between 0 and 1. It is ensured that the window is not resized outside the screen
Examples:
- resize:0.1667,0,0,0 = Enlarge the current window to the left be 1/6 of the screen-size
- resize:0,0,-0.1667,0 = Shrink the current window from the right be 1/6 of the screen-size
- resize:0,0,0.1,0.1 = Enlarge the current window to the right and bottom by 10% of the screen-size
The "resizeAll" command takes a single values: resizeAll:<amount>
The values are relative to the available screen size, i.e. each value is between 0 and 1. The window is resized in all directions by the amount, whereas the edges of the screen will be sticky.
Examples:
- resizeAll:0.1667 = Enlarge the window be 1/6 of the screen-size
- resizeAll:-0.1667 = Shrink the window be 1/6 of the screen-size