arch linux 安裝后的配置

按照 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終端無法打開

解決方法:

  1. 換終端
  2. /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.confHOOKS 一行中添加 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 命令來休眠了

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時請結(jié)合常識與多方信息審慎甄別。
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點,簡書系信息發(fā)布平臺,僅提供信息存儲服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容