Skip to content

Instantly share code, notes, and snippets.

@gmvi
Last active March 20, 2026 09:59
Show Gist options
  • Select an option

  • Save gmvi/4a7828ed90da2dc84c4edb1de34e29f1 to your computer and use it in GitHub Desktop.

Select an option

Save gmvi/4a7828ed90da2dc84c4edb1de34e29f1 to your computer and use it in GitHub Desktop.
A script to turn off the touchscreen on your Steam Deck while using Mod Organizer 2 so it doesn't crash to desktop
# version 1.1
# This is intended to turn off the Steam Deck's touchscreen in desktop mode when you launch Mod Organizer 2 as installed
# by modorganizer2-linux-installer (maybe SteamTinkerLaunch too).
# 1. download this file somewhere (like ~/bin/) and run `chmod u+x` on it
# 2. write the following line to sudoers to let this script turn the touchscreen off:
# `EDITOR=nano sudo visudo /etc/sudoers.d/zz-nopasswd`
# deck ALL=(ALL) NOPASSWD: /usr/bin/tee /sys/devices/platform/*/inhibited
# This will be overwritten up SteamOS updates, breaking this fix until you repeat this step.
# 2.a. Make the sudoers change permanent:
# `echo "/etc/sudoers.d/zz-nopasswd" >> /etc/atomic-update.conf.d/sudoers-nopasswd.conf`
# 3. update your Steam launch options to:
# ~/bin/no-touch.sh ; %command% ; ~/bin/no-touch.sh reset
# If you would put something else in launch options, it goes between the semicolons
[ "$1" = "reset" ] && RESET=true
[ -z "$KDE_FULL_SESSION" ] && GAMING=true
# in desktop mode, turn the touchscreen off when starting, on when done
# in gaming mode, force the touchscreen on when starting, in case of prior failure
if [ -z "$GAMING" ]; then
[ -z "$RESET" ] && TOUCHOFF=true
[ -n "$RESET" ] && TOUCHON=true
else
[ -z "$RESET" ] && TOUCHON=true
fi
# Finds the sysfs input entry path by reading /proc/bus/input/devices directly
# This code wasn't written to disable multiple touchscreens
# Note: don't use existing tools to parse this file because libinput requires sudo to
# read this device. The /ABS=[0-9]{10}/ checks for a long number, meaning high bits set,
# meaning that of the two FTS3528 devices it's the touchscreen.
if [ -n "$TOUCHON" ] || [ -n "$TOUCHOFF" ]; then
TOUCH_INPUT="$( cat /proc/bus/input/devices |
awk 'BEGIN{RS="";FS="\n"} /N: Name="FTS3528/ && /B: ABS=[0-9]{10}/' |
sed -n 's|S: Sysfs=\(.*\)|\1|p' )"
[ -n "$TOUCH_INPUT" ] && INHIBITED="/sys$TOUCH_INPUT/inhibited"
[ -n "$INHIBITED" ] && ( [ -n "$TOUCHON" ]; echo $? | sudo tee $INHIBITED >/dev/null )
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment