# 安装 yay,ARU 助手 或者可以选择 paru
# 但是 hyprland 中推荐使用 yay
git clone https://aur.archlinux.org/yay.git
cd yay
makepkg -si
# 首次安装后配置
yay -Y --gendb
yay -Syu --devel
yay -Y --devel --save
yay -S google-chrome
yay -S rofi
Event: time 1628668903.193667, type 4 (EV_MSC), code 4 (MSC_SCAN), value 70039
Event: time 1628668903.193667, type 1 (EV_KEY), code 58 (KEY_CAPSLOCK), value 0
<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
<its:rules xmlns:its="http://www.w3.org/2005/11/its" version="1.0">
<its:translateRule
translate="no"
selector="/fontconfig/*[not(self::description)]"
/>
</its:rules>
<description>Android Font Config</description>
<!-- Font directory list -->
<dir>/usr/share/fonts</dir>
<dir>/usr/local/share/fonts</dir>
<dir prefix="xdg">fonts</dir>
<!-- the following element will be removed in the future -->
<dir>~/.fonts</dir>
<!-- Disable embedded bitmap fonts -->
<match target="font">
<edit name="embeddedbitmap" mode="assign">
<bool>false</bool>
</edit>
</match>
<!-- English uses Roboto and Noto Serif by default, terminals use DejaVu Sans Mono. -->
<match>
<test qual="any" name="family">
<string>serif</string>
</test>
<edit name="family" mode="prepend" binding="strong">
<string>Noto Serif</string>
</edit>
</match>
<match target="pattern">
<test qual="any" name="family">
<string>sans-serif</string>
</test>
<edit name="family" mode="prepend" binding="strong">
<string>Roboto</string>
</edit>
</match>
<match target="pattern">
<test qual="any" name="family">
<string>monospace</string>
</test>
<edit name="family" mode="prepend" binding="strong">
<string>DejaVu Sans Mono</string>
</edit>
</match>
<!-- Chinese uses Source Han Sans and Source Han Serif by default, not Noto Sans CJK SC, since it will show Japanese Kanji in some cases. -->
<match>
<test name="lang" compare="contains">
<string>zh</string>
</test>
<test name="family">
<string>serif</string>
</test>
<edit name="family" mode="prepend">
<string>Source Han Serif CN</string>
</edit>
</match>
<match>
<test name="lang" compare="contains">
<string>zh</string>
</test>
<test name="family">
<string>sans-serif</string>
</test>
<edit name="family" mode="prepend">
<string>Source Han Sans CN</string>
</edit>
</match>
<match>
<test name="lang" compare="contains">
<string>zh</string>
</test>
<test name="family">
<string>monospace</string>
</test>
<edit name="family" mode="prepend">
<string>Noto Sans Mono CJK SC</string>
</edit>
</match>
<!-- Windows & Linux Chinese fonts. -->
<!-- Map all the common fonts onto Source Han Sans/Serif, so that they will be used when Source Han Sans/Serif are not installed. This solves a situation where some programs asked for a font, and under the non-existance of the font, it will not use the fallback font, which caused abnormal display of Chinese characters. -->
<match target="pattern">
<test qual="any" name="family">
<string>WenQuanYi Zen Hei</string>
</test>
<edit name="family" mode="assign" binding="same">
<string>Source Han Sans CN</string>
</edit>
</match>
<match target="pattern">
<test qual="any" name="family">
<string>WenQuanYi Micro Hei</string>
</test>
<edit name="family" mode="assign" binding="same">
<string>Source Han Sans CN</string>
</edit>
</match>
<match target="pattern">
<test qual="any" name="family">
<string>WenQuanYi Micro Hei Light</string>
</test>
<edit name="family" mode="assign" binding="same">
<string>Source Han Sans CN</string>
</edit>
</match>
<match target="pattern">
<test qual="any" name="family">
<string>Microsoft YaHei</string>
</test>
<edit name="family" mode="assign" binding="same">
<string>Source Han Sans CN</string>
</edit>
</match>
<match target="pattern">
<test qual="any" name="family">
<string>SimHei</string>
</test>
<edit name="family" mode="assign" binding="same">
<string>Source Han Sans CN</string>
</edit>
</match>
<match target="pattern">
<test qual="any" name="family">
<string>SimSun</string>
</test>
<edit name="family" mode="assign" binding="same">
<string>Source Han Serif CN</string>
</edit>
</match>
<match target="pattern">
<test qual="any" name="family">
<string>SimSun-18030</string>
</test>
<edit name="family" mode="assign" binding="same">
<string>Source Han Serif CN</string>
</edit>
</match>
<!-- Load local system customization file -->
<include ignore_missing="yes">conf.d</include>
<!-- Font cache directory list -->
<cachedir>/var/cache/fontconfig</cachedir>
<cachedir prefix="xdg">fontconfig</cachedir>
<!-- the following element will be removed in the future -->
<cachedir>~/.fontconfig</cachedir>
<config>
<!-- Rescan configurations every 30 seconds when FcFontSetList is called -->
<rescan>
<int>30</int>
</rescan>
</config>
</fontconfig>
书接上回 Arch Linux 系统安装篇
进入系统之后需要对新系统进行设置
必要系统设置
要先保证电脑的
wifi/键盘/鼠标
等可以正常使用,不然一切都是空谈联网
NetworkManager - ArchWiki
因为之前选的是
NetworkManager
管理网络,所以可以以下步骤任选其一nmcli device wifi connect <网络名> password <密码>
nmtui
nm-connection-editor
还可以安装 networkmanager-dmenu: Control NetworkManager via dmenu ,可以通过
dmenu
或rofi
管理NetworkManager
蓝牙
Bluetooth - ArchWiki
有几种方式
bluetoothctl
bluetoothctl
,交互就舒服多了bluetoothctl
这里以最基础的
bluetoothctl
为例安装
使用
系统升级和备份
建议安装 informant: An Arch Linux News reader and pacman hook
这是一个 pacman hook,可以保证你在升级系统前必须先阅读 Arch Linux 的新闻,否则就会中断升级动作
升级之后 检查孤立包和丢弃的包,命令在下面 [ > [Pacman](https <//wiki.archlinux.org/title/Pacman>) 速览](.md#Pacman)
Timeshift
启动之后选择
Wizard
根据自己的需要配置,我选择每天进行一次快照,保留 15 天的记录其他系统设置
Pacman 速览
系统升级后的清理动作
清理包缓存
yay
Hyprland 配置
Arch Linux 系统安装篇 里已经选了
hyprland
,所以这里基本的配置应该已经完成了我们直接进行配置的安装即可,可以在 hyprland · GitHub Topics · GitHub 中挑选自己喜欢的配置,我选择的方案和配置参考 dotfiles#hyprland
基本上安装完这个之后,系统就已经完全可用了
按键映射
底层映射
我习惯把
ctrl
放在alt
(command
)的位置,所以要改一下按键对于这种无脑重映射,最好是从底层修改,以不需要用运行程序的方法以提高性能 Map scancodes to keycodes - ArchWiki
步骤如下
查找键盘设备
先安装
pacman -S evtest
用来查看按键的scancode
,安装好后,执行sudo evtest
先选择自己的键盘设备
/dev/input/event$
,如果不确定就一个一个试,试对了按键后屏幕会有输出输出内容格式如下:
其中
KEY_CAPSLOCK
表示我按下的是capslock
键,MSC_SCAN
后面的value 70039
是scancode
,code 58
是keycode
有了按键信息之后还需要设备信息做匹配,上面我们已经找到了自己的设备号了,通过以下命令查看设备
在
/etc/udev/hwdb.d/
中创建一个90-remap-keyboard.hwdb
的文件保存退出,更新 hwdb 数据库:
激活配置
程序映射
我喜欢把
ctrl
单击映射为esc
按键,而与其他键组合时仍然是ctrl
键,参考 Vim ESC 键的解决方案,这种功能就必须使用程序来实现了最终选用了
kanata
,因为我对rust
比较熟。也可以看看 kmonadkanata
具体配置和使用参考 dotfiles
evremap
参考 Input remap utilities - ArchWiki
安装
evremap
配置
evremap
copy
https://github.com/wez/evremap/blob/master/pixelbookgo.toml 内容至自己本地,命名为evremap.toml
,记住存放的路径,后面要用修改
evremap.toml
,参考 GitHub - evremap 进行个人配置,主要是device_name
要配置对,不然会报错无法启动配置好之后先测试一下
如果没有报错就可以正常使用了,可以去其他地方试一下按键有没有生效
开机自启动
udev
参考
这种方式可以在设备(蓝牙)触发相应事件时(自动连接后)执行命令
查看设备信息,
$device_name
就是上面 查找键盘设备 中的路径eg: /dev/input/event18
然后找到可以唯一标识自己设备的一些信息,比如
id/product
、id/vendor
、phys
之类的,用于规则匹配使用编写规则
写入规则
根据自己的设备情况把匹配条件写好
然后重启测试
systemd
也是
evremap Readme
中推荐的方式,但是!所以这种方法对于蓝牙键盘来说完全不能用,因为系统没启动前蓝牙肯定没有连上啊,但如果你是有线键盘,这种还是比较省事
使用如下命令创建
systemd service
把 https://github.com/wez/evremap/blob/master/evremap.service 中的内容写入,并把
evremap.toml
的绝对路径替换成你自己的本地路径然后使用
systemctl
控制开机自启动Dotfiles
TUI、shell、输入法、nvim、terminal 等安装和配置,可以参考 GitHub - lei4519/dotfiles: vim、linux、mac 配置,这里不再赘述
有用的软件
我平时喜欢用终端,所以比较钟意 TUI
固态硬盘清理
睡眠和休眠
Power management/Suspend and hibernate - ArchWiki
中文字体设置
参考:
复制以下内容,然后重启电脑即可
Ref