add tray app and update README

This commit is contained in:
Kavish Devar
2024-09-29 02:48:48 +05:30
parent 8115328ac5
commit 801d300be1
13 changed files with 202 additions and 27 deletions

View File

@@ -1,7 +1,4 @@
# ALN - AirPods like Normal (Linux Only)
![Main Demo (Screenshot 2024-09-27 at 3 06 56AM)](https://github.com/user-attachments/assets/352275c8-e143-42c3-a06a-fc3ac0c937b9)
# Get Started!
## 1. Install the required packages
@@ -40,6 +37,7 @@ python3 examples/logger-and-anc.py
```
## As a daemon (using a UNIX socket)
![Daemon Log Screenshot](imgs/daemon-log.png | width=300)
If you want to run a deamon for multiple programs to read/write airpods data, you can use the `airpods_daemon.py` script.
- This creates a standard UNIX socket at `/tmp/airpods_daemon.sock` and listens for commands
- and sends battery/in-ear info
@@ -50,7 +48,7 @@ python3 airpods_daemon.py
```
## Interacting with the daemon
![Set ANC Screenshot](imgs/set-anc.png | width=300)
- Sending data to the daemon
You can send data to the daemon using the `set-anc.py` script. Since it's a standard UNIX socket, you can send data to it using any programming language that supports UNIX sockets.
@@ -61,19 +59,31 @@ python3 examples/daemon/set-anc.py
```
- Reading data from the daemon
You can listen to the daemon's output by running the `example_daemon_read.py` script. This script listens to the UNIX socket and prints the data it receives. Currenty, it only prints the battery percentage and the in-ear status.
![Read Data Screenshot](imgs/read-data.png | width=300)
You can listen to the daemon's output by running the `read-data.py` script. This script listens to the UNIX socket and prints the data it receives. Currenty, it recognizes the battery percentage and the in-ear status and dumps the rest of the data to the terminal.
```bash
python3 examples/daemon/example_daemon_read.py
python3 examples/daemon/read-data.py
```
- Controlling the media with the in-ear status (and get battery status)
![Ear Detection Screenshot](imgs/ear-detection.png | width=300)
This script is basically the standalone script, but interacts with the UNIX socket created by the daemon instead. It can control the media with the in-ear status and remove the device as an audio sink when the AirPods are not in your ears.
```bash
python3 examples/daemon/ear-detection.py
```
- App Indicator/Tray Icon
![Tray Icon Hover Screenshot](imgs/tray-icon-hover.png)
![Tray Icon Menu Screenshot](imgs/tray-icon-menu.png)
This script is a simple tray icon that shows the battery percentage and set ANC modes.
> Note: This script uses QT.
```bash
python3 examples/daemon/tray.py
```
## Standalone version (without module dependency, mainly for testing, and reverse engineering purposes)
- Controlling the media with the in-ear status.
- Remove the device as an audio sink when the AirPods are not in your ears.