mirror of
https://github.com/kavishdevar/librepods.git
synced 2026-04-28 00:56:07 +00:00
added readme
This commit is contained in:
39
README.md
39
README.md
@@ -1,2 +1,37 @@
|
|||||||
# ALN
|
# ALN - AirPods like Normal (Linux Only)
|
||||||
AirPods like Normal
|
|
||||||
|
# Get Started!
|
||||||
|
|
||||||
|
## 1. Install the required packages
|
||||||
|
|
||||||
|
```bash
|
||||||
|
sudo apt install python3 python3-pip
|
||||||
|
pip3 install pybluez
|
||||||
|
```
|
||||||
|
|
||||||
|
## 2. Clone the repository
|
||||||
|
|
||||||
|
```bash
|
||||||
|
git clone https://github.com/kavishdevar/aln.git
|
||||||
|
cd aln
|
||||||
|
```
|
||||||
|
|
||||||
|
## 3. Preprare
|
||||||
|
Pair your AirPods with your machine before running this script!
|
||||||
|
:warning: **Note:** DO NOT FORGET TO EDIT THE `MAC_ADDRESS` VARIABLE IN `main.py`/`standalone.py` WITH YOUR AIRPODS MAC ADDRESS!
|
||||||
|
|
||||||
|
## 4. Run!
|
||||||
|
You can either choose the more polished version of the script, which currently only supports fetching the battery percentage, and in-ear status (but not actually controlling the media with that information), or the more experimental standalone version of the script, which supports the following features:
|
||||||
|
- Controlling the media with the in-ear status
|
||||||
|
- Remove the device as an audio sink when the AirPods are not in your ears.
|
||||||
|
- Try to connect with the AirPods if media is playing and the AirPods are not connected.
|
||||||
|
|
||||||
|
### Polished version
|
||||||
|
```bash
|
||||||
|
python3 main.py
|
||||||
|
```
|
||||||
|
|
||||||
|
### Experimental version
|
||||||
|
```bash
|
||||||
|
python3 standalone.py
|
||||||
|
```
|
||||||
@@ -243,8 +243,13 @@ def connect_bluetooth_device():
|
|||||||
print("AirPods are already connected.")
|
print("AirPods are already connected.")
|
||||||
return
|
return
|
||||||
|
|
||||||
print("Connecting to AirPods...")
|
print("Checking if AirPods are available...")
|
||||||
subprocess.run(["bluetoothctl", "connect", AIRPODS_MAC])
|
result = subprocess.run(["bluetoothctl", "devices"], capture_output=True, text=True)
|
||||||
|
if AIRPODS_MAC in result.stdout:
|
||||||
|
print("AirPods are available. Connecting...")
|
||||||
|
subprocess.run(["bluetoothctl", "connect", AIRPODS_MAC])
|
||||||
|
else:
|
||||||
|
print("AirPods are not available.")
|
||||||
|
|
||||||
time.sleep(2) # Wait for the connection to establish
|
time.sleep(2) # Wait for the connection to establish
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user