Manjaro Gnome配置及美化指南

美化示例

换源并补全依赖

选择中科大(ustc)或清华(tsinghua)的镜像站
使用uname -r命令查看内核版本, 并选择正确的内核头文件

Bleeding Edge的用户不要换中国源,软件包更新慢

1
2
sudo pacman-mirrors -i -c China -m rank
sudo pacman -Syyu base-devel linux-headers power-profiles-daemon gst-libav gst-plugin-pipewire eog vlc xwaylandvideobridge fastfetch gedit locate egl-wayland xdg-desktop-portal xdg-desktop-portal-wlr grim --needed

安装显卡驱动(虚拟机不需要)

1
2
3
sudo mhwd -a pci nonfree 0300 
sudo pacman -R libva-vdpau-driver xf86-video-intel xf86-video-nouveau #解决VLC闪退
sudo pacman -S libva-nvidia-driver #同上

创建并使用交换文件(如果安装时没有交换分区)

这里以16G为例

1
2
3
4
5
6
7
8
su
mkswap -U clear --size 16G --file /swapfile
swapon /swapfile
echo '/swapfile none swap defaults 0 0' >> /etc/fstab
cat /etc/fstab
free -h
reboot
free -h

添加[archlinuxcn]源, 安装yay助手

etc/pacman.conf文件末尾添加:

1
2
[archlinuxcn]
Server = https://mirrors.ustc.edu.cn/archlinuxcn/$arch

然后安装密钥并更新

1
2
3
sudo pacman -Syy archlinuxcn-keyring
sudo pacman -Syyu yay
yay -S 7-zip octopi bleachbit # 软件包缓存清理和垃圾清理工具

配置代理

简体中文本地化

安装字体和输入法

1
2
sudo pacman -S adobe-source-han-sans-jp-fonts adobe-source-han-serif-jp-fonts adobe-source-han-sans-cn-fonts adobe-source-han-serif-cn-fonts poppler-data noto-fonts-cjk noto-fonts-emoji ttf-roboto noto-fonts man-pages-zh_cn ttf-dejavu ibus ibus-libpinyin
yay -S ibus-mozc mozc-ut # 日文输入法, 安装后重启, 在设置添加即可, 并编辑~/.config/mozc/ibus_config.textproto修改active_on_launch为True

修复字形

1
2
sudo touch /etc/fonts/conf.d/64-language-selector-prefer.conf
sudo nano /etc/fonts/conf.d/64-language-selector-prefer.conf

写入以下配置:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
<!-- sans-serif alias -->
<alias>
<family>sans-serif</family>
<prefer>
<!-- Noto Sans CJK family -->
<family>Noto Sans CJK SC</family>
<family>Noto Sans CJK TC</family>
<family>Noto Sans CJK JP</family>
<!-- Source Han Sans family -->
<family>Source Han Sans SC</family>
<family>Source Han Sans TC</family>
<family>Source Han Sans HW</family>
<family>Source Han Sans K</family>
</prefer>
</alias>

<!-- monospace alias -->
<alias>
<family>monospace</family>
<prefer>
<!-- Noto Sans Mono CJK family -->
<family>Noto Sans Mono CJK SC</family>
<family>Noto Sans Mono CJK TC</family>
<family>Noto Sans Mono CJK JP</family>
<!-- Source Han Sans family -->
<family>Source Han Sans SC</family>
<family>Source Han Sans TC</family>
<family>Source Han Sans HW</family>
<family>Source Han Sans K</family>
</prefer>
</alias>
</fontconfig>

刷新字体缓存, 重启

1
2
fc-cache -fv
sudo reboot

配置中文输入法, 安装词典

打开云拼音和内置词典

设置可以导入用户词典, 比如这个仓库

安装windows字体

  • 方法一: 使用软件仓库
1
2
3
4
5
sudo usermod -aG disk $USER
yay -S httpdirfs
yay -S ttf-ms-win11-auto
# yay -S ttf-ms-win10-auto
sudo reboot
  • 方法二: 使用镜像提取

