A simple way to start Steam big picture when your wireless controller is turned on.
- Have steam installed
- Have your bluetooth controller pair with your PC and steam
- Install
bluez-tools
$ apt-get install bluez-tools
- Create a file to store the script somewhere in your home folder:
$ touch ~/bluetooth-to-steam-linux.sh
$ nano ~/bluetooth-to-steam-linux.sh
- Paste the following script into it (exit with Control + X)
#!/bin/sh
case $(bt-device -i "Wireless Controller" | grep "Connected" | grep -Eo '[0-1]+$') in 1)
echo Controller detected
if ps aux | grep "$whoami" | grep "/bin/sh" | grep "/usr/games/steam"; then
echo Steam detected, doing nothing
else
echo Steam not detected
DISPLAY=:0.0 /usr/games/steam -bigpicture
fi
esac
- Make it runnable:
$ chmod +x ~/bluetooth-to-steam-linux
- Enter in your cronjob:
$ crontab -e
- Select
nano
in case is your first time running this command - Append to the end of the file. Note, replace with your username.
* * * * * /bin/sh /home/<user>/bluetooth-to-steam-linux.sh >/dev/null 2>&1
I only tested this on my own computer running Linux Mint 19.