Giter Club home page Giter Club logo

steam-deck.auto-disable-steam-controller's People

Contributors

lichlord91 avatar scawp avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

steam-deck.auto-disable-steam-controller's Issues

Can‘t add mouse and keyboard to list (script not working)

I followed the instrctions but adding the names from ‚lsusb‘ and ‚bluetoothctl devices‘, didn’t work. The script is just working with the default controller like the xbox controller but not with my mouse and keyboard. Is there any way, to find out the correct name?
It‘s a mouse and keyboard from logitech with a dongle (one dongle for each)

I added both Logitech names and ‚Mx Keys‘ from ‚bluetoothctl devices‘
image

image

Official Steam Controller not being recognized...

Any help on getting this to work for the official Steam controller as despite installing and the controller being in the simple devices list txt my stardew still won’t auto switch to it…I've uninstalled and reinstalled multiple times but no luck. Thank you for making this script and I'd appreciate any help you can give me.

Adding devices only seems to work for bluetooth

When I try to add 8BitDo 8BitDo Ultimate wireless Controller for PC to the simple_device_list.txt it doesn't seem to disable steam input unless I have a USB cable connecting the controller to the steam deck. But this is a wireless dongle controller.

Auto Enable on Restart

Hello,

Am I safe in assuming that restarting the Steam Deck for any reason (including software updates) disables the script and requires re-enabling it in the Konsole? It seems to work smoothly until I do have to do those random restarts, but standby seems to be okay.

That asked, is there a way the script can always enable itself (with user permission enabled first) upon a power cycle? Considering you have to go into the desktop mode to get it running each time, it'd be nice to just let it fire up by itself.

Updated version

Hey! Not sure if my comments triggered your activity yesterday. Either way, it looks like a good idea to simply trigger for any controller.

I was actually working on the script today as well (before seeing your update). It still uses the whitelist but adds new devices to it automatically. Compared to your new version, I like the logging of mine and the fact that the bus IDs are no longer hard coded (the USB device IDs are, though).

Pick whatever you want from my version. Also feel free to close this issue.

Also letting you know that @TacticalLaptopBag wrapped a Decky plugin around this (that still needs some work): decky-controller-dock. There's a discussion on Discord about it: https://discord.com/channels/960281551428522045/1197141225967468615 (Decky Loader Discord)

The human readable logging and auto-adding of new devices was intended to let the Decky plugin show it in the UI and create checkboxes for each entry in the whitelist.

# /etc/udev/rules.d/
KERNEL=="input*", SUBSYSTEM=="input", ACTION=="add", RUN+="/home/deck/.local/share/scawp/SDADSC/disable_steam_input.sh disable %E{NAME} %E{PRODUCT}"
KERNEL=="input*", SUBSYSTEM=="input", ACTION=="remove", RUN+="/home/deck/.local/share/scawp/SDADSC/disable_steam_input.sh enable %E{NAME} %E{PRODUCT}"
#!/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!

set -e

script_install_dir="/home/deck/.local/share/scawp/SDADSC"
conf_dir="$script_install_dir/conf"
tmp_dir="/tmp/scawp/SDADSC"

mkdir -p "$tmp_dir" "$conf_dir"

debug=0
action="$1"
device_name=$(sed 's/[.[\*^$]/_/g' <<<"$2")

if [ "$3" = "3/28de/11ff/1" ] || [ "$3" = "3/28de/1205/111" ]; then
  #Steam converts all inputs to virtual 360 pads with id 3/28de/11ff/1 (I hope!) and its own inputs have id 3/28de/1205/111, ignore.
  [ "$debug" = 1 ] && echo "$(date +'%F %T') - $1 - $2 ($device_name) - $3 --- IGNORING" >> "$script_install_dir/debug.log"
  exit 0
else
  [ "$debug" = 1 ] && echo "$(date +'%F %T') - $1 - $2 ($device_name) - $3" >> "$script_install_dir/debug.log"
fi

