[关闭]
@czyczk 2021-01-26T12:20:45.000000Z 字数 5930 阅读 1368

Manjaro Linux 踩坑记

Linux Manjaro_Linux



前记

本来以为没什么坑的,现在看来要开这篇文了。

包管理器

Yay

yaourt 已被列为不安全,可使用 yay(yet another yaourt)做替代。

  1. git clone https://aur.archlinux.org/yay.git
  2. cd yay
  3. makepkg -si

搜索 yay -Ss <package-name>
安装 yay -S <package-name>,避免重复安装已装的包用在后面加 --needed
删除应用 pacman -Rcsn <package-name>
卸载后移除无用依赖:yay -Rsn $(yay -Qdtq)

包管理器推荐列表:
https://linux.cn/article-9925-1.html
移除无用依赖:
https://bbs.archlinux.org/viewtopic.php?id=57431

Snap

https://docs.snapcraft.io/installing-snap-on-manjaro-linux

关于自带的 VMware Tools

主要问题有两个:共享剪贴板不能用、共享文件夹不会自动挂载到 /mnt/hgfs(但是通过 vmware-hgfsclient 是可以看到的)。

解决共享剪贴板不可用

https://wiki.manjaro.org/index.php?title=VMware
https://wiki.archlinux.org/index.php/VMware/Installing_Arch_as_a_guest#Drag_and_drop.2C_copy.2Fpaste
这两篇提到,剪切板依赖于 gtkmm3 但是默认没有装。装上就好了。

  1. yay -S gtkmm3

解决共享文件夹不可用

如果经上面的修复剪贴板可用则 VMware Tools 没问题,而且如果 vmware-hgfsclient 能看到启用的文件夹名称,那就一定是映射方面出错了。
在虚拟机运行下,禁用并重开共享文件夹可破。

还有问题尝试手动映射(未验证):

  1. mount -t vmhgfs .host:/ /mnt/hgfs

解决方案来源:
https://pubs.vmware.com/workstation-9/index.jsp?topic=%2Fcom.vmware.ws.using.doc%2FGUID-AB5C80FE-9B8A-4899-8186-3DB8201B1758.html

分辨率不随窗口变化,持续小分辨率

编辑 /etc/systemd/system/multi-user.target.wants/vmtoolsd.service/etc/systemd/system/multi-user.target.wants/open-vm-tools.service。哪个有改哪个。
[Unit] 节的最后加上这两行:

  1. Requires=graphical.target
  2. After=graphical.target

下次登录可生效。若要立即生效,可运行:

  1. sudo systemctl daemon-reload
  2. sudo systemctl restart vmtoolsd

