按照 arch wiki 安裝好基本的系統(tǒng)之后還有很多東西需要配置,記錄一下自己的配置過程。
自動聯(lián)網(wǎng)更新時間
設(shè)置自動聯(lián)網(wǎng)更新時間需要安裝 ntp 并且設(shè)置開機啟動
# pacman -S ntp
# systemctl enable ntpd.service
網(wǎng)絡(luò)連接
使用 network-manager 并設(shè)置開機啟動
# pacman -S networkmanager
# systemctl enable NetworkManager.service
Aur
arch的aur簡直神器,直接在tty裝好。。
編輯 /etc/pacman.conf 添加
[archlinuxcn]
packages.SigLevel = Optional TrustAll
Server = [https://mirrors.ustc.edu.cn/archlinuxcn/$arch]
同步并安裝 pacman -Syu yaourt
字體渲染
arch本身的字體渲染實在看不了,覺得ubuntu的不錯,直接安裝ubuntu的配置
$ yaourt freetype2-ubuntu
$ yaourt fontconfig-ubuntu
$ yaourt cairo-ubuntu
字體
安裝 ttf-dejavu安裝 noto-fonts,noto-fonts-cjk
$ yaourt ttf-dejavu
$ yaourt noto-fonts
$ yaourt noto-fonts-cjk
輸入法
安裝fcitx和搜狗輸入法
$ sudo pacman -S fcitx-im
$ yaourt fcitx-configtool
$ yaourt fcitx-sogoupinyin
使用登陸管理器(GDM、lightdm等等)在 .xprofile 中添加,直接在tty startx 的話在 .xinitrc 中添加
LANG="zh_CN.UTF-8"
export GTK_IM_MODULE=fcitx
export QT_IM_MODULE=fcitx
export XMODIFIERS="@im=fcitx"
Gnome終端無法打開
解決方法:
- 換終端
- 在
/etc/environment中添加LANG="zh_CN.UTF-8"
Xfce4沒聲音
按照wiki的聲音配置還是沒聲音,是默認聲卡不對
運行 aplay -l 根據(jù)輸出的聲卡信息配置 ~/.asoundrc
pcm.!default {
type hw
card 2
}
ctl.!default {
type hw
card 2
}
Gnome終端無法輸入中文
用 fcitx 的話在終端輸入
gsettings set \
org.gnome.settings-daemon.plugins.xsettings overrides \
"{'Gtk/IMModule':<'fcitx'>}"
休眠
使用 uswsusp 實現(xiàn)休眠
$ yaourt uswsusp
安裝完后編輯 /etc/suspend.conf 添加swap分區(qū)的信息
resume device = /dev/sdXn
編輯好后要重新生成 initramfs
編輯 /etc/mkinitcpio.conf 在 HOOKS 一行中添加 uresume
HOOKS="base udev autodetect block uresume filesystems"
重新生成 initramfs
$ sudo mkinitcpio -p linux
重啟后就可以使用 s2disk 休眠了
也可以把 s2disk 整合到 systemctl 中
$ cp /usr/lib/systemd/system/systemd-hibernate.service /etc/systemd/system/
$ cd /etc/systemd/system/
$ sudo vim systemd-hibernate.service
把 ExecStart=/usr/lib/systemd/systemd-sleep hibernate 改為
ExecStart=/bin/sh -c 's2disk && run-parts --regex .\* -a post /usr/lib/systemd/system-sleep'
這樣就可以用 systemctl hibernate 命令來休眠了