Last active
April 23, 2025 19:56
-
-
Save rickselby/5c706c5071964b606aff2720ef660664 to your computer and use it in GitHub Desktop.
Auto disable steam deck controller when bluetooth controller is connected
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| #Steam Deck Auto Disable Steam Controller by scawp | |
| #License: DBAD: https://github.com/scawp/Steam-Deck.Auto-Disable-Steam-Controller/blob/main/LICENSE.md | |
| #Source: https://github.com/scawp/Steam-Deck.Auto-Disable-Steam-Controller | |
| # Use at own Risk! | |
| # Modified to skip questions and install as I want it | |
| #curl -sSL https://raw.githubusercontent.com/scawp/Auto-Disable-Steam-Controller/curl_install.sh | bash | |
| #stop running script if anything returns an error (non-zero exit ) | |
| set -e | |
| repo_url="https://raw.githubusercontent.com/scawp/Steam-Deck.Auto-Disable-Steam-Controller/main" | |
| tmp_dir="/tmp/scawp.SDADSC.install" | |
| rules_install_dir="/etc/udev/rules.d" | |
| script_install_dir="/home/deck/.local/share/scawp/SDADSC" | |
| # for debugging installer | |
| #rules_install_dir="$tmp_dir/script" | |
| #script_install_dir="$tmp_dir/script" | |
| device_name="$(uname --nodename)" | |
| echo "Making tmp folder $tmp_dir" | |
| mkdir -p "$tmp_dir" | |
| echo "Downloading Required Files" | |
| curl -o "$tmp_dir/disable_steam_input.sh" "$repo_url/disable_steam_input.sh" | |
| echo "Making script folder $script_install_dir" | |
| mkdir -p "$script_install_dir" | |
| echo "Copying $tmp_dir/disable_steam_input.sh to $script_install_dir/disable_steam_input.sh" | |
| sudo cp "$tmp_dir/disable_steam_input.sh" "$script_install_dir/disable_steam_input.sh" | |
| echo "Adding Execute and Removing Write Permissions" | |
| sudo chmod 555 $script_install_dir/disable_steam_input.sh | |
| #remove old installed files if found | |
| if [ -f "$script_install_dir/conf" ]; then | |
| echo "deleting old install files" | |
| sudo rm "$script_install_dir/conf/simple_device_list.txt" | |
| sudo rm -d "$script_install_dir/conf" | |
| fi | |
| if [ -f "$rules_install_dir/99-disable-steam-input.rules" ]; then | |
| echo "Removing old rule" | |
| sudo rm "$rules_install_dir/99-disable-steam-input.rules" | |
| fi | |
| echo "Add Controller Rules" | |
| echo 'KERNEL=="input*", SUBSYSTEM=="input", ENV{ID_INPUT_JOYSTICK}=="1", ACTION=="add", RUN+="/home/deck/.local/share/scawp/SDADSC/disable_steam_input.sh disable %k %E{NAME} %E{UNIQ} %E{PRODUCT}"' | sudo tee -a "$rules_install_dir/99-disable-steam-input.rules" | |
| echo 'KERNEL=="input*", SUBSYSTEM=="input", ENV{ID_INPUT_JOYSTICK}=="1", ACTION=="remove", RUN+="/home/deck/.local/share/scawp/SDADSC/disable_steam_input.sh enable %k %E{NAME} %E{UNIQ} %E{PRODUCT}"' | sudo tee -a "$rules_install_dir/99-disable-steam-input.rules" | |
| echo "Reloading Services" | |
| sudo udevadm control --reload | |
| echo "Done." |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment