You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
calculate-overlay/games-util/steam-launcher/files/steam-fix-joystick-detectio...

32 lines
773 B

diff -Naur a/steam b/steam
--- a/steam 2016-08-14 18:44:23.069675427 +0100
+++ b/steam 2016-08-14 18:44:29.853577578 +0100
@@ -38,6 +38,27 @@
# Gentoo's lsb-release doesn't set this.
export DISTRIB_RELEASE="2.2"
+# Finds joystick devices so we can coerce Steam's old SDL library into using them
+function enum_joysticks {
+ local joyprop=ID_INPUT_JOYSTICK=1
+ for f in /dev/input/*; do
+ if [ ! -c $f ]; then
+ continue
+ elif udevadm info --query=property --name=$f | grep --quiet $joyprop; then
+ echo $f
+ fi
+ done
+}
+
+# Uses the first arg as a separator to join the remaining args
+function join {
+ local IFS="$1"
+ shift
+ echo "$*"
+}
+
+export SDL_JOYSTICK_DEVICE=$(join : $(enum_joysticks))
+
function show_message()
{
style=$1