把windows的ISO内的source/install.wim复制到主目录, 然后执行

1
2
3
4
5
cd ~
7z e install.wim Windows/{Fonts/"*".{ttf,ttc},System32/Licenses/neutral/"*"/"*"/license.rtf} -ofonts/
mkdir ~/.local/share/fonts
mv ~/fonts/* ~/.local/share/fonts/
fc-cache -fv

安装编程字体

以FiraCode为例

1
2
3
4
5
cd
wget https://github.com/ryanoasis/nerd-fonts/releases/download/v3.2.1/FiraCode.zip
unzip FiraCode.zip -d ~/.local/share/fonts
rm FiraCode.zip
fc-cache -fv

使用Alacritty终端

1
2
3
4
sudo pacman -S alacritty
mkdir ~/.config/alacritty/
touch ~/.config/alacritty/alacritty.toml
gedit ~/.config/alacritty/alacritty.toml

添加以下内容:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
[font]
size = 12.0

[font.normal]
family = "FiraCode Nerd Font"
style = "Regular"

[window]
opacity = 0.9
dynamic_padding = true
blur = true

[window.padding]
x = 15
y = 15

[window.dimensions]
columns = 120
lines = 36

[selection]
save_to_clipboard = true

CachyOS的配置可以在这里找到, 源文件内容如下

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
[env]
TERM = "xterm-256color"
WINIT_X11_SCALE_FACTOR = "1"

[window]
dynamic_padding = true
decorations = "full"
title = "Alacritty@CachyOS"
opacity = 0.8
decorations_theme_variant = "Dark"

[window.dimensions]
columns = 140
lines = 40

[window.class]
instance = "Alacritty"
general = "Alacritty"

[scrolling]
history = 10000
multiplier = 3

[colors]
draw_bold_text_with_bright_colors = true

[colors.primary]
background = "0x2E3440"
foreground = "0xD8DEE9"

[colors.normal]
black = "0x3B4252"
red = "0xBF616A"
green = "0xA3BE8C"
yellow = "0xEBCB8B"
blue = "0x81A1C1"
magenta = "0xB48EAD"
cyan = "0x88C0D0"
white = "0xE5E9F0"

[colors.bright]
black = "0x4C566A"
red = "0xBF616A"
green = "0xA3BE8C"
yellow = "0xEBCB8B"
blue = "0x81A1C1"
magenta = "0xB48EAD"
cyan = "0x8FBCBB"
white = "0xECEFF4"

[font]
size = 12

[font.normal]
family = "FiraCode Nerd Font"
style = "Regular"

[font.bold]
family = "FiraCode Nerd Font"
style = "Bold"

[font.italic]
family = "FiraCode Nerd Font"
style = "Italic"

[font.bold_italic]
family = "FiraCode Nerd Font"
style = "Bold Italic"

[selection]
semantic_escape_chars = ",│`|:\"' ()[]{}<>\t"
save_to_clipboard = true

[cursor]
style = "Underline"
vi_mode_style = "None"
unfocused_hollow = true
thickness = 0.15

[mouse]
hide_when_typing = true

[[mouse.bindings]]
mouse = "Middle"
action = "PasteSelection"

[keyboard]
[[keyboard.bindings]]
key = "Paste"
action = "Paste"

[[keyboard.bindings]]
key = "Copy"
action = "Copy"

[[keyboard.bindings]]
key = "L"
mods = "Control"
action = "ClearLogNotice"

[[keyboard.bindings]]
key = "L"
mods = "Control"
mode = "~Vi"
chars = "\f"

[[keyboard.bindings]]
key = "PageUp"
mods = "Shift"
mode = "~Alt"
action = "ScrollPageUp"

[[keyboard.bindings]]
key = "PageDown"
mods = "Shift"
mode = "~Alt"
action = "ScrollPageDown"

[[keyboard.bindings]]
key = "Home"
mods = "Shift"
mode = "~Alt"
action = "ScrollToTop"

[[keyboard.bindings]]
key = "End"
mods = "Shift"
mode = "~Alt"
action = "ScrollToBottom"

[[keyboard.bindings]]
key = "V"
mods = "Control|Shift"
action = "Paste"

[[keyboard.bindings]]
key = "C"
mods = "Control|Shift"
action = "Copy"

[[keyboard.bindings]]
key = "F"
mods = "Control|Shift"
action = "SearchForward"

[[keyboard.bindings]]
key = "B"
mods = "Control|Shift"
action = "SearchBackward"

[[keyboard.bindings]]
key = "C"
mods = "Control|Shift"
mode = "Vi"
action = "ClearSelection"

[[keyboard.bindings]]
key = "Key0"
mods = "Control"
action = "ResetFontSize"

[general]
live_config_reload = true
working_directory = "None"

zsh输入p10k configure 可以重新设置zsh主题

来看看系统设置

设置合适的分辨率, 屏幕刷新率, 并打开夜间模式

5min熄屏设置为从不

外观, 设置喜欢的壁纸

默认应用示例

设置自定义快捷键

示例设置打开主目录, 浏览器, 终端的快捷键

关于打印机, Manjaro应该开箱即用, 否则查看此链接CUPS

日期和时间设置

设置用户头像

设置Nautilus

再看看Tweaks

自定义系统字体, 并按需改变字体DPI

设置主题和背景

1
yay -S orchis-theme

添加窗口按钮和居中显示

自定义开机启动的程序

安装并配置拓展

安装部分依赖

1
yay -S gnome-browser-connector touchegg

打开Firefox浏览器, 进入拓展网站, 加入收藏夹, 点击页面上的Click here to install browser extension, 然后刷新页面

安装农历插件依赖

1
2
3
4
5
6
cd
sudo pacman -S cpio
git clone https://gitlab.gnome.org/Nei/ChineseCalendar.git
cd ChineseCalendar
chmod +x install.sh
./install.sh

示例拓展列表:

简单配置

  • Dash to Dock使用内置主题
  • AppIndicator and KStatusNotifierItem Support可以把图标放左边, 缓解200%缩放率导致的右侧图标过挤
  • 根据需要自定义Dock拦内的应用

GDM开启所有桌面选项

1
sudo ln -s /dev/null /etc/udev/rules.d/61-gdm.rules 

补充说明

  • Slow loading of system icons/slow GDM login: Problems with the loading of system icons, such the ones in the title bar of Files, might be solved by executing the following command:

    1
    sudo gdk-pixbuf-query-loaders --update-cache

    Running the aforementioned command may also fix repeated occurrences of the “Oh no! Something has gone wrong!” error screen and/or very slow loading and login with GDM as described in the following forum thread.

  • 开启Wayland: 可以使用Manjaro自带的Layout Switcher

  • spectacle/flameshot截图工具

  • 对于flameshot无法在wayland下运行, 这样启动: env XDG_SESSION_TYPE= QT_QPA_PLATFORM=wayland flameshot &

  • GnomeCalendar可以添加日历订阅链接

  • Enable button and menu icons: gsettings set org.gnome.settings-daemon.plugins.xsettings overrides "{'Gtk/ButtonImages': <1>, 'Gtk/MenuImages': <1>}"

  • 对于QEMU/KVM虚拟机里的archlinux, 输入sudo pacman -S spice-vdagent xf86-video-qxl qemu-guest-agent, 然后编辑/etc/mkinitcpio.conf文件, 然后修改开头MODULES=(qxl virtio-gpu virtio virtio_scsi virtio_blk virtio_pci virtio_net virtio_ring), 再sudo mkinitcpio -P重新生成镜像即可

  • 中文压缩包乱码, 使用: unzip -O gbk file.zip

  • 列出特定仓库软件包pacman -Sl archlinuxcn | grep '\[installed\]'


Manjaro Gnome配置及美化指南
https://rukkhadevata123.github.io/2024/10/08/manjaro/
作者
Dawn Chirps
发布于
2024年10月8日
许可协议