An open API service indexing awesome lists of open source software.

https://github.com/vahor/organizer-py


https://github.com/vahor/organizer-py

macos python yabai

Last synced: 2 months ago
JSON representation

Awesome Lists containing this project

README

          

# Organizer

Organizer is a Python tool to focus your windows with keyboard shortcuts on macOS.

**Example:** Open Firefox by pressing `ctrl+1`, discord by pressing `ctrl+2`, etc, and go back to the previous window by pressing `page_down`.

![Preview](https://github.com/user-attachments/assets/5cab85de-d330-4a16-a393-d29ddf6316a3)

## Requirements

- Python 3.10+
- Yabai: https://github.com/koekeishiya/yabai
- Poetry: https://python-poetry.org/docs/ _(optional, you can use `pip` instead and install the dependencies manually)_

## How to use

1. Clone the repository
2. `uv pip install -r requirements.txt`
3. `source .venv/bin/activate`
4. `python src/app.py`
5. Configure the shortcuts in `config.toml`

## Configuration

Edit the `config.toml` file to configure the shortcuts.

```toml title="config.toml"
[shortcut]
next = "+1"
prev = "+2"
1 = "+1"
2 = "+2"
3 = "+3"
4 = "+4"
5 = "+5"
6 = "+6"
7 = "+7"
8 = "+8"
9 = "+9"

[organizer.1]
app_name = "firefox"
title = "vahor"

[organizer.2]
app_name = "discord"

[organizer.3]
title = "spotify"
```

Here's a description of the configuration options:

| Block | Field | Description |
| --- | --- | --- |
| `shortcut` | next | The keyboard shortcut to switch to the next window. |
| `shortcut` | prev | The keyboard shortcut to switch to the previous window. |
| `shortcut` | `[number]` | The keyboard shortcut to switch to the specified window. |
| `organizer.[number]` | app_name? | The name of the application. |
| `organizer.[number]` | title? | The title of the window. |

The tool will search open windows for the specified application and title, and switch to the first one it finds.\
`app_name` and `title` are optional, and can be used to narrow down the search.\
`number` is the order in which the windows will be switched, should be unique.

You can find a full list of keyboard shortcuts [here](https://pynput.readthedocs.io/en/latest/keyboard.html#pynput.keyboard.Key).