manjaro 禁用触摸板

2018-09-22  本文已影响0人  EricDD

使用鼠标的时间比较多,用触摸板不太习惯,而且打字是太容易误操作。十分的影响操作。

参考链接
触摸板wiki
libinput

安装 libinput xf86-input-libinput xorg-xinput

创建touchpad_toggle.sh,并复制wiki 中软开关中代码

#!/bin/bash

declare -i ID
ID=`xinput list | grep -Eio '(touchpad|glidepoint)\s*id\=[0-9]{1,2}' | grep -Eo '[0-9]{1,2}'`
declare -i STATE
STATE=`xinput list-props $ID|grep 'Device Enabled'|awk '{print $4}'`
if [ $STATE -eq 1 ]
then
    xinput disable $ID
    # echo "Touchpad disabled."
    # notify-send 'Touchpad' 'Disabled' -i /usr/share/icons/Adwaita/48x48/devices/input-touchpad.png
else
    xinput enable $ID
    # echo "Touchpad enabled."
    # notify-send 'Touchpad' 'Enabled' -i /usr/share/icons/Adwaita/48x48/devices/input-touchpad.png
fi

设置 touchpad_toggle.sh 文件可执行。

chmod a+x ./touchpad_toggle.sh

执行touchpad_toggle.sh

./touchpad_toggle.sh

此时触摸板已经禁用,再次执行则触摸板启用。

绑定快捷键 fn+f9


image.png

选择可执行文件,并设置快捷键即可。

上一篇 下一篇

猜你喜欢

热点阅读