獨立博客閱讀地址:https://panqiincs.me/2019/06/05/after-installing-manjaro/
基本設定
更換為國內源
使用國內的源有更快的下載速度,pacman能夠測驗不同源的速度并排名,我選擇的是上海交大sjtu的源,
sudo pacman -Syy
sudo pacman-mirrors -i -c China -m rank
sudo pacman -Syyu
添加arch源
編輯/etc/pacman.conf檔案,加入下面的內容:
[archlinuxcn]
SigLevel = Optional TrustedOnly
Server = https://mirrors.sjtug.sjtu.edu.cn/archlinux-cn/$arch
然后
sudo pacman -Syy && sudo pacman -S archlinuxcn-keyring
現在可以全面升級系統:
sudo pacman -Su
pacman
包管理工具pacman非常強大,常見用法需要學習一下:
pacman -S package_name # 安裝軟體
pacman -S extra/package_name # 安裝不同倉庫中的版本
pacman -Syu # 升級整個系統,y是更新資料庫,yy是強制更新,u是升級軟體
pacman -Ss string # 在包資料庫中查詢軟體
pacman -Si package_name # 顯示軟體的詳細資訊
pacman -Sc # 清除軟體快取,即/var/cache/pacman/pkg目錄下的檔案
pacman -R package_name # 洗掉單個軟體
pacman -Rs package_name # 洗掉指定軟體及其沒有被其他已安裝軟體使用的依賴關系
pacman -Qs string # 查詢已安裝的軟體包
pacman -Qi package_name # 查詢本地安裝包的詳細資訊
pacman -Ql package_name # 獲取已安裝軟體所包含的檔案的串列
pacman -Qtdq # 獲取未被其他軟體使用的軟體包串列
pacman -U package.tar.zx # 從本地檔案安裝
pactree package_name # 顯示軟體的依賴樹
中文環境
輸入法
Rime是個非常不錯的輸入軟體,美中不足的是它的拼音輸入法詞庫太小,打字比較慢,推薦使用搜狗拼音輸入法,同時要安裝Fcitx框架,命令如下:
sudo pacman -S fcitx-sogoupinyin
sudo pacman -S fcitx-im
sudo pacman -S fcitx-configtool
設定環境變數,在~/.xprofile檔案(如果檔案不存在就新建一個)末尾加上:
export GTK_IM_MODULE=fcitx
export QT_IM_MODULE=fcitx
export XMODIFIERS="@im=fcitx"
在Fcitx配置中,Extra key for trigger input method默認設定為Shift Both,所以按下左右兩個Shift鍵會切換輸入法,這種配置很不合理,比如輸入英文字符的命令時,很容易切換到中文輸入法,所以建議將該項配置為Disabled,
如果使用搜狗拼音作為默認中文輸入法,重啟后該配置會恢復為默認,原因是搜狗拼音默認將Shift設定為中英文切換鍵,它將Fcitx的配置覆寫了,所以要在搜狗拼音的按鍵配置中將中英文切換修改為「無」,如果還覺得不保險,在修改完Fcitx的配置后,將組態檔權限修改為只讀:
sudo chmod 444 ~/.config/fcitx/config
中文字體
Manjaro默認的中文顯示效果非常差,不美觀也就罷了,還會有很多奇形怪狀的字形(比如「門」,「畫」等字)出現,配置字體效果非常耗費時間,如果想仔細折騰,可以參考如下幾個網頁:
- Localization/Simplified Chinese (簡體中文)
- Font configuration (簡體中文)
- Font Configuration/Chinese (簡體中文)
我參考上面的第3個鏈接中的配置,做了點小修改,效果基本能夠接受,先安裝如下字體:
sudo pacman -S ttf-roboto noto-fonts ttf-dejavu
# 文泉驛
sudo pacman -S wqy-bitmapfont wqy-microhei wqy-microhei-lite wqy-zenhei
# 思源字體
sudo pacman -S noto-fonts-cjk adobe-source-han-sans-cn-fonts adobe-source-han-serif-cn-fonts
創建檔案~/.config/fontconfig/fonts.conf,加入下面的配置:
<?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>Manjaro Font Config</description>
<!-- Font directory list -->
<dir>/usr/share/fonts</dir>
<dir>/usr/local/share/fonts</dir>
<dir prefix="xdg">fonts</dir>
<dir>~/.fonts</dir> <!-- this line will be removed in the future -->
<!-- 自動微調 微調 抗鋸齒 內嵌點陣字體 -->
<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 ,終端使用 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>
<!-- 中文默認字體使用思源宋體,不使用 Noto Sans CJK SC 是因為這個字體會在特定情況下顯示片假字. -->
<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>
<!-- 把Linux沒有的中文字體映射到已有字體,這樣當這些字體未安裝時會有替代字體 -->
<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>
<!-- will be removed in the future -->
<cachedir>~/.fontconfig</cachedir>
<config>
<!-- Rescan in every 30s when FcFontSetList is called -->
<rescan> <int>30</int> </rescan>
</config>
</fontconfig>
運行fc-cache -fv命令更新字體快取,使配置生效,
辦公軟體
WPS Office
WPS Office是金山公司開放辦公套件,兼容微軟Office的格式,真乃良心之作!前不久剛推出WPS Office 2019 For Linux,我覺得非常不錯,WPS可以通過yay安裝:
sudo yay -S wps-office
安裝完后啟動WPS,可能會彈出視窗,提示「系統缺失字體」,問題原因是WPS For Linux沒有自帶Windows的字體,其他發行版可能需要自己找字體安裝,Manjaro可以用一條命令搞定:
sudo pacman -S ttf-wps-fonts
如果需要修改WPS的界面語言,先打開WPS Writer,新建一個檔案,界面的右上方有個A字符的按鈕,點進去后,取消勾選「跟隨系統語言」選項,然后選擇你想要的語言即可,
桌面操作
默認設定下,單擊滑鼠即打開檔案,大多數人還是習慣雙擊打開檔案,修改方法如下:依次進入System Settings - Desktop Behavior - Workspace,將Click Behavior修改為Double-click即可,
默認設定下,按Del鍵洗掉檔案沒有確認提示,按照下面方法添加確認提示:依次進入Control - Configure Dolphin - General - Confirmations,勾選對應項即可,
使用感受
Manjaro的軟體太豐富了,好多直接可以從軟體倉庫中安裝,太方便了!雖然同是滾動發行版,但Manjaro更新沒有openSUSE Tumbleweed那么頻繁,內核也依然停留在4.x版本,但有過幾次鎖屏后卡死的情況,不知道這個問題在最近的更新中解決了沒有,總體來說,體驗非常完美,不愧是世界排名第一的發行版!
參考
- 人生苦短,我用Manjaro
- pacman - ArchWiki
- Manjaro Linux + KDE 安裝使用手記
- Ask Ubuntu
轉載請註明出處,本文鏈接:https://www.uj5u.com/caozuo/476252.html
標籤:其他
