File awful/client.lua
Author:
Julien Danjou <julien@danjou.info> |
Copyright ©2008 Julien Danjou
Release: v3.1.2
Functions
calculate_distance (dir, cA, cB) | Calculate distance between two points. |
focus.bydirection (dir, c) | Focus a client by the given direction. |
focus.byidx (i, c) | Focus a client by its relative index. |
focus.filter (c) | Filter out window that we do not want handled by focus. |
focus.history.add (c) | Update client focus history. |
focus.history.delete (c) | Remove a client from the focus history |
focus.history.get (screen, idx) | Get the latest focused client for a screen in history. |
focus.history.previous () | Focus the previous client in history. |
get_client_in_direction (dir, c) | Get the nearest client in the given direction |
getmarked () | Return the marked clients and empty the marked table. |
getmaster (screen) | Get the master window. |
is_in_direction (dir, cA, cB) | Return true whether client B is in the right direction compared to client A. |
ismarked (c) | Check if a client is marked. |
mark (c) | Mark a client, and then call 'marked' hook. |
master (screen) | Get the master window, deprecated, see getmaster(). |
maximize (c) | Maximize a client to use the full workarea. |
maximize_clean (c) | Erase eventual client data in maximize. |
moveresize (x, y, w, h, c) | Move/resize a client relative to current coordinates. |
movetoscreen (c, s) | Move a client to a screen. |
movetotag (target, c) | Move a client to a tag. |
next (i, c) | Get a client by its relative index to the focused window. |
setslave (c) | Set the client as slave: put it at the end of other windows. |
swap.bydirection (dir, c) | Swap a client with another client in the given direction |
swap.byidx (i, c) | Swap a client by its relative index. |
togglefloating (c) | Toggle the floating status of a client. |
togglemarked (c) | Toggle a client as marked. |
toggletag (target, c) | Toggle a tag on a client. |
unmark (c) | Unmark a client and then call 'unmarked' hook. |
urgent.add (c, prop) | Adds client to urgent stack. |
urgent.delete (c) | Remove client from urgent stack. |
urgent.get () | Get the first client that got the urgent hint. |
urgent.jumpto () | Jump to the client that received the urgent hint first. |
visible (screen) | Get visible clients from a screen. |
Functions
- calculate_distance (dir, cA, cB)
-
Calculate distance between two points. i.e: if we want to move to the right, we will take the right border of the currently focused client and the left side of the checked client. This avoid the focus of an upper client when you move to the right in a tilebottom layout with nmaster=2 and 5 clients open, for instance.
Parameters
- dir: The direction.
- cA: The first client.
- cB: The second client.
Return value:
The distance between the clients. - focus.bydirection (dir, c)
-
Focus a client by the given direction.
Parameters
- dir: The direction, can be either "up", "down", "left" or "right".
- c: Optional client.
- focus.byidx (i, c)
-
Focus a client by its relative index.
Parameters
- i: The index.
- c: Optional client.
- focus.filter (c)
-
Filter out window that we do not want handled by focus. This usually means that desktop, dock and splash windows are not registered and cannot get focus.
Parameters
- c: A client.
Return value:
The same client if it's ok, nil otherwise. - focus.history.add (c)
-
Update client focus history.
Parameters
- c: The client that has been focused.
- focus.history.delete (c)
-
Remove a client from the focus history
Parameters
- c: The client that must be removed.
- focus.history.get (screen, idx)
-
Get the latest focused client for a screen in history.
Parameters
- screen: The screen number to look for.
- idx: The index: 0 will return first candidate, 1 will return second, etc.
Return value:
A client. - focus.history.previous ()
- Focus the previous client in history.
- get_client_in_direction (dir, c)
-
Get the nearest client in the given direction
Parameters
- dir: The direction, can be either "up", "down", "left" or "right".
- c: Optional client to get a client relative to. Else focussed is used.
- getmarked ()
-
Return the marked clients and empty the marked table.
Return value:
A table with all marked clients. - getmaster (screen)
-
Get the master window.
Parameters
- screen: Optional screen number, otherwise screen mouse is used.
Return value:
The master window. - is_in_direction (dir, cA, cB)
-
Return true whether client B is in the right direction compared to client A.
Parameters
- dir: The direction.
- cA: The first client.
- cB: The second client.
Return value:
True if B is in the direction of A. - ismarked (c)
-
Check if a client is marked.
Parameters
- c: The client to check, or the focused one otherwise.
- mark (c)
-
Mark a client, and then call 'marked' hook.
Parameters
- c: The client to mark, the focused one if not specified.
Return value:
True if the client has been marked. False if the client was already marked. - master (screen)
-
Get the master window, deprecated, see getmaster().
Parameters
- screen:
- maximize (c)
-
Maximize a client to use the full workarea.
Parameters
- c: A client, or the focused one if nil.
- maximize_clean (c)
-
Erase eventual client data in maximize.
Parameters
- c: The client.
- moveresize (x, y, w, h, c)
-
Move/resize a client relative to current coordinates.
Parameters
- x: The relative x coordinate.
- y: The relative y coordinate.
- w: The relative width.
- h: The relative height.
- c: The optional client, otherwise focused one is used.
- movetoscreen (c, s)
-
Move a client to a screen. Default is next screen, cycling.
Parameters
- c: The client to move.
- s: The screen number, default to current + 1.
- movetotag (target, c)
-
Move a client to a tag.
Parameters
- target: The tag to move the client to.
- c: Optional client to move, otherwise the focused one is used.
- next (i, c)
-
Get a client by its relative index to the focused window.
Parameters
- i: The index.
- c: Optional client.
Usage:
Set i to 1 to get next, -1 to get previous.Return value:
A client, or nil if no client is available. - setslave (c)
-
Set the client as slave: put it at the end of other windows.
Parameters
- c: The window to set as slave.
- swap.bydirection (dir, c)
-
Swap a client with another client in the given direction
Parameters
- dir: The direction, can be either "up", "down", "left" or "right".
- c: Optional client.
- swap.byidx (i, c)
-
Swap a client by its relative index.
Parameters
- i: The index.
- c: Optional client, otherwise focused one is used.
- togglefloating (c)
-
Toggle the floating status of a client.
Parameters
- c: Optional client, the focused one if not set.
- togglemarked (c)
-
Toggle a client as marked.
Parameters
- c: The client to toggle mark.
- toggletag (target, c)
-
Toggle a tag on a client.
Parameters
- target: The tag to toggle.
- c: Optional client to toggle, otherwise the focused one is used.
- unmark (c)
-
Unmark a client and then call 'unmarked' hook.
Parameters
- c: The client to unmark, or the focused one if not specified.
Return value:
True if the client has been unmarked. False if the client was not marked. - urgent.add (c, prop)
-
Adds client to urgent stack.
Parameters
- c: The client object.
- prop: The property which is updated.
- urgent.delete (c)
-
Remove client from urgent stack.
Parameters
- c: The client object.
- urgent.get ()
-
Get the first client that got the urgent hint.
Return value:
The first urgent client. - urgent.jumpto ()
- Jump to the client that received the urgent hint first.
- visible (screen)
-
Get visible clients from a screen.
Parameters
- screen: The screen number, or nil for all screens.
Return value:
A table with all visible clients.