使自定义突触触摸板配置持久不起作用

Aug*_*ger 5 touchpad xorg synaptics

我正在努力使我的自定义触摸板持久化。

我非常了解我想要的配置。这是命令,使用synclient

synclient RightButtonAreaLeft=0 RightButtonAreaTop=0 ClickTime=20 AccelFactor=0.3 MaxSpeed=2.5 PalmDetect=1 VertTwoFingerScroll=1 HorizTwoFingerScroll=1 VertEdgeScroll=0 HorizEdgeScroll=0
Run Code Online (Sandbox Code Playgroud)

正如这里那里所解释的,我创建/etc/X11/xorg.conf.d/50-synaptics.conf而不是/usr/share/X11/xorg.conf.d/50-synaptics.conf使用以下内容进行编辑:

Section "InputClass"
  Identifier "touchpad catchall"
  Driver "synaptics"
  MatchIsTouchpad "on"
  MatchDevicePath "/dev/input/event*"
  Option "RightButtonAreaLeft" "0"
  Option "RightButtonAreaTop" "0"
  Option "ClickTime" "20"
  Option "AccelFactor" "0.3"
  Option "MaxSpeed" "2.5"
  Option "PalmDetect" "1"
  Option "VertTwoFingerScroll" "1"
  Option "HorizTwoFingerScroll" "1"
  Option "VertEdgeScroll" "0"
  Option "HorizEdgeScroll" "0"
EndSection
Run Code Online (Sandbox Code Playgroud)

令人惊讶的是,它确实改变了一些东西,因为我的鼠标移动得更快,但没有应用所有选项,因为HorizTwoFingerScroll它不可用。

既然/usr/share/X11/xorg.conf.d/50-synaptics.conf还在那里,我想知道它是否没有干扰。这是里面的内容:

# Example xorg.conf.d snippet that assigns the touchpad driver
# to all touchpads. See xorg.conf.d(5) for more information on
# InputClass.
# DO NOT EDIT THIS FILE, your distribution will likely overwrite
# it when updating. Copy (and rename) this file into
# /etc/X11/xorg.conf.d first.
# Additional options may be added in the form of
#   Option "OptionName" "value"
#
Section "InputClass"
        Identifier "touchpad catchall"
        Driver "synaptics"
        MatchIsTouchpad "on"
# This option is recommend on all Linux systems using evdev, but cannot be
# enabled by default. See the following link for details:
# http://who-t.blogspot.com/2010/11/how-to-ignore-configuration-errors.html
#       MatchDevicePath "/dev/input/event*"
EndSection

Section "InputClass"
        Identifier "touchpad ignore duplicates"
        MatchIsTouchpad "on"
        MatchOS "Linux"
        MatchDevicePath "/dev/input/mouse*"
        Option "Ignore" "on"
EndSection

# This option enables the bottom right corner to be a right button on clickpads
# and the right and middle top areas to be right / middle buttons on clickpads
# with a top button area.
# This option is only interpreted by clickpads.
Section "InputClass"
        Identifier "Default clickpad buttons"
        MatchDriver "synaptics"
        Option "SoftButtonAreas" "50% 0 82% 0 0 0 0 0"
        Option "SecondarySoftButtonAreas" "58% 0 0 15% 42% 58% 0 15%"
EndSection

# This option disables software buttons on Apple touchpads.
# This option is only interpreted by clickpads.
Section "InputClass"
        Identifier "Disable clickpad buttons on Apple touchpads"
        MatchProduct "Apple|bcm5974"
        MatchDriver "synaptics"
        Option "SoftButtonAreas" "0 0 0 0 0 0 0 0"
EndSection
Run Code Online (Sandbox Code Playgroud)

为什么有好几个?如何禁用它们(考虑到我不允许编辑文件)?我错过了什么?

小智 2

我尝试了上面的所有启动命令,或者/etc/X11/xorg.conf.d/60-synaptics.conf甚至启动脚本,延迟 10 秒,然后循环执行或不循环执行。什么都没起作用。我唯一无法尝试的是通过设置它,因为我在那里没有找到任何触摸板设置。/etc/X11/xorg.confxfcematesynclient-commandsgsettings

对我来说,可行的解决方案是:只需在末尾添加 synclient 命令,~/.bashrc 因此在您的情况下,只需添加:

synclient RightButtonAreaLeft=0 RightButtonAreaTop=0 ClickTime=20 AccelFactor=0.3 MaxSpeed=2.5 PalmDetect=1 VertTwoFingerScroll=1 HorizTwoFingerScroll=1 VertEdgeScroll=0 HorizEdgeScroll=0
Run Code Online (Sandbox Code Playgroud)

也许,将其添加到~/.xinit会执行相同的操作:)(.bashrc在重新登录或执行之前将其添加到不会产生效果source ~/.bashrc

我知道,bashrc这不是应该存储设置的地方synclient,但在这个问题上花了几个小时之后,它是我唯一有效的解决方案,而且我没有任何副作用。


小智 0

更新:我发现这会使系统设置中的“鼠标和触摸板”UI 停止运行。稍后您将不得不诉诸配置文件编辑。

对于 ubuntu 16.04 上的我来说,我终于发现 GNOME by conf 正在覆盖设置,所以我这样做了:

# enable natural scroll in GNOME config,
# it may alter the sign of *ScrollDelta option values defined in /usr/share/X11/xorg.conf.d/*
/usr/bin/gsettings set org.gnome.desktop.peripherals.touchpad natural-scroll true
/usr/bin/gsettings set org.gnome.desktop.peripherals.mouse natural-scroll true

# prevent GNOME from overwriting configured options defined in /usr/share/X11/xorg.conf.d/* at all
/usr/bin/gsettings set org.gnome.settings-daemon.plugins.mouse active false
Run Code Online (Sandbox Code Playgroud)

然后一切正常。

仅供参考,我必须使用/usr/bin/gsettingsAnaconda python 附带的一个不起作用的 gsettings 命令,而我恰好需要将 anaconda bin 预先添加到我的 PATH 中。