Skip to content

mofumii/AirController

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AirController for Linux

AirController is a tool that automatically switches your AirPods between mono and stereo modes.

🐧 Note: AirController is designed to work on Linux systems using PulseAudio/PipeWire and pactl. It is not compatible with Windows or macOS.

Features

  • Detects AirPods status in real-time
  • Switches to mono mode when one earbud is missing or charging
  • Switches to stereo when both earbuds are in User
  • Can be ran as background process

Installation

  1. Clone the repositor:
git clone https://github.com/mofumii/AirController
  1. Install dependencies
pip install -r requirements.txt

Running as a service

  1. Create a systemd service file (as root):
# /etc/systemd/system/aircontroller.service
[Unit]
Description=AirPods Channel Controller
After=network.target sound.target

[Service]
ExecStart=/usr/bin/python3 /PATH/TO/AirController/main.py
WorkingDirectory=/PATH/TO/AirController
StandardOutput=append:/tmp/aircontroller.out
StandardError=append:/tmp/aircontroller.err
Restart=on-failure
RestartSec=3
User=yourusername
Environment=PYTHONUNBUFFERED=1

[Install]
WantedBy=default.target

Change /PATH/TO/AirContoller to actual path

  1. Reload and start the service:
sudo systemctl daemon-reexec
sudo systemctl start aircontroller
  1. Enable service on boot:
sudo systemctl enable aircontroller

Configuration

  • You can customize timeouts and sink names by editing variables inside main.py
  • Default polling interval: 2 seconds.

Troubleshooting

  • Make sure pactl and PulseAudio/PipeWire are installed.
  • Make sure you are using Bleak 0.13.0
  • Ensure your user has permission to acces bluetooth devices.
  • Check if your AirPods are visible via bluetoothctl or similar tools.

Contributing

Pull requests are welcome!

If you encounter any issues or bugs, feel free to open an issue or contact me directly

Thank you for your input!

License

This project includes code from the AirStatus project (GPLv3).
Therefore, this project is licensed under the GNU General Public License v3.0. See the LICENSE file for details.

About

Switches AirPods between mono and stereo modes

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages