一、配置和驱动
前文中在安装KDE
前已经将中文设置为系统语言了,中文字体也安装了思源黑体简体中文,在此就不再多说。
1 缩放
我用的是27寸4K,习惯于1.5倍缩放了。
系统设置
-> 硬件
-> 显卡与显示器
-> 显示配置
-> 全局缩放率
,设置为150%
。
高分屏有时默认用的是200%
,觉得2倍缩放不错的,可以不用更改。
2 Proxy
如何使用Proxy
我就不多说了,各凭本事。
我要讲的是使用白名单。
系统设置
-> 网络设置
-> 代_理
-> 使用代_理自动配置URL
,将下面的白名单复制进去:
我是根据自己的日常使用逐渐添加的,白名单内的网站不会走代_理。
3 个性化
3.1 应用程序样式
选择内置的Oxygen
。
3.1.1 配置 GNOME/GTK 应用程序样式
获取新 GNOME/GTK 应用风格
,搜索mac
,排序方式选择Highest rated first
,评分由高到底,安装第一个或前两个就可以了。安装时可能会有dark
或light
两种风格,我选的是light
。
安装成功后,在GTK 主题里
选择刚刚安装的应用风格即可。
3.2 窗口装饰
获取新窗口装饰
,搜索方法同3.1.1
,不过建议安装WhiteSur Aurorae
,因为这个主题包含多个缩放版本,安装好后,选择你的缩放倍数对应的主题即可。
比如我缩放1.5倍,所以选择WhiteSur_x1.5
。
4 配置字体
我个人不是很喜欢几款开源字体的样式,所以需要修改系统默认字体。
英文部分不需要做什么改动,主要针对中文部分进行配置。
中文字体我使用锤黑
(非衬线)和方正悠宋GBK
(衬线),英文和中文的等宽都用Courier SWA
。
编辑或创建用户字体配置文件:
vim ~/.fonts.conf
将下面的配置复制进去:
<?xml version='1.0'?>
<!DOCTYPE fontconfig SYSTEM 'fonts.dtd'>
<fontconfig>
<dir>/usr/share/fonts</dir>
<dir>/usr/local/share/fonts</dir>
<dir>~/.fonts</dir>
<match target="font">
<edit mode="assign" name="hinting">
<bool>true</bool>
</edit>
</match>
<match target="font">
<edit mode="assign" name="hintstyle">
<const>hintslight</const>
</edit>
</match>
<match target="font">
<edit mode="assign" name="lcdfilter">
<const>lcddefault</const>
</edit>
</match>
<match target="font">
<edit name="autohint"> <bool>false</bool> </edit>
<edit name="hinting"> <bool>true</bool> </edit>
<edit name="antialias"> <bool>true</bool> </edit>
<edit name="embeddedbitmap" mode="assign"> <bool>false</bool> </edit>
</match>
<!-- 英文默认字体使用 Roboto 和 Noto Serif ,等宽字体使用 Monaco。第二行为缺省字体,如果第一个字体没有某字符,则使用第二个字体 -->
<match>
<test qual="any" name="family">
<string>serif</string>
</test>
<edit name="family" mode="prepend" binding="strong">
<string>Noto Serif</string>
<string>方正悠宋 GBK</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>
<string>Smartisan Compact CNS</string>
</edit>
</match>
<match target="pattern">
<test qual="any" name="family">
<string>monospace</string>
</test>
<edit name="family" mode="prepend" binding="strong">
<string>Courier SWA</string>
<string>Smartisan Compact CNS</string>
</edit>
</match>
<!-- 中文默认非衬线使用锤黑,衬线使用方正悠宋,等宽使用Courier SWA. -->
<match>
<test name="lang" compare="contains">
<string>zh</string>
</test>
<test name="family">
<string>serif</string>
</test>
<edit name="family" mode="prepend">
<string>方正悠宋 GBK</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>Smartisan Compact CNS</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>Courier SWA</string>
<string>Smartisan Compact CNS</string>
</edit>
</match>
<!-- 把Linux没有的中文字体映射到已有字体,以便某些软件在使用这些未安装的字体时不乱码,能正常显示 -->
<match target="pattern">
<test qual="any" name="family">
<string>SimHei</string>
</test>
<edit name="family" mode="assign" binding="same">
<string>Smartisan Compact CNS</string>
</edit>
</match>
<match target="pattern">
<test qual="any" name="family">
<string>SimSun</string>
</test>
<edit name="family" mode="assign" binding="same">
<string>Smartisan Compact CNS</string>
</edit>
</match>
<match target="pattern">
<test qual="any" name="family">
<string>SimSun-18030</string>
</test>
<edit name="family" mode="assign" binding="same">
<string>Smartisan Compact CNS</string>
</edit>
</match>
<!-- 加载系统级自定义配置文件 -->
<include ignore_missing="yes">conf.d</include>
<!-- 字体缓存路径列表-->
<cachedir>/var/cache/fontconfig</cachedir>
<cachedir prefix="xdg">fontconfig</cachedir>
<!-- 将在未来删除此路径 -->
<cachedir>~/.fontconfig</cachedir>
<config>
<!-- Rescan in every 30s when FcFontSetList is called -->
<rescan> <int>30</int> </rescan>
</config>
</fontconfig>
重启生效。
5 双系统时windows时间不对
一般都会装archlinux和windows双系统,当archlinux设置完时间后,windows时间就变成了UTC
时间,这是因为默认情况下,linux的本地时间和硬件时间UTC
不一致,windows使用的就是硬件时间。
在archlinux里将硬件时间设置为本地时间即可:
sudo timedatectl set-local-rtc true
重启才能生效,可以直接重启到windows里查看时间是否正确。
6 换源
换源这件事有个矛盾点,速度和同步及时性不可兼得,所以根据自己的需求更换镜像源吧。
下载速度快且稳定的源有两个:aliyun
和huaweicloud
。
但上面两个镜像源同步不及时,可能会稍晚一些,想要更新及时一些,就要换一些高校镜像,比如北外镜像、中科大镜像、清华镜像等。
添加archlinuxcn源:
sudo vim /etc/pacman.conf
将下面内容添加到文件最后:
[archlinuxcn]
Server = https://mirrors.aliyun.com/archlinuxcn/$arch
备份原archlinux镜像源配置文件:
sudo mv /etc/pacman.d/mirrorlist /etc/pacman.d/mirrorlist.bak
创建新的镜像源文件:
sudo vim /etc/pacman.d/mirrorlist
添加:
## China
Server = http://mirrors.aliyun.com/archlinux/$repo/os/$arch
添加后,更新:
sudo pacman -Sy
安装archlinuxcn-keyring
:
sudo pacman -S archlinuxcn-keyring
彻底更新:
sudo pacman -Syyu
7 使用aur
安装yay
:
sudo pacman -S yay
换yay
源:
yay --aururl "https://aur.tuna.tsinghua.edu.cn" --save
8 pypi镜像源
pip config set global.index-url https://mirrors.aliyun.com/pypi/simple/
9 github开启代_理
只针对github.com,在国内还可能会用到gitee.com,所以不能将所有的git都添加上代_理。
# 设置代理
git config --global http.https://github.com.proxy socks5://127.0.0.1:1086
# 取消代理
git config --global --unset http.https://github.com.proxy
10 vim相关配置
10.1 安装vim的插件管理Vundle
git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim
10.2 安装自动补全插件YouCompleteMe
下载:
git clone --recursive https://github.com/Valloric/YouCompleteMe.git ~/.vim/bundle/YouCompleteMe
安装依赖:
sudo pacman -S cmake
编绎安装:
cd ~/.vim/bundle/YouCompleteMe
python install.py
10.3 其他配置和插件
下载vim配置文件:
curl -O https://raw.githubusercontent.com/thep0y/vim/master/.vimrc
安装插件:
vim .vimrc
:PluginInstall
11 视频相关驱动
我用的是Intel UHD 630,需安装的vaapi驱动和依赖为:
local/libva 2.10.0-1
Video Acceleration (VA) API for Linux
local/libva-intel-driver 2.4.1-1
VA-API implementation for Intel G45 and HD Graphics family
local/libva-utils 2.10.0-1
Intel VA-API Media Applications and Scripts for libva
安装:
sudo pacman -S libva libva-intel-driver libva-utils
视频驱动是否安装成功,需要通过在终端运行mpv
来检查,mpv
的配置参见下面的mpv
部分。
二、软件和对应配置
1 输入法
安装输入法我已经写过两篇文章了,参考Manjaro安装fcitx5-rime。
2 浏览器
Firefox
和Chrome
二选一即可。
2.1 Firefox
安装:
sudo pacman -S firefox
去掉标题栏:
打开菜单
-> 定制
-> 取消标题栏前面的勾
-> 完成
火狐在使用GTK主题时,右上解的最小化/最大化(恢复)/关闭
三个按钮会非常小,需要进一步调整:
参见 Firefox“最小化/最大化/关闭”按钮的大小调整的可行性方案
2.2 Chrome
Chrome
安装即用,没有什么问题,只是现在的Chrome
有些臃肿,在线视频还不能使用硬解,所以我主要使用Firefox
。
sudo pacman -S google-chrome
3 办公软件
我用的是LibreOffice
:
sudo pacman -S libreoffice-still-zh-cn
安装中文补丁就可以安装libreoffice-still
了。
3.1 libreoffice中使用fcitx5的问题
libreoffice不是用官方QT开发的,所以缩放有问题,导致fcitx5的输入框不能跟随光标,需要修改它的环境变量为GTK,才能修改此问题。
删除所有/usr/share/applications
里libreoffice的桌面快捷方式,不用提心,这个目录里的libreoffice*.desktop都是软链接。
将/usr/lib/libreoffice/share/xdg/
里所有的desktop复制到~/.local/share/applications
,并修改所有的Exec
,将所有原Exec=libreoffice
修改为:
Exec=env OOO_FORCE_DESKTOP=gnome libreoffice
此时再使用libreoffice,输入框就能跟随了。
4 邮箱
sudo pacman -S thunderbird
5 vscode
sudo pacman -S visual-studio-code-bin
6 sublime text 3
yay -S sublime-text
7 数据库管理 dbeaver
sudo pacman -S dbeaver
8 截图 flameshot
安装:
sudo pacman -S flameshot
导入快捷键:
系统设置
- 快捷键
- 自定义快捷键
- 编辑
- 导入
,选择下载的快捷键文件,但是,这样导入的快捷键可能无效,不会覆盖系统默认的快捷键,所以需要手动调整。
打开Flameshot
组,依次调整四个功能的触发器,按顺序调整为:
Print
Ctrl + Print
Shift + Print
Ctrl + Shift + Print
9 录屏
录屏时如果出现闪屏或花屏请参考另一篇文章linux系统因为intel显卡导致部分录屏软件(Peek、Simplescreenrecorder)闪屏花屏的解决方法
9.1 Peek
peek可以录制动图——GIF、APNG[1],也可以录制视频——WebM[2]、MP4,但不能录制声音。
sudo pacman -S peek
Peek
的快捷键默认为Ctrl + Alt + R
,但是此快捷键已被KDE某个功能绑定,所以需要修改快捷键。
首选项
- 更改
,输入你想使用的快捷键,如Super + G
。
9.2 SimpleScreenRecorder
有时,录屏时想将声音也录制进去,ssr就是一个不错的选择了。
sudo pacman -S simplescreenrecorder
10 Mardown文本编辑器 Typora
sudo pacman -S typora
11 视频播放器 mpv
sudo pacman -S mpv
下载配置文件和快捷键:
curl -L https://github.com/thep0y/mpv-config/raw/master/mpv.conf -o ~/.config/mpv/mpv.conf
curl -L https://github.com/thep0y/mpv-config/raw/master/input.conf -o ~/.config/mpv/input.conf