This project allows the usage of an Apple TV Siri Remote with Linux.
Do you have an old remote lying around and would like to control your linux machine with it? Then this is for you. This python program connects to and intercepts the data from a SiriRemote over bluetooth and does something useful with it, like change the volume or control media. Even the touchpad is working and if you know a bit of python, you can basically do anything with it.
Supported models (check which one you have):
- 1st gen
- 2nd gen
- 3rd gen
sudo apt install -y git libglib2.0-dev libbluetooth-dev
git clone https://github.com/retsyx/SiriRemote
python -m venv SiriRemote
cd SiriRemote
source bin/activate
pip install bluepy3 evdev
python -c 'import bluepy3.btle'
Run pair_tool.py as root, and follow the prompts:
sudo `which python` pair_tool.py
After pairing, note the displayed MAC address, as it is required in the next steps.
If you forget the MAC address, use this command to list the MAC addresses of all paired Bluetooth devices:
bluetoothctl devices Paired
To unpair a remote use this command:
bluetoothctl remove <MAC address>
This will connect to the remote and simulate an input device for your machine.
Run the main program:
sudo `which python` ./main.py <MAC address>
Press any button on the remote, and you should now be able to control the volume, media and the mouse cursor (menu / airplay = prev. / next song). The remote will disconnect after a while of inactivity but as soon as you press any button it will reconnect.
This repo provides a SiriRemote class which you can use to easily interface with the remote and receive button and touchpad events. You can see a simple example for it in echo_test.py.
Check out Jack-R1's repos for more information about the audio data itself.