cortile


Namecortile JSON
Version 1.0.1 PyPI version JSON
download
home_pageNone
SummaryPython bindings for the linux auto tiling manager cortile.
upload_time2024-08-17 14:16:10
maintainerNone
docs_urlNone
authorleukipp
requires_python>=3.8
licenseMIT License Copyright (c) 2024 leukipp Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
keywords dbus x11
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Cortile Addons
[![Release](https://github.com/leukipp/cortile-addons/actions/workflows/release.yml/badge.svg)](https://github.com/leukipp/cortile-addons/actions/workflows/release.yml)
[![PyPI](https://img.shields.io/pypi/v/cortile?label=PyPI%20Package)](https://pypi.org/project/cortile)

Python bindings for the linux auto tiling manager cortile.

Cortile provides auto tiling for XFCE, LXDE, LXQt, KDE and GNOME (Mate, Deepin, Cinnamon, Budgie) based desktop environments.
There is build in support for Openbox, Fluxbox, IceWM, Xfwm, KWin, Marco, Muffin, Mutter and other EWMH compliant window managers using the X11 window system.

This package only provides the python bindings and does not contain the cortile release binary.
To use this package, you need to install the [binary](https://github.com/leukipp/cortile/releases) from the main repository. For more details, please refer to the cortile [README.md](https://github.com/leukipp/cortile?tab=readme-ov-file#addons-) file.

## Installation [![installation](https://img.shields.io/badge/pip-%20Python%20-red?style=flat-square)](#installation-)
To get started, install it via `pip`:
```bash
pip install cortile
```

### Usage
If cortile is installed and running as described [here](https://github.com/leukipp/cortile?tab=readme-ov-file#installation-), the python bindings will connect to the running instance, allowing you to fully communicate with cortile using python:

```python
from cortile import Cortile

# connects to the running cortile instance
ct = Cortile()
...
```

## Documentation [![documentation](https://img.shields.io/badge/docstring-%20PEP%20257%20-yellow?style=flat-square)](#documentation-)
Documentation is provided through docstring literals, which appear immediately after the definition of a method, class, or module.
While all methods and classes include docstrings, the primary interface for interacting with a running cortile instance is the `Cortile()` class, which is documented here:

<details><summary>class Cortile()</summary><div>

<a id="cortile/cortile.Cortile.__init__"></a>

#### \_\_init\_\_

```python
def __init__(log: int = Logger.LEVELS.WARN)
```

Initialize the cortile connector.

This main class wraps methods of the base connector and should be
used as primary interface to communicate with a running cortile instance.

**Arguments**:

- `log`: Logging level, default is warn

<a id="cortile/cortile.Cortile.log"></a>

#### log

```python
@property
def log() -> Logger
```

Return the logger instance.

**Returns**:

Logger instance that writes to syslog

<a id="cortile/cortile.Cortile.listen"></a>

#### listen

```python
def listen(callback: Callable[[Dict], None] | None) -> None
```

Start listening for events.

**Arguments**:

- `callback`: Function to call when an event is received

<a id="cortile/cortile.Cortile.wait"></a>

#### wait

```python
def wait(sleep: float = 0.5) -> None
```

Keeps the process running for the connector to listen.

**Arguments**:

- `sleep`: Time to sleep in between, default is 0.5 seconds

<a id="cortile/cortile.Cortile.close"></a>

#### close

```python
def close() -> None
```

Close the connection gracefully.

<a id="cortile/cortile.Cortile.get_active_layout"></a>

#### get\_active\_layout

```python
def get_active_layout() -> Dict | None
```

Get the active layout for the current desktop and screen.

**Returns**:

Active layout with tiling enabled or None

<a id="cortile/cortile.Cortile.get_active_layouts"></a>

#### get\_active\_layouts

```python
def get_active_layouts() -> Iterator[Dict]
```

Get the active layouts from the workspaces.

**Returns**:

Iterator of active layouts with tiling enabled

<a id="cortile/cortile.Cortile.get_active_client"></a>

#### get\_active\_client

```python
def get_active_client() -> Dict | None
```

Get the current focused client window.

**Returns**:

Active client or None

<a id="cortile/cortile.Cortile.get_active_clients"></a>

#### get\_active\_clients

```python
def get_active_clients() -> Iterator[Dict]
```

Get information of clients on the current active screen.

**Returns**:

Iterator of tracked clients on the current screen

<a id="cortile/cortile.Cortile.get_active_desktop"></a>

#### get\_active\_desktop

```python
def get_active_desktop() -> int | None
```

Get the current active desktop.

**Returns**:

Active desktop index or None

<a id="cortile/cortile.Cortile.get_active_screen"></a>

#### get\_active\_screen

```python
def get_active_screen() -> int | None
```

Get the current active screen.

**Returns**:

Active screen index or None

<a id="cortile/cortile.Cortile.get_desktop_count"></a>

#### get\_desktop\_count

```python
def get_desktop_count() -> int | None
```

Get the number of desktops.

**Returns**:

Number of desktops or None

<a id="cortile/cortile.Cortile.get_screen_count"></a>

#### get\_screen\_count

```python
def get_screen_count() -> int | None
```

Get the number of screens.

**Returns**:

Number of screens or None

<a id="cortile/cortile.Cortile.get_desktop_dimensions"></a>

#### get\_desktop\_dimensions

```python
def get_desktop_dimensions() -> List[Dict]
```

Get the dimensions of all desktops.

**Returns**:

LTR sorted list of desktop dimensions or None

<a id="cortile/cortile.Cortile.get_screen_dimensions"></a>

#### get\_screen\_dimensions

```python
def get_screen_dimensions() -> List[Dict]
```

Get the dimensions of all screens.

**Returns**:

LTR sorted list of screen dimensions or None

<a id="cortile/cortile.Cortile.get_clients"></a>

#### get\_clients

```python
def get_clients() -> List[Dict]
```

Get all the clients information.

**Returns**:

List of tracked clients or None

<a id="cortile/cortile.Cortile.get_windows"></a>

#### get\_windows

```python
def get_windows() -> Dict | None
```

Get all the windows information.

**Returns**:

List of tracked window ids or None

<a id="cortile/cortile.Cortile.desktop_switch"></a>

#### desktop\_switch

```python
def desktop_switch(desktop: int) -> bool
```

Switch to a different desktop.

**Arguments**:

- `desktop`: Index of the desktop to switch to

**Returns**:

True if successful, False otherwise

<a id="cortile/cortile.Cortile.window_activate"></a>

#### window\_activate

```python
def window_activate(id: int) -> bool
```

Activate a window by its id.

**Arguments**:

- `id`: Id of the window to activate

**Returns**:

True if successful, False otherwise

<a id="cortile/cortile.Cortile.window_to_desktop"></a>

#### window\_to\_desktop

```python
def window_to_desktop(id: int, desktop: int) -> bool
```

Move a window to a different desktop.

**Arguments**:

- `id`: Id of the window to move
- `desktop`: Index of the desktop to move the window to

**Returns**:

True if successful, False otherwise

<a id="cortile/cortile.Cortile.window_to_position"></a>

#### window\_to\_position

```python
def window_to_position(id: int, x: int, y: int) -> bool
```

Move a window to a specific position.

**Arguments**:

- `id`: Id of the window to move
- `x`: X coordinate to move the window to
- `y`: Y coordinate to move the window to

**Returns**:

True if successful, False otherwise

<a id="cortile/cortile.Cortile.window_to_screen"></a>

#### window\_to\_screen

```python
def window_to_screen(id: int, screen: int) -> bool
```

Move a window to a different screen.

**Arguments**:

- `id`: Id of the window to move
- `screen`: Index of the screen to move the window to

**Returns**:

True if successful, False otherwise

<a id="cortile/cortile.Cortile.action_execute_enable"></a>

#### action\_execute\_enable

```python
def action_execute_enable(desktop: int, screen: int) -> bool
```

Execute the `enable` action.

**Arguments**:

- `desktop`: Index of the desktop
- `screen`: Index of the screen

**Returns**:

True if successful, False otherwise

<a id="cortile/cortile.Cortile.action_execute_disable"></a>

#### action\_execute\_disable

```python
def action_execute_disable(desktop: int, screen: int) -> bool
```

Execute the `disable` action.

**Arguments**:

- `desktop`: Index of the desktop
- `screen`: Index of the screen

**Returns**:

True if successful, False otherwise

<a id="cortile/cortile.Cortile.action_execute_toggle"></a>

#### action\_execute\_toggle

```python
def action_execute_toggle(desktop: int, screen: int) -> bool
```

Execute the `toggle` action.

**Arguments**:

- `desktop`: Index of the desktop
- `screen`: Index of the screen

**Returns**:

True if successful, False otherwise

<a id="cortile/cortile.Cortile.action_execute_decoration"></a>

#### action\_execute\_decoration

```python
def action_execute_decoration(desktop: int, screen: int) -> bool
```

Execute the `decoration` action.

**Arguments**:

- `desktop`: Index of the desktop
- `screen`: Index of the screen

**Returns**:

True if successful, False otherwise

<a id="cortile/cortile.Cortile.action_execute_restore"></a>

#### action\_execute\_restore

```python
def action_execute_restore(desktop: int, screen: int) -> bool
```

Execute the `restore` action.

**Arguments**:

- `desktop`: Index of the desktop
- `screen`: Index of the screen

**Returns**:

True if successful, False otherwise

<a id="cortile/cortile.Cortile.action_execute_reset"></a>

#### action\_execute\_reset

```python
def action_execute_reset(desktop: int, screen: int) -> bool
```

Execute the `reset` action.

**Arguments**:

- `desktop`: Index of the desktop
- `screen`: Index of the screen

**Returns**:

True if successful, False otherwise

<a id="cortile/cortile.Cortile.action_execute_cycle_next"></a>

#### action\_execute\_cycle\_next

```python
def action_execute_cycle_next(desktop: int, screen: int) -> bool
```

Execute the `cycle_next` action.

**Arguments**:

- `desktop`: Index of the desktop
- `screen`: Index of the screen

**Returns**:

True if successful, False otherwise

<a id="cortile/cortile.Cortile.action_execute_cycle_previous"></a>

#### action\_execute\_cycle\_previous

```python
def action_execute_cycle_previous(desktop: int, screen: int) -> bool
```

Execute the `cycle_previous` action.

**Arguments**:

- `desktop`: Index of the desktop
- `screen`: Index of the screen

**Returns**:

True if successful, False otherwise

<a id="cortile/cortile.Cortile.action_execute_layout_vertical_left"></a>

#### action\_execute\_layout\_vertical\_left

```python
def action_execute_layout_vertical_left(desktop: int, screen: int) -> bool
```

Execute the `layout_vertical_left` action.

**Arguments**:

- `desktop`: Index of the desktop
- `screen`: Index of the screen

**Returns**:

True if successful, False otherwise

<a id="cortile/cortile.Cortile.action_execute_layout_vertical_right"></a>

#### action\_execute\_layout\_vertical\_right

```python
def action_execute_layout_vertical_right(desktop: int, screen: int) -> bool
```

Execute the `layout_vertical_right` action.

**Arguments**:

- `desktop`: Index of the desktop
- `screen`: Index of the screen

**Returns**:

True if successful, False otherwise

<a id="cortile/cortile.Cortile.action_execute_layout_horizontal_top"></a>

#### action\_execute\_layout\_horizontal\_top

```python
def action_execute_layout_horizontal_top(desktop: int, screen: int) -> bool
```

Execute the `layout_horizontal_top` action.

**Arguments**:

- `desktop`: Index of the desktop
- `screen`: Index of the screen

**Returns**:

True if successful, False otherwise

<a id="cortile/cortile.Cortile.action_execute_layout_horizontal_bottom"></a>

#### action\_execute\_layout\_horizontal\_bottom

```python
def action_execute_layout_horizontal_bottom(desktop: int, screen: int) -> bool
```

Execute the `layout_horizontal_bottom` action.

**Arguments**:

- `desktop`: Index of the desktop
- `screen`: Index of the screen

**Returns**:

True if successful, False otherwise

<a id="cortile/cortile.Cortile.action_execute_layout_maximized"></a>

#### action\_execute\_layout\_maximized

```python
def action_execute_layout_maximized(desktop: int, screen: int) -> bool
```

Execute the `layout_maximized` action.

**Arguments**:

- `desktop`: Index of the desktop
- `screen`: Index of the screen

**Returns**:

True if successful, False otherwise

<a id="cortile/cortile.Cortile.action_execute_layout_fullscreen"></a>

#### action\_execute\_layout\_fullscreen

```python
def action_execute_layout_fullscreen(desktop: int, screen: int) -> bool
```

Execute the `layout_fullscreen` action.

**Arguments**:

- `desktop`: Index of the desktop
- `screen`: Index of the screen

**Returns**:

True if successful, False otherwise

<a id="cortile/cortile.Cortile.action_execute_slave_increase"></a>

#### action\_execute\_slave\_increase

```python
def action_execute_slave_increase(desktop: int, screen: int) -> bool
```

Execute the `slave_increase` action.

**Arguments**:

- `desktop`: Index of the desktop
- `screen`: Index of the screen

**Returns**:

True if successful, False otherwise

<a id="cortile/cortile.Cortile.action_execute_slave_decrease"></a>

#### action\_execute\_slave\_decrease

```python
def action_execute_slave_decrease(desktop: int, screen: int) -> bool
```

Execute the `slave_decrease` action.

**Arguments**:

- `desktop`: Index of the desktop
- `screen`: Index of the screen

**Returns**:

True if successful, False otherwise

<a id="cortile/cortile.Cortile.action_execute_master_increase"></a>

#### action\_execute\_master\_increase

```python
def action_execute_master_increase(desktop: int, screen: int) -> bool
```

Execute the `master_increase` action.

**Arguments**:

- `desktop`: Index of the desktop
- `screen`: Index of the screen

**Returns**:

True if successful, False otherwise

<a id="cortile/cortile.Cortile.action_execute_master_decrease"></a>

#### action\_execute\_master\_decrease

```python
def action_execute_master_decrease(desktop: int, screen: int) -> bool
```

Execute the `master_decrease` action.

**Arguments**:

- `desktop`: Index of the desktop
- `screen`: Index of the screen

**Returns**:

True if successful, False otherwise

<a id="cortile/cortile.Cortile.action_execute_window_next"></a>

#### action\_execute\_window\_next

```python
def action_execute_window_next(desktop: int, screen: int) -> bool
```

Execute the `window_next` action.

**Arguments**:

- `desktop`: Index of the desktop
- `screen`: Index of the screen

**Returns**:

True if successful, False otherwise

<a id="cortile/cortile.Cortile.action_execute_window_previous"></a>

#### action\_execute\_window\_previous

```python
def action_execute_window_previous(desktop: int, screen: int) -> bool
```

Execute the `window_previous` action.

**Arguments**:

- `desktop`: Index of the desktop
- `screen`: Index of the screen

**Returns**:

True if successful, False otherwise

<a id="cortile/cortile.Cortile.action_execute_screen_next"></a>

#### action\_execute\_screen\_next

```python
def action_execute_screen_next(desktop: int, screen: int) -> bool
```

Execute the `screen_next` action.

**Arguments**:

- `desktop`: Index of the desktop
- `screen`: Index of the screen

**Returns**:

True if successful, False otherwise

<a id="cortile/cortile.Cortile.action_execute_screen_previous"></a>

#### action\_execute\_screen\_previous

```python
def action_execute_screen_previous(desktop: int, screen: int) -> bool
```

Execute the `screen_previous` action.

**Arguments**:

- `desktop`: Index of the desktop
- `screen`: Index of the screen

**Returns**:

True if successful, False otherwise

<a id="cortile/cortile.Cortile.action_execute_master_make"></a>

#### action\_execute\_master\_make

```python
def action_execute_master_make(desktop: int, screen: int) -> bool
```

Execute the `master_make` action.

**Arguments**:

- `desktop`: Index of the desktop
- `screen`: Index of the screen

**Returns**:

True if successful, False otherwise

<a id="cortile/cortile.Cortile.action_execute_master_make_next"></a>

#### action\_execute\_master\_make\_next

```python
def action_execute_master_make_next(desktop: int, screen: int) -> bool
```

Execute the `master_make_next` action.

**Arguments**:

- `desktop`: Index of the desktop
- `screen`: Index of the screen

**Returns**:

True if successful, False otherwise

<a id="cortile/cortile.Cortile.action_execute_master_make_previous"></a>

#### action\_execute\_master\_make\_previous

```python
def action_execute_master_make_previous(desktop: int, screen: int) -> bool
```

Execute the `master_make_previous` action.

**Arguments**:

- `desktop`: Index of the desktop
- `screen`: Index of the screen

**Returns**:

True if successful, False otherwise

<a id="cortile/cortile.Cortile.action_execute_proportion_increase"></a>

#### action\_execute\_proportion\_increase

```python
def action_execute_proportion_increase(desktop: int, screen: int) -> bool
```

Execute the `proportion_increase` action.

**Arguments**:

- `desktop`: Index of the desktop
- `screen`: Index of the screen

**Returns**:

True if successful, False otherwise

<a id="cortile/cortile.Cortile.action_execute_proportion_decrease"></a>

#### action\_execute\_proportion\_decrease

```python
def action_execute_proportion_decrease(desktop: int, screen: int) -> bool
```

Execute the `proportion_decrease` action.

**Arguments**:

- `desktop`: Index of the desktop
- `screen`: Index of the screen

**Returns**:

True if successful, False otherwise

</div></details>

## Examples [![examples](https://img.shields.io/badge/scripts-%20Examples%20-blue?style=flat-square)](#examples-)
To help you get started quickly, example scripts are available in the [examples](https://github.com/leukipp/cortile-addons/tree/main/examples) folder.

These scripts demonstrate various use cases and can serve as a practical guide to utilizing the full potential of cortile through python.
Feel free to explore these resources to make the most out of your cortile setup.

## Integration [![integration](https://img.shields.io/github/go-mod/go-version/leukipp/cortile?label=go&style=flat-square)](#integration-)
You can execute a script on demand or trigger it by any other external means.
To ensure a script is activated every time cortile starts, place it in a folder named addons within the cortile configuration directory, e.g. `~/.config/cortile/addons/`.

Any executable script (`chmod +x script_name.py`) in this folder will automatically run when cortile starts.
The script will execute with the same user permission and environment as cortile, so python and additional required dependencies (`pip packages`) must be available in this environment.

The output from python’s `print()` function and error logs within the script will appear in the terminal where cortile is running. Depending on the log level, additional messages from the script will be written to the system log (`cat /var/log/syslog`).

### Compatibility
Since the python integration relies on internal cortile properties and the provided interfaces via dbus, it’s crucial that all custom scripts are compatible with the running cortile instance.

This table provides the officially supported combination of versions:
| Addons (Python) | Cortile (go) |
| --------------- | ------------ |
| v1.0.0          | v2.5.1       |
| v1.0.1          | v2.5.1       |

## Contributing [![contributing](https://img.shields.io/github/issues-pr-closed/leukipp/cortile-addons?style=flat-square)](#contributing-)
Contributions into the [examples](https://github.com/leukipp/cortile-addons/tree/main/examples) folder are greatly welcomed!

If you have a script that could benefit the community, please submit a pull request.
Include a brief explanation of the script in the header comment (refer to existing files for guidance).
The script should be runnable or serve at least as a useful skeleton for others.

## License [![license](https://img.shields.io/github/license/leukipp/cortile-addons?style=flat-square)](#license-)
[MIT](https://github.com/leukipp/cortile-addons/blob/main/LICENSE)

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "cortile",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": null,
    "keywords": "dbus, x11",
    "author": "leukipp",
    "author_email": null,
    "download_url": "https://files.pythonhosted.org/packages/b0/db/cda5d726120d3558599712b854bf3e7c4773872dd569af65a322400d109d/cortile-1.0.1.tar.gz",
    "platform": null,
    "description": "# Cortile Addons\n[![Release](https://github.com/leukipp/cortile-addons/actions/workflows/release.yml/badge.svg)](https://github.com/leukipp/cortile-addons/actions/workflows/release.yml)\n[![PyPI](https://img.shields.io/pypi/v/cortile?label=PyPI%20Package)](https://pypi.org/project/cortile)\n\nPython bindings for the linux auto tiling manager cortile.\n\nCortile provides auto tiling for XFCE, LXDE, LXQt, KDE and GNOME (Mate, Deepin, Cinnamon, Budgie) based desktop environments.\nThere is build in support for Openbox, Fluxbox, IceWM, Xfwm, KWin, Marco, Muffin, Mutter and other EWMH compliant window managers using the X11 window system.\n\nThis package only provides the python bindings and does not contain the cortile release binary.\nTo use this package, you need to install the [binary](https://github.com/leukipp/cortile/releases) from the main repository. For more details, please refer to the cortile [README.md](https://github.com/leukipp/cortile?tab=readme-ov-file#addons-) file.\n\n## Installation [![installation](https://img.shields.io/badge/pip-%20Python%20-red?style=flat-square)](#installation-)\nTo get started, install it via `pip`:\n```bash\npip install cortile\n```\n\n### Usage\nIf cortile is installed and running as described [here](https://github.com/leukipp/cortile?tab=readme-ov-file#installation-), the python bindings will connect to the running instance, allowing you to fully communicate with cortile using python:\n\n```python\nfrom cortile import Cortile\n\n# connects to the running cortile instance\nct = Cortile()\n...\n```\n\n## Documentation [![documentation](https://img.shields.io/badge/docstring-%20PEP%20257%20-yellow?style=flat-square)](#documentation-)\nDocumentation is provided through docstring literals, which appear immediately after the definition of a method, class, or module.\nWhile all methods and classes include docstrings, the primary interface for interacting with a running cortile instance is the `Cortile()` class, which is documented here:\n\n<details><summary>class Cortile()</summary><div>\n\n<a id=\"cortile/cortile.Cortile.__init__\"></a>\n\n#### \\_\\_init\\_\\_\n\n```python\ndef __init__(log: int = Logger.LEVELS.WARN)\n```\n\nInitialize the cortile connector.\n\nThis main class wraps methods of the base connector and should be\nused as primary interface to communicate with a running cortile instance.\n\n**Arguments**:\n\n- `log`: Logging level, default is warn\n\n<a id=\"cortile/cortile.Cortile.log\"></a>\n\n#### log\n\n```python\n@property\ndef log() -> Logger\n```\n\nReturn the logger instance.\n\n**Returns**:\n\nLogger instance that writes to syslog\n\n<a id=\"cortile/cortile.Cortile.listen\"></a>\n\n#### listen\n\n```python\ndef listen(callback: Callable[[Dict], None] | None) -> None\n```\n\nStart listening for events.\n\n**Arguments**:\n\n- `callback`: Function to call when an event is received\n\n<a id=\"cortile/cortile.Cortile.wait\"></a>\n\n#### wait\n\n```python\ndef wait(sleep: float = 0.5) -> None\n```\n\nKeeps the process running for the connector to listen.\n\n**Arguments**:\n\n- `sleep`: Time to sleep in between, default is 0.5 seconds\n\n<a id=\"cortile/cortile.Cortile.close\"></a>\n\n#### close\n\n```python\ndef close() -> None\n```\n\nClose the connection gracefully.\n\n<a id=\"cortile/cortile.Cortile.get_active_layout\"></a>\n\n#### get\\_active\\_layout\n\n```python\ndef get_active_layout() -> Dict | None\n```\n\nGet the active layout for the current desktop and screen.\n\n**Returns**:\n\nActive layout with tiling enabled or None\n\n<a id=\"cortile/cortile.Cortile.get_active_layouts\"></a>\n\n#### get\\_active\\_layouts\n\n```python\ndef get_active_layouts() -> Iterator[Dict]\n```\n\nGet the active layouts from the workspaces.\n\n**Returns**:\n\nIterator of active layouts with tiling enabled\n\n<a id=\"cortile/cortile.Cortile.get_active_client\"></a>\n\n#### get\\_active\\_client\n\n```python\ndef get_active_client() -> Dict | None\n```\n\nGet the current focused client window.\n\n**Returns**:\n\nActive client or None\n\n<a id=\"cortile/cortile.Cortile.get_active_clients\"></a>\n\n#### get\\_active\\_clients\n\n```python\ndef get_active_clients() -> Iterator[Dict]\n```\n\nGet information of clients on the current active screen.\n\n**Returns**:\n\nIterator of tracked clients on the current screen\n\n<a id=\"cortile/cortile.Cortile.get_active_desktop\"></a>\n\n#### get\\_active\\_desktop\n\n```python\ndef get_active_desktop() -> int | None\n```\n\nGet the current active desktop.\n\n**Returns**:\n\nActive desktop index or None\n\n<a id=\"cortile/cortile.Cortile.get_active_screen\"></a>\n\n#### get\\_active\\_screen\n\n```python\ndef get_active_screen() -> int | None\n```\n\nGet the current active screen.\n\n**Returns**:\n\nActive screen index or None\n\n<a id=\"cortile/cortile.Cortile.get_desktop_count\"></a>\n\n#### get\\_desktop\\_count\n\n```python\ndef get_desktop_count() -> int | None\n```\n\nGet the number of desktops.\n\n**Returns**:\n\nNumber of desktops or None\n\n<a id=\"cortile/cortile.Cortile.get_screen_count\"></a>\n\n#### get\\_screen\\_count\n\n```python\ndef get_screen_count() -> int | None\n```\n\nGet the number of screens.\n\n**Returns**:\n\nNumber of screens or None\n\n<a id=\"cortile/cortile.Cortile.get_desktop_dimensions\"></a>\n\n#### get\\_desktop\\_dimensions\n\n```python\ndef get_desktop_dimensions() -> List[Dict]\n```\n\nGet the dimensions of all desktops.\n\n**Returns**:\n\nLTR sorted list of desktop dimensions or None\n\n<a id=\"cortile/cortile.Cortile.get_screen_dimensions\"></a>\n\n#### get\\_screen\\_dimensions\n\n```python\ndef get_screen_dimensions() -> List[Dict]\n```\n\nGet the dimensions of all screens.\n\n**Returns**:\n\nLTR sorted list of screen dimensions or None\n\n<a id=\"cortile/cortile.Cortile.get_clients\"></a>\n\n#### get\\_clients\n\n```python\ndef get_clients() -> List[Dict]\n```\n\nGet all the clients information.\n\n**Returns**:\n\nList of tracked clients or None\n\n<a id=\"cortile/cortile.Cortile.get_windows\"></a>\n\n#### get\\_windows\n\n```python\ndef get_windows() -> Dict | None\n```\n\nGet all the windows information.\n\n**Returns**:\n\nList of tracked window ids or None\n\n<a id=\"cortile/cortile.Cortile.desktop_switch\"></a>\n\n#### desktop\\_switch\n\n```python\ndef desktop_switch(desktop: int) -> bool\n```\n\nSwitch to a different desktop.\n\n**Arguments**:\n\n- `desktop`: Index of the desktop to switch to\n\n**Returns**:\n\nTrue if successful, False otherwise\n\n<a id=\"cortile/cortile.Cortile.window_activate\"></a>\n\n#### window\\_activate\n\n```python\ndef window_activate(id: int) -> bool\n```\n\nActivate a window by its id.\n\n**Arguments**:\n\n- `id`: Id of the window to activate\n\n**Returns**:\n\nTrue if successful, False otherwise\n\n<a id=\"cortile/cortile.Cortile.window_to_desktop\"></a>\n\n#### window\\_to\\_desktop\n\n```python\ndef window_to_desktop(id: int, desktop: int) -> bool\n```\n\nMove a window to a different desktop.\n\n**Arguments**:\n\n- `id`: Id of the window to move\n- `desktop`: Index of the desktop to move the window to\n\n**Returns**:\n\nTrue if successful, False otherwise\n\n<a id=\"cortile/cortile.Cortile.window_to_position\"></a>\n\n#### window\\_to\\_position\n\n```python\ndef window_to_position(id: int, x: int, y: int) -> bool\n```\n\nMove a window to a specific position.\n\n**Arguments**:\n\n- `id`: Id of the window to move\n- `x`: X coordinate to move the window to\n- `y`: Y coordinate to move the window to\n\n**Returns**:\n\nTrue if successful, False otherwise\n\n<a id=\"cortile/cortile.Cortile.window_to_screen\"></a>\n\n#### window\\_to\\_screen\n\n```python\ndef window_to_screen(id: int, screen: int) -> bool\n```\n\nMove a window to a different screen.\n\n**Arguments**:\n\n- `id`: Id of the window to move\n- `screen`: Index of the screen to move the window to\n\n**Returns**:\n\nTrue if successful, False otherwise\n\n<a id=\"cortile/cortile.Cortile.action_execute_enable\"></a>\n\n#### action\\_execute\\_enable\n\n```python\ndef action_execute_enable(desktop: int, screen: int) -> bool\n```\n\nExecute the `enable` action.\n\n**Arguments**:\n\n- `desktop`: Index of the desktop\n- `screen`: Index of the screen\n\n**Returns**:\n\nTrue if successful, False otherwise\n\n<a id=\"cortile/cortile.Cortile.action_execute_disable\"></a>\n\n#### action\\_execute\\_disable\n\n```python\ndef action_execute_disable(desktop: int, screen: int) -> bool\n```\n\nExecute the `disable` action.\n\n**Arguments**:\n\n- `desktop`: Index of the desktop\n- `screen`: Index of the screen\n\n**Returns**:\n\nTrue if successful, False otherwise\n\n<a id=\"cortile/cortile.Cortile.action_execute_toggle\"></a>\n\n#### action\\_execute\\_toggle\n\n```python\ndef action_execute_toggle(desktop: int, screen: int) -> bool\n```\n\nExecute the `toggle` action.\n\n**Arguments**:\n\n- `desktop`: Index of the desktop\n- `screen`: Index of the screen\n\n**Returns**:\n\nTrue if successful, False otherwise\n\n<a id=\"cortile/cortile.Cortile.action_execute_decoration\"></a>\n\n#### action\\_execute\\_decoration\n\n```python\ndef action_execute_decoration(desktop: int, screen: int) -> bool\n```\n\nExecute the `decoration` action.\n\n**Arguments**:\n\n- `desktop`: Index of the desktop\n- `screen`: Index of the screen\n\n**Returns**:\n\nTrue if successful, False otherwise\n\n<a id=\"cortile/cortile.Cortile.action_execute_restore\"></a>\n\n#### action\\_execute\\_restore\n\n```python\ndef action_execute_restore(desktop: int, screen: int) -> bool\n```\n\nExecute the `restore` action.\n\n**Arguments**:\n\n- `desktop`: Index of the desktop\n- `screen`: Index of the screen\n\n**Returns**:\n\nTrue if successful, False otherwise\n\n<a id=\"cortile/cortile.Cortile.action_execute_reset\"></a>\n\n#### action\\_execute\\_reset\n\n```python\ndef action_execute_reset(desktop: int, screen: int) -> bool\n```\n\nExecute the `reset` action.\n\n**Arguments**:\n\n- `desktop`: Index of the desktop\n- `screen`: Index of the screen\n\n**Returns**:\n\nTrue if successful, False otherwise\n\n<a id=\"cortile/cortile.Cortile.action_execute_cycle_next\"></a>\n\n#### action\\_execute\\_cycle\\_next\n\n```python\ndef action_execute_cycle_next(desktop: int, screen: int) -> bool\n```\n\nExecute the `cycle_next` action.\n\n**Arguments**:\n\n- `desktop`: Index of the desktop\n- `screen`: Index of the screen\n\n**Returns**:\n\nTrue if successful, False otherwise\n\n<a id=\"cortile/cortile.Cortile.action_execute_cycle_previous\"></a>\n\n#### action\\_execute\\_cycle\\_previous\n\n```python\ndef action_execute_cycle_previous(desktop: int, screen: int) -> bool\n```\n\nExecute the `cycle_previous` action.\n\n**Arguments**:\n\n- `desktop`: Index of the desktop\n- `screen`: Index of the screen\n\n**Returns**:\n\nTrue if successful, False otherwise\n\n<a id=\"cortile/cortile.Cortile.action_execute_layout_vertical_left\"></a>\n\n#### action\\_execute\\_layout\\_vertical\\_left\n\n```python\ndef action_execute_layout_vertical_left(desktop: int, screen: int) -> bool\n```\n\nExecute the `layout_vertical_left` action.\n\n**Arguments**:\n\n- `desktop`: Index of the desktop\n- `screen`: Index of the screen\n\n**Returns**:\n\nTrue if successful, False otherwise\n\n<a id=\"cortile/cortile.Cortile.action_execute_layout_vertical_right\"></a>\n\n#### action\\_execute\\_layout\\_vertical\\_right\n\n```python\ndef action_execute_layout_vertical_right(desktop: int, screen: int) -> bool\n```\n\nExecute the `layout_vertical_right` action.\n\n**Arguments**:\n\n- `desktop`: Index of the desktop\n- `screen`: Index of the screen\n\n**Returns**:\n\nTrue if successful, False otherwise\n\n<a id=\"cortile/cortile.Cortile.action_execute_layout_horizontal_top\"></a>\n\n#### action\\_execute\\_layout\\_horizontal\\_top\n\n```python\ndef action_execute_layout_horizontal_top(desktop: int, screen: int) -> bool\n```\n\nExecute the `layout_horizontal_top` action.\n\n**Arguments**:\n\n- `desktop`: Index of the desktop\n- `screen`: Index of the screen\n\n**Returns**:\n\nTrue if successful, False otherwise\n\n<a id=\"cortile/cortile.Cortile.action_execute_layout_horizontal_bottom\"></a>\n\n#### action\\_execute\\_layout\\_horizontal\\_bottom\n\n```python\ndef action_execute_layout_horizontal_bottom(desktop: int, screen: int) -> bool\n```\n\nExecute the `layout_horizontal_bottom` action.\n\n**Arguments**:\n\n- `desktop`: Index of the desktop\n- `screen`: Index of the screen\n\n**Returns**:\n\nTrue if successful, False otherwise\n\n<a id=\"cortile/cortile.Cortile.action_execute_layout_maximized\"></a>\n\n#### action\\_execute\\_layout\\_maximized\n\n```python\ndef action_execute_layout_maximized(desktop: int, screen: int) -> bool\n```\n\nExecute the `layout_maximized` action.\n\n**Arguments**:\n\n- `desktop`: Index of the desktop\n- `screen`: Index of the screen\n\n**Returns**:\n\nTrue if successful, False otherwise\n\n<a id=\"cortile/cortile.Cortile.action_execute_layout_fullscreen\"></a>\n\n#### action\\_execute\\_layout\\_fullscreen\n\n```python\ndef action_execute_layout_fullscreen(desktop: int, screen: int) -> bool\n```\n\nExecute the `layout_fullscreen` action.\n\n**Arguments**:\n\n- `desktop`: Index of the desktop\n- `screen`: Index of the screen\n\n**Returns**:\n\nTrue if successful, False otherwise\n\n<a id=\"cortile/cortile.Cortile.action_execute_slave_increase\"></a>\n\n#### action\\_execute\\_slave\\_increase\n\n```python\ndef action_execute_slave_increase(desktop: int, screen: int) -> bool\n```\n\nExecute the `slave_increase` action.\n\n**Arguments**:\n\n- `desktop`: Index of the desktop\n- `screen`: Index of the screen\n\n**Returns**:\n\nTrue if successful, False otherwise\n\n<a id=\"cortile/cortile.Cortile.action_execute_slave_decrease\"></a>\n\n#### action\\_execute\\_slave\\_decrease\n\n```python\ndef action_execute_slave_decrease(desktop: int, screen: int) -> bool\n```\n\nExecute the `slave_decrease` action.\n\n**Arguments**:\n\n- `desktop`: Index of the desktop\n- `screen`: Index of the screen\n\n**Returns**:\n\nTrue if successful, False otherwise\n\n<a id=\"cortile/cortile.Cortile.action_execute_master_increase\"></a>\n\n#### action\\_execute\\_master\\_increase\n\n```python\ndef action_execute_master_increase(desktop: int, screen: int) -> bool\n```\n\nExecute the `master_increase` action.\n\n**Arguments**:\n\n- `desktop`: Index of the desktop\n- `screen`: Index of the screen\n\n**Returns**:\n\nTrue if successful, False otherwise\n\n<a id=\"cortile/cortile.Cortile.action_execute_master_decrease\"></a>\n\n#### action\\_execute\\_master\\_decrease\n\n```python\ndef action_execute_master_decrease(desktop: int, screen: int) -> bool\n```\n\nExecute the `master_decrease` action.\n\n**Arguments**:\n\n- `desktop`: Index of the desktop\n- `screen`: Index of the screen\n\n**Returns**:\n\nTrue if successful, False otherwise\n\n<a id=\"cortile/cortile.Cortile.action_execute_window_next\"></a>\n\n#### action\\_execute\\_window\\_next\n\n```python\ndef action_execute_window_next(desktop: int, screen: int) -> bool\n```\n\nExecute the `window_next` action.\n\n**Arguments**:\n\n- `desktop`: Index of the desktop\n- `screen`: Index of the screen\n\n**Returns**:\n\nTrue if successful, False otherwise\n\n<a id=\"cortile/cortile.Cortile.action_execute_window_previous\"></a>\n\n#### action\\_execute\\_window\\_previous\n\n```python\ndef action_execute_window_previous(desktop: int, screen: int) -> bool\n```\n\nExecute the `window_previous` action.\n\n**Arguments**:\n\n- `desktop`: Index of the desktop\n- `screen`: Index of the screen\n\n**Returns**:\n\nTrue if successful, False otherwise\n\n<a id=\"cortile/cortile.Cortile.action_execute_screen_next\"></a>\n\n#### action\\_execute\\_screen\\_next\n\n```python\ndef action_execute_screen_next(desktop: int, screen: int) -> bool\n```\n\nExecute the `screen_next` action.\n\n**Arguments**:\n\n- `desktop`: Index of the desktop\n- `screen`: Index of the screen\n\n**Returns**:\n\nTrue if successful, False otherwise\n\n<a id=\"cortile/cortile.Cortile.action_execute_screen_previous\"></a>\n\n#### action\\_execute\\_screen\\_previous\n\n```python\ndef action_execute_screen_previous(desktop: int, screen: int) -> bool\n```\n\nExecute the `screen_previous` action.\n\n**Arguments**:\n\n- `desktop`: Index of the desktop\n- `screen`: Index of the screen\n\n**Returns**:\n\nTrue if successful, False otherwise\n\n<a id=\"cortile/cortile.Cortile.action_execute_master_make\"></a>\n\n#### action\\_execute\\_master\\_make\n\n```python\ndef action_execute_master_make(desktop: int, screen: int) -> bool\n```\n\nExecute the `master_make` action.\n\n**Arguments**:\n\n- `desktop`: Index of the desktop\n- `screen`: Index of the screen\n\n**Returns**:\n\nTrue if successful, False otherwise\n\n<a id=\"cortile/cortile.Cortile.action_execute_master_make_next\"></a>\n\n#### action\\_execute\\_master\\_make\\_next\n\n```python\ndef action_execute_master_make_next(desktop: int, screen: int) -> bool\n```\n\nExecute the `master_make_next` action.\n\n**Arguments**:\n\n- `desktop`: Index of the desktop\n- `screen`: Index of the screen\n\n**Returns**:\n\nTrue if successful, False otherwise\n\n<a id=\"cortile/cortile.Cortile.action_execute_master_make_previous\"></a>\n\n#### action\\_execute\\_master\\_make\\_previous\n\n```python\ndef action_execute_master_make_previous(desktop: int, screen: int) -> bool\n```\n\nExecute the `master_make_previous` action.\n\n**Arguments**:\n\n- `desktop`: Index of the desktop\n- `screen`: Index of the screen\n\n**Returns**:\n\nTrue if successful, False otherwise\n\n<a id=\"cortile/cortile.Cortile.action_execute_proportion_increase\"></a>\n\n#### action\\_execute\\_proportion\\_increase\n\n```python\ndef action_execute_proportion_increase(desktop: int, screen: int) -> bool\n```\n\nExecute the `proportion_increase` action.\n\n**Arguments**:\n\n- `desktop`: Index of the desktop\n- `screen`: Index of the screen\n\n**Returns**:\n\nTrue if successful, False otherwise\n\n<a id=\"cortile/cortile.Cortile.action_execute_proportion_decrease\"></a>\n\n#### action\\_execute\\_proportion\\_decrease\n\n```python\ndef action_execute_proportion_decrease(desktop: int, screen: int) -> bool\n```\n\nExecute the `proportion_decrease` action.\n\n**Arguments**:\n\n- `desktop`: Index of the desktop\n- `screen`: Index of the screen\n\n**Returns**:\n\nTrue if successful, False otherwise\n\n</div></details>\n\n## Examples [![examples](https://img.shields.io/badge/scripts-%20Examples%20-blue?style=flat-square)](#examples-)\nTo help you get started quickly, example scripts are available in the [examples](https://github.com/leukipp/cortile-addons/tree/main/examples) folder.\n\nThese scripts demonstrate various use cases and can serve as a practical guide to utilizing the full potential of cortile through python.\nFeel free to explore these resources to make the most out of your cortile setup.\n\n## Integration [![integration](https://img.shields.io/github/go-mod/go-version/leukipp/cortile?label=go&style=flat-square)](#integration-)\nYou can execute a script on demand or trigger it by any other external means.\nTo ensure a script is activated every time cortile starts, place it in a folder named addons within the cortile configuration directory, e.g. `~/.config/cortile/addons/`.\n\nAny executable script (`chmod +x script_name.py`) in this folder will automatically run when cortile starts.\nThe script will execute with the same user permission and environment as cortile, so python and additional required dependencies (`pip packages`) must be available in this environment.\n\nThe output from python\u2019s `print()` function and error logs within the script will appear in the terminal where cortile is running. Depending on the log level, additional messages from the script will be written to the system log (`cat /var/log/syslog`).\n\n### Compatibility\nSince the python integration relies on internal cortile properties and the provided interfaces via dbus, it\u2019s crucial that all custom scripts are compatible with the running cortile instance.\n\nThis table provides the officially supported combination of versions:\n| Addons (Python) | Cortile (go) |\n| --------------- | ------------ |\n| v1.0.0          | v2.5.1       |\n| v1.0.1          | v2.5.1       |\n\n## Contributing [![contributing](https://img.shields.io/github/issues-pr-closed/leukipp/cortile-addons?style=flat-square)](#contributing-)\nContributions into the [examples](https://github.com/leukipp/cortile-addons/tree/main/examples) folder are greatly welcomed!\n\nIf you have a script that could benefit the community, please submit a pull request.\nInclude a brief explanation of the script in the header comment (refer to existing files for guidance).\nThe script should be runnable or serve at least as a useful skeleton for others.\n\n## License [![license](https://img.shields.io/github/license/leukipp/cortile-addons?style=flat-square)](#license-)\n[MIT](https://github.com/leukipp/cortile-addons/blob/main/LICENSE)\n",
    "bugtrack_url": null,
    "license": "MIT License  Copyright (c) 2024 leukipp  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:  The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.  THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.",
    "summary": "Python bindings for the linux auto tiling manager cortile.",
    "version": "1.0.1",
    "project_urls": {
        "Homepage": "https://github.com/leukipp/cortile",
        "Repository": "https://github.com/leukipp/cortile-addons"
    },
    "split_keywords": [
        "dbus",
        " x11"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "562c470c239c0798ab27b0976f73f29675ba727f85daed48a64f1cb607c8d33d",
                "md5": "3b2dff45486c2e8315ae48af61f50572",
                "sha256": "3ea89f1838218326e557b092e7adc8716e8f894dafff0d24a8d520c173eb1287"
            },
            "downloads": -1,
            "filename": "cortile-1.0.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "3b2dff45486c2e8315ae48af61f50572",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 16171,
            "upload_time": "2024-08-17T14:16:09",
            "upload_time_iso_8601": "2024-08-17T14:16:09.537928Z",
            "url": "https://files.pythonhosted.org/packages/56/2c/470c239c0798ab27b0976f73f29675ba727f85daed48a64f1cb607c8d33d/cortile-1.0.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "b0dbcda5d726120d3558599712b854bf3e7c4773872dd569af65a322400d109d",
                "md5": "c32ddb94acfbe2f4ddd761398743b08a",
                "sha256": "543ce1a0451badfbe827b3c027eaa0a1a48b9c12a3e5e8b91d32fb659340cfc8"
            },
            "downloads": -1,
            "filename": "cortile-1.0.1.tar.gz",
            "has_sig": false,
            "md5_digest": "c32ddb94acfbe2f4ddd761398743b08a",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 16891,
            "upload_time": "2024-08-17T14:16:10",
            "upload_time_iso_8601": "2024-08-17T14:16:10.853573Z",
            "url": "https://files.pythonhosted.org/packages/b0/db/cda5d726120d3558599712b854bf3e7c4773872dd569af65a322400d109d/cortile-1.0.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-08-17 14:16:10",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "leukipp",
    "github_project": "cortile",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "cortile"
}
        
Elapsed time: 0.83511s