- The device(s) MAC-address
- Apple Magic Mouse 1 or 2
- Ubuntu 18.04 (Maybe 20.04?)
1. Download or copy the scroll.sh file
2. Run the following commands:
Run the script using sudo, this is required in order to control the bluetooth service, otherwise the script will fail.
$ chmod +x ./scroll.sh
$ sudo ./scroll.sh
3. Adding multiple devices (optional):
In order to add multiple devices add the following code after line 4 (repeat for each connected bluetooth device):
sleep 1s
echo 'connect MAC-ADDRESS-OF-DEVICE' | bluetoothctl
sleep 5s
If you are using multiple bluetooth devices, add each separate device to the script. Since the script will disconnect all current devices.
- Adding a simple alias for the script like alias scroll='/path/to/script/scroll.sh' to the .bashrc file.
- Place the file in the user's root folder ~/scroll.sh.
- Add the script to a cron-job, preferably on boot with the crontab -e command. Add @reboot PATH/TO/SCRIPT to the bottom of the script.