Using Google Stadia controllers with bluetooth is notoriously a pain. Some just won't reconnect after they've been paired initially. This script is an attempt to solve that issue in Linux. You can create a .desktop
file and have it autostart when you boot your computer.
Every 60 seconds it will look at the list of the controllers that you have paired previously and compare that with the list of controllers that are currently connected. It will take the diff of that and attempt to connect to each one.
#!/bin/bash
# Function to get currently connected Stadia controllers
get_connected_controllers() {
local devices="$1"