我正在使用Enlightenment DM,但这与其他DM /桌面有关。我使用xsession开始会话,因此我最初将xinput命令放在〜/ .xsession中,这并没有更改我想更改的所有设置。只有其中一些。我期待所有更改或没有更改,因此我在.xsession中添加了一个10间隔的循环,间隔为1秒,每次运行xinput命令并检查是否应用了设置。令我惊讶的是,所有设置都在第一次迭代后应用。
这意味着是您的DM执行某些操作来覆盖您的xinput设置,并且由于启动DM的命令(在我的情况下为E17)是.xsession文件中的最后一个命令,因此此文件不适合此操作。
我在〜/ .profile中添加了以下几行,这已经解决了问题:
# don't run unless we're being invoked from an xwindows session
if [[ -n ${DISPLAY} ]]; then
# set your devices names here
pointer1="IBM TrackPoint"
pointer2="Lite-On Technology Corp. ThinkPad USB Keyboard with TrackPoint"
pointer3="Logitech USB Trackball"
id1=$(xinput | awk -F= "/$pointer1.*pointer/ {print \$2}" | cut -f1)
id2=$(xinput | awk -F= "/$pointer2.*pointer/ {print \$2}" | cut -f1)
id3=$(xinput | awk -F= "/$pointer3.*pointer/ {print \$2}" | cut -f1)
if [[ -n "${id1}" ]]; then
xinput --set-button-map "${id1}" 1 2 3 4 5 6 7
xinput set-prop "${id1}" "Evdev Wheel Emulation Axes" 6 7 4 5
xinput set-prop "${id1}" "Evdev Wheel Emulation" 1
xinput set-prop "${id1}" "Evdev Wheel Emulation Button" 2
xinput set-prop "${id1}" "Evdev Middle Button Emulation" 0
fi
if [[ -n "${id2}" ]]; then
xinput --set-button-map "${id2}" 1 2 3 4 5 6 7
xinput set-prop "${id2}" "Evdev Wheel Emulation Axes" 6 7 4 5
xinput set-prop "${id2}" "Evdev Wheel Emulation" 1
xinput set-prop "${id2}" "Evdev Wheel Emulation Button" 2
xinput set-prop "${id2}" "Evdev Middle Button Emulation" 0
fi
if [[ -n "${id3}" ]]; then
xinput --set-button-map "${id3}" 1 2 3 4 5 6 7 8 9
xinput set-prop "${id3}" "Evdev Wheel Emulation Axes" 6 7 4 5
xinput set-prop "${id3}" "Evdev Wheel Emulation" 1
xinput set-prop "${id3}" "Evdev Wheel Emulation Button" 8
xinput set-prop "${id3}" "Evdev Middle Button Emulation" 1
fi
fi
PS。不推荐使用set-int-prop,而推荐使用set-prop(man xinput)。
希望这对某人有帮助。
sleep 5
在.xsession
文件开头添加?