if [ ! -f "$conf_dir/disabled" ]; then
  if [ "$action" = "disable" ] && grep -q "^$device_name$" "$conf_dir/simple_device_list.txt"; then
    if [ ! -f "$tmp_dir/controller_id.txt" ]; then
      echo "$(date +'%F %T') - Disabling internal controller because '$device_name' was connected." >> "$script_install_dir/action.log"
      echo /sys/bus/usb/drivers/usbhid/*/0003:28DE:1205.* | grep -Po '[0-9]+-[0-9]+:[0-9]+.[0-9]+' | sort -u | tee "$tmp_dir/unbound_ids.txt" | while read LINE; do
        echo $LINE > /sys/bus/usb/drivers/usbhid/unbind
      done
    else
      echo "$(date +'%F %T') - '$device_name' was connected but internal controller is already disabled. Adding to wait list." >> "$script_install_dir/action.log"
    fi
    echo "$device_name" >> "$tmp_dir/controller_id.txt"

  elif [ "$action" = "enable" ] && [ -f "$tmp_dir/controller_id.txt" ] && grep -qi "^$device_name$" "$tmp_dir/controller_id.txt"; then
    sed -i "0,/^$device_name$/{//d}" "$tmp_dir/controller_id.txt"

    if [ ! -s "$tmp_dir/controller_id.txt" ]; then
      echo "$(date +'%F %T') - Enabling internal controller because '$device_name' was disconnected." >> "$script_install_dir/action.log"
      while read LINE; do
        echo $LINE > /sys/bus/usb/drivers/usbhid/bind
      done <"$tmp_dir/unbound_ids.txt"
      rm "$tmp_dir/controller_id.txt" "$tmp_dir/unbound_ids.txt"
    else
      echo "$(date +'%F %T') - '$device_name' was disconnected but internal controller is kept disabled because other controllers are still connected. Removing from wait list." >> "$script_install_dir/action.log"
    fi
  elif [ "$action" = "enable" ] && ! grep -q "^#\\?$device_name$" "$conf_dir/simple_device_list.txt"; then
    echo "#$device_name" >> "$conf_dir/simple_device_list.txt"
    LANG=en_US.UTF-8 sort -o "$conf_dir/simple_device_list.txt" "$conf_dir/simple_device_list.txt"
    echo "$(date +'%F %T') - '$device_name' was connected for the first time and added to '$conf_dir/simple_device_list.txt'. Remove the prefixed '#' to enable the script for it." >> "$script_install_dir/action.log"
  fi
fi

Steam Deck input doesn't work at all after installing

Previous version of the script worked fine, the new one however disables my steam decks input completely without any external devices being connected.

I'm using a steam deck oled.

If any info is needed let me know and I'll be happy to assist.

Suggestion: Optional indication that the internal Steam Deck Controller has been disabled/enabled

I'm using your script in Desktop mode starting automatically without any problems.

But sporadically I'm running into the situation that when I turn on one of my gamepads and start a game, the script at this moment has not recognized it and finished its' work, resulting in the game not running properly.

Could you integrate an option in your script allowing to indicate that the internal Steam Deck Controller has been disabled/enabled, please?

Such an "alert" could be a sound playing and/or a toast message popping up (for the sound part I've played around a little to see how to make the Steam Deck "beep" in Linux from the terminal console without having to install or configure additional packages or settings and found that using the "paplay" command works fine, for example " paplay /usr/share/sounds/freedesktop/stereo/bell.oga". For the toast message part, using "notify-send" does its' job, for example "notify-send test -t 2000").

No Longer Works on SteamOS 3.5

I know just about nothing about code. All I know is that when I'm on SteamOS 3.4 this works perfectly and on 3.5 it doesn't work at all. I know there are a lot of background changes taking place for 3.5 so I assume it has something to do with that. This is one of the most useful things I've found for the Steam Deck and would love to see it continue forward to the next update of SteamOS.

permission error's

I am trying to set up so that when my keyboard is connected the controller will disable but when i try to put in the name of my keyboard it says i need a password any idea what i do here

Adding new devices does not work

Everything works fine when I use a device that was already set to disable the steam controller, like my PS4 controller. However, I can not add more devices to the list. I can physically type them into the list and save it, as I do have the password to the deck, but it will not recognize the devices. I've tried my bluetooth speaker, my steam deck dock, my microphone, my webcam, my two other USB hubs connected, my keyboard, and my mouse but none of them worked. If there's something I'm missing, then here's my process: I go into Dolphin and press home - deck - .local - share - scawp - SDADSC - conf - simple_device_list.txt and add my device's name to the list. I do NOT put a hashtag in front of the name. I then check the Steam controller settings to see the connected controllers and, "Steam Controller Neptune" is always there unless I connect a device that the program already set to use. I have tried uninstalling and reinstalling the program. I have unplugged and plugged back in the devices after I set them up. I don't know what else to do.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.