下面的配置工作是在已经安装好Xorg、Xinit等等的前提下进行的。并且,我使用的是Arch Linux,不同的发行版可能有所不同。
触控板
自然滚动
在/usr/share/X11/xorg.conf.d/50-customed.conf
中,添加下面的内容。
...
Section "InputClass"
Identifier "libinput touchpad catchall"
MatchIsTouchpad "on"
MatchDevicePath "/dev/input/event*"
Driver "libinput"
#在此处开始添加
Option "NaturalScrolling" "True"
...
触碰点击
还是在/usr/share/X11/xorg.conf.d/50-customed.conf
中,添加下面的内容。
...
Section "InputClass"
Identifier "libinput touchpad catchall"
MatchIsTouchpad "on"
MatchDevicePath "/dev/input/event*"
Driver "libinput"
#在此处开始添加
Option "Tapping" "True"
...
手势操作
需要安装libinput-gestures
包,并将/etc/libinput-gestures.conf
复制到$HOME/.config/libinput-gestures.conf
。
然后将用户添加到input
组,并运行libinput-gestures-setup
sudo gpasswd -a $USER input
libinput-gestures-setup autostart start
鼠标加速
编辑/usr/share/X11/xorg.conf.d/50-customed.conf
...
Section "InputClass"
Identifier "libinput touchpad catchall"
MatchIsTouchpad "on"
MatchDevicePath "/dev/input/event*"
Driver "libinput"
#在此处开始添加
Option "AccelProfile" "adaptive" #这是鼠标加速
Option "AccelSpeed" "0.5" #这是直接调整鼠标速度
...
改键位
与之前那篇记录 中不同的是,这里改的是X11中的键位。(这种方式其实并不好用,所以后来我选择了下面那个方案)
xmodmap -pke > ~/.Xmodmap #建议使用大写开头的Xmodmap,否则有时会有问题,如更新系统时
使用xev
来查看目前的键码。
到刚复制好的配置文件(~/.Xmodmap)中修改,以下用交换Caps_Lock
与Control_L
为例
#在开头处
clear lock
clear control
...
#将这两个按键的键码交换
...
#在结尾处
add lock = Caps_Lock
add control = Control_L Control_R
改键位的另一种方式
/usr/share/X11/xorg.conf.d/50-customed.conf
Section "InputClass"
Identifier "libinput keyboard catchall"
MatchIsKeyboard "on"
MatchDevicePath "/dev/input/event*"
Driver "libinput"
Option "XkbOptions" "ctrl:swapcaps"
EndSection
更换鼠标样式
以bibata-cursor-theme
为例
在Arch Linux中可以直接在AUR中下载,之后在/usr/share/icons/default/index.theme
中添加
[icon theme]
Inherits=cursor_theme_name #这里的cursor_theme_name我选择的是Bibata-Original-Amber
输入法
我使用的是Fcitx5,这里需要下载主体fcitx5-im
,拼音主体fcitx5-chinese-addons
,中文词库fcitx5-pinyin-zhwiki
、fcitx5-pinyin-moegirl
,输入法主题fcitx5-nord
。
为了防止一些问题,可以在/etc/environment
中添加:
GTK_IM_MODULE=fcitx
QT_IM_MODULE=fcitx
XMODIFIERS=@im=fcitx
SDL_IM_MODULE=fcitx
GLFW_IM_MODULE=ibus
#.Xresources的一些配置
Xft.dpi: 144
Xft.antialias: true
Xft.hinting: true
Xft.hintstyle: hintslight
Xft.rgba: rgb