https://github.com/wayfirewm/pywayfire
Python bindings for Wayfire's IPC
https://github.com/wayfirewm/pywayfire
Last synced: about 2 months ago
JSON representation
Python bindings for Wayfire's IPC
- Host: GitHub
- URL: https://github.com/wayfirewm/pywayfire
- Owner: WayfireWM
- License: mit
- Created: 2024-06-28T11:00:59.000Z (11 months ago)
- Default Branch: main
- Last Pushed: 2025-03-25T20:50:58.000Z (about 2 months ago)
- Last Synced: 2025-04-07T09:40:00.238Z (about 2 months ago)
- Language: Python
- Size: 329 KB
- Stars: 11
- Watchers: 3
- Forks: 6
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: license
Awesome Lists containing this project
README
The [Wayfire] compositor provides access to its functionalities via Inter-Process Communication (IPC). This repository contains the source code for the python client bindings, as well as hosts many examples of how to use the IPC.
## Quickstart
### Installation
```
Python
pip install wayfireAUR
yay -S python-wayfire
```OR
```
git clone https://github.com/WayfireWM/pywayfire
cd pywayfire
python3 -m pip install .
```### Configure wayfire.ini
Activate following plugins. `stipc` only needed when `wayfire.extra.stipc` is used.
```ini
[core]
plugins = \
ipc \
ipc-rules \
stipc
...
```### Usage examples
Basic usage is simple, import the `wayfire.ipc` module, create a socket (it will auto-detect the compositor by using the `WAYFIRE_SOCKET` environment variable) and call its functions:
```py
from wayfire import WayfireSocketsocket = WayfireSocket()
print(socket.list_views())
```Many examples can be found in the `scripts` directory.
## Troubleshooting
**"Failed to find a suitable Wayfire socket!"**
Make sure `ipc` and `ip-rules` plugins are activated. Try running with environmental variable:
`WAYFIRE_SOCKET=/run/user/$(id -u)/wayland-1`