我在我的笔记本电脑上使用 xubuntu。当我想要打字或编码时,触摸板会重新定位光标。我想禁用触摸板。命令“xinput list”显示触摸板 ID,因此我可以使用以下命令禁用它: xinput set-prop {touchpad id} "Device Enabled"0 我想轻松使用luncher,但是当我重新启动笔记本电脑时,触摸板ID可能会改变。 如何从 xinput list 命令输出中获取触摸板 ID 并在 xinput set-prop 命令中使用它?
最佳答案
您可以创建一个在启动时运行的小型 shell 脚本:
#!/bin/bash
TPAD_ID=$(xinput list | grep -i touchpad | sed 's/.*id=\([0-9]*\).*/\1/i')
xinput set-prop $TPAD_ID "Device Enabled" 0
触摸板 ID 是从 xinput list
的输出中提取的,然后馈送到您提到的命令。
关于linux - 从ubuntu中的程序输出结果中获取特定数据,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29477148/