1

I downloaded Fedora 43 Cosmic (Wayland) and found no way to disable my touchpad (mouse is always connected). xinput and synclient seem to be X11 only. Touchpad Disable is a simple checkbox with KDE Wayland but not so with Fedora Cosmic.

After some web research, I found a manual device lookup then copy-paste to a root command line that worked. I wrote a tpad-off script to automate the process a bit more. However, the script runs but does nothing while copying the output command line and running from the terminal works.

( UPDATED - 1. tpad-on:SUCCESS 2. tpad-off:FAIL )

#!/bin/bash

grep -E "Touchpad|platform" /proc/bus/input/devices | 
cut -d '=' -f 2 | 
sed -z 's;pad.\\n;pad @echo 1 \\\> /sys;g' | 
grep @ | 
cut -d '@'  -f 2 | 
sed -e 's;$;/inhibited;g' | /bin/bash
OUTPUT from grep -E "Touchpad|platform" /proc/bus/input/devices

S: Sysfs=/devices/platform/i8042/serio0/input/input3
N: Name="ETPS/2 Elantech Touchpad"
S: Sysfs=/devices/platform/i8042/serio1/input/input5
S: Sysfs=/devices/platform/AMDI0010:01/i2c-1/i2c-ELAN2204:00/0018:04F3:309A.0002/input/input11
N: Name="ELAN2204:00 04F3:309A Touchpad"
S: Sysfs=/devices/platform/AMDI0010:01/i2c-1/i2c-ELAN2204:00/0018:04F3:309A.0002/input/input13
S: Sysfs=/devices/platform/pcspkr/input/input14
S: Sysfs=/devices/platform/huawei-wmi/input/input15
Output (fail) from tpad-off script (that ignored pipe to /bin/bash)

echo 1 > /sys/devices/platform/i8042/serio1/input/input5/inhibited
echo 1 > /sys/devices/platform/AMDI0010:01/i2c-1/i2c-ELAN2204:00/0018:04F3:309A.0002/input/input13/inhibited
New contributor
One Dash Dot compact web is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.
5
  • 1
    Add output of grep -E "Touchpad|platform" /proc/bus/input/devices to your question (no comment). Commented yesterday
  • 2
    (1) sh is not bash -- a bash script should not use /bin/sh. (2) It looks like you're missing a step -- the way that's written it generates output but just writes it to stdout instead of enacting anything. I wouldn't expect that to do anything useful at all, even run by hand on the command line, written as it is now. Commented yesterday
  • @CharlesDuffy Hmmm, adding a final | /bin/bash pipe to the script worked for tpad-on but failed for tpad-off. Except for echo 0 > changed to echo 1 >, the scripts are the same. Commented 17 hours ago
  • BTW, I wouldn't have written in that way -- piping things to a shell runs all the same security risks that eval has, so it's safer to run explicit loops, even if the code is a lot more wordy. As for the immediate bug, though -- without having the touchpad at hand and a Linux box experiencing the problem, I can't speak to why reenabling it doesn't work; there's nothing innately wrong with the script at hand. Commented 2 hours ago
  • ...a more verbose, less risky script doing the same thing might be similar to: while IFS= read -r line; do [[ $line =~ "N:".*Touchpad ]] || continue; read -r sys || break; [[ $s = "S: Sysfs="* ]] || continue; echo 0 >"${s#*=}"; done </proc/bus/input/devices -- but again, that's not expected to behave differently from the code you already have (except when there's a malicious device attached that's trying to trick your script into running unwanted commands). Commented 2 hours ago

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.