(也可能是 sudo systemctl restart open-vm-tools

KDE 下怎么正确地设置 Hi-DPI

https://wiki.archlinux.org/index.php/HiDPI
这里说得很清楚了,不多赘述。
其他一些软件例如火狐等会读取 GTK 那边的设置,安装一个 dconf-editor 在其中 org/gnome/desktop/interface 下的 text-scaling-factor 来调整。

网易云音乐字好小(DPI 不正确)

QT_SCALE_FACTOR 调整字体的 DPI。
QT_SCREEN_SCALE_FACTORS 调整窗口大小。
所以一套完整的运行操作是:

  1. export QT_SCALE_FACTOR=2
  2. export QT_SCREEN_SCALE_FACTORS=1
  3. netease-cloud-music

那么对付开始菜单里的启动项就是编辑这个项目,在 command 中写:

  1. export QT_SCALE_FACTOR=2 && export QT_SCREEN_SCALE_FACTORS=1 && netease-cloud-music %U

https://wiki.archlinux.org/index.php/HiDPI#Qt_5

字体设置

基本的字体设置参考另一篇关于 Linux Mint 的配置。

KDE 下的火狐标题栏等(GTK 依赖)部分的字体

由于还是有一些软件默认读取 GTK 中的设置,因此需要用 dconf-editororg/gnome/desktop/interface 中寻找相关项进行调整。

颜色校正

感谢华硕 GL522JX 系列屏幕在没有颜色校正下屎一样的表现,超过四年的时间一直以为在 Linux 下是没救的,结果在给 Windows 用的某驱动/机型附加程序中发现了 ICC 颜色校正文件,那就好办了。
在 KDE 下,安装 colord-kde 后安装那个 ICC 并添加给这个屏幕,重新登录/启动(未验证)后即可。

屏幕撕裂/垂直同步

Intel 核显单独使用 Compositor 里的 tearing prevention 完全没卵用,根据 https://forum.manjaro.org/t/how-to-solve-tearing-problem-in-kde/5267/9 中的描述,需要在 /etc/X11/xorg.conf.d 下的显卡驱动相关文件中(我的是 90-mhwd.conf)的这段

  1. Section "Device"
  2. Identifier "..."
  3. Driver "intel"
  4. ...
  5. Option "AccelMethod" "sna"
  6. ...
  7. EndSection

中,添加一行 Option "TearFree" "true",重启后解决撕裂,可如丝般柔顺。

注:同时要注意 Compositor 中的 tearing prevention 此时不可以再是 "Full screen repaints",否则画面会时不时卡顿,造成性能问题。

Dolphin 不能以 root 打开?

https://blog.martin-graesslin.com/blog/2017/02/editing-files-as-root/
这里开发者解释了以 root 打开 Dolphin 是非常不安全的,完全可能被攻击。
对于 Kate 等也是同理。
如果要编辑 root 拥有的文件,考虑 sudoedit

单击就打开好难受啊

System Settings → Desktop Behaviors → Click behavior

装输入法

  1. yay -S fcitx-im

一键安装所有的 fcitx 依赖。

fcitx 的安装没什么难度,主要是之后要在 ~/.xprofile 中,

  1. export GTK_IM_MODULE=fcitx
  2. export QT_IM_MODULE=fcitx
  3. export XMODIFIERS="@im=fcitx"

然后注销即可。
https://www.jianshu.com/p/1cde4b7ec3c2

Powerline

非常方便,首先通过 Pacman 或 Yay 安装 powerlinepowerline-fonts 包,然后依照 https://github.com/romkatv/powerlevel10k#installation 的 Oh My ZSH 部分解决。

QQ / TIM

2019 解决方案

https://www.lulinux.com/archives/1319

KDE 启动不了?(2020 年已修复)

上文链接中有提到解决方案:安装 gnome-settings-daemon,并将 /usr/lib/gsd-xsettings 加入自动启动。
手动启动一次 gsd-xsettings 或注销后,立杆见影,但是显著地会有关于 DPI 的副作用:字体 DPI 和鼠标 DPI 以及部分主题会有问题。
主题和光标部分可通过 KDE 中的主题设置来重新设置下(Application Style -> GNOME/GTK Application Style 中,使用 Breath/Breeze),使之与 KDE 主题相配。
字体 DPI 只能安装 dconf-editor,在 org/gnome/desktop/interface 下的 text-scaling-factor 来调整。光标 DPI 暂时没有好办法,每次重新在 KDE 设置中设置成 resolution dependent。

Wine DPI

上面一小节把系统级的 DPI 恢复了,但是 TIM 的 DPI 还是不对。
运行 env WINEPREFIX="$HOME/.deepinwine/Deepin-TIM" deepin-wine winecfg,在里面找到 DPI 设置来调整。

这个过时了不看

https://www.lulinux.com/archives/3713
https://www.lulinux.com/archives/4642

快捷键

在 KRunnerLine 中输入 kmenuedit 打开 KDE Menu Editor。
以设 Dolphin 快捷键为例,在 System -> Dolphin 中,点 Advanced。最下方就是设置快捷键。
https://askubuntu.com/questions/633010/starting-dolphin-with-shortcut-metae

关于 numlock

Numlock 未锁定下,Shift + NumPad7 (Home) 与 Shift + NumPad1(End) 会被解释为小键盘 7 和 1。
如果要表现得和 Windows 一样,可以在系统设置的 Keyboard -> Layouts -> Advanced 中开启“Configure keyboard options”,找到其中“Miscellaneous compatibility options”分支,选中“Num Lock on: digits; Shift for arrow keys...”一项即可。

PulseAudio

终端里输入:

  1. pactl list sinks

  1. pacmd list-sinks

可以看到当前所有音频设备的输出规格。
如果要改位深或采样率等,打开 /etc/pulse/daemon.conf,修改 default-sample-formatdefault-sample-rateresample-method 等。

然后重启 PulseAudio。

  1. pulseaudio -k
  2. pulseaudio --restart

重新输入命令确认状态。

https://askubuntu.com/questions/868842/pros-cons-of-running-pulseaudio-at-24-bits-to-match-hardware
https://wiki.archlinux.org/index.php/PulseAudio/Troubleshooting#Audio_quality
https://medium.com/@gamunu/enable-high-quality-audio-on-linux-6f16f3fe7e1f

改完开始播放和停止播放时声音好卡怎么办

现版的 PulseAudio 服务器使用 timer-based audio scheduling 而非传统的 interrupt-driven 方法,可能不适用于正在用的这个设备。解决方法就是还回去。
打开 /etc/pulse/default.pa,找到

  1. load-module module-udev-detect

这行,改成

  1. load-module module-udev-detect tsched=0

重启 PulseAudio,搞定。

https://wiki.archlinux.org/index.php/PulseAudio/Troubleshooting#Glitches.2C_skips_or_crackling
https://askubuntu.com/questions/1033405/crackling-and-delayed-sound-after-upgrading-to-18-04

使用 Wayland

2018 年 11 月在 KDE 上的体验建议是:不要用。
https://forum.kde.org/viewtopic.php?f=289&t=151369

IDE 的 watches 上限

使用 VS Code 或者 IntelliJ 系列的 IDE 时可能会遇到 watches 上限的问题。
Archlinux 的操作方式和 Ubuntu 略有不同,主要在于 Ubuntu 要将以下内容写入 /etc/sysctl.conf 而 Arch 系要写入到 /etc/sysctl.d/99-sysctl.conf(或在更新版本中是 50-max_user_watches.conf)。

  1. fs.inotify.max_user_watches = 524288

写入完后,Ubuntu 执行

  1. sudo sysctl -p --system

Arch 系执行(具体根据实际文件名作调整)

  1. sudo sysctl -p /etc/sysctl.d/99-sysctl.conf

https://confluence.jetbrains.com/display/IDEADEV/Inotify+Watches+Limit

其他的上手配置

http://www.mamicode.com/info-detail-2359428.html

添加新批注
在作者公开此批注前,只有你和作者可见。
回复批注