安装Manjaro之后的配置

  • 安装Manjaro之后的配置已关闭评论
  • 149 次浏览
  • A+
所属分类:linux技术
摘要

独立博客阅读地址:https://panqiincs.me/2019/06/05/after-installing-manjaro/使用国内的源有更快的下载速度,pacman能够测试不同源的速度并排名,我选择的是上海交大sjtu的源。

独立博客阅读地址:https://panqiincs.me/2019/06/05/after-installing-manjaro/

安装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默认的中文显示效果非常差,不美观也就罢了,还会有很多奇形怪状的字形(比如「门」,「画」等字)出现。配置字体效果非常耗费时间,如果想仔细折腾,可以参考如下几个网页:

  1. Localization/Simplified Chinese (简体中文)
  2. Font configuration (简体中文)
  3. 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版本。但有过几次锁屏后卡死的情况,不知道这个问题在最近的更新中解决了没有。总体来说,体验非常完美,不愧是世界排名第一的发行版!

参考

  1. 人生苦短,我用Manjaro
  2. pacman - ArchWiki
  3. Manjaro Linux + KDE 安装使用手记
  4. Ask Ubuntu