1387 字
7 分钟
配置Arch Linux

引导设置#

这部分内容将把Linux暴露给Opencore,以从Opencore直接启动。

  1. 通过OC进入Linux

开启OC的Openshell,通过执行\EFI\grub_uefi\grubx64.efi来进入linux。

输入fs0:或者fs1:等进入文件系统, 通过lsblk查看硬盘,一般而言,fs0:是第一个硬盘位,fs1:是第二个硬盘位

由于之前执行grub-install时指定了--bootloader-id=grub_uefi因此入口在grub_uefi文件夹下

  1. 生成配置
Terminal window
sudo efibootmgr -c -L "Linux" -l "\EFI\grub_uefi\grubx64.efi" -d "/dev/nvme0n1" -p 1
  • -c: Create
  • -L "Linux": Label the boot entry (you can change it to whatever you want)
  • -l "\EFI\pathto\filex64.efi": loader file path, must be in a format the UEFI Firmware can use, which means \ for pathing instead of / you find in unix
  • -d "/dev/sda": disk path so that efibootmgr know which disk the UEFI firmware should read the file from, it can be /dev/nvme0nX (with X as a number) if you’re using NVMe
  • -p 1: point the partition number we found earlier, in case your EFI partition is the first one, this can be omitted

由于之前执行grub-install时指定--bootloader-id=grub_uefi,因此路径为grub_uefi

  1. 重启

在Opencore界面会发现一个新的叫EFI的入口,即为该linux。

配置部分软件#

配置git#

Terminal window
sudo pacman -S git
git config --global user.email "[email protected]"
git config --global user.name "YOUR NAME"

给git配置代理:

Terminal window
git config --global http.proxy http://127.0.0.1:10809
git config --global https.proxy http://127.0.0.1:10809

配置SSH#

生成SSH Key:

Terminal window
ssh-keygen -t ed25519 -C "[email protected]"

全部默认即可。

然后把Key添加进SSH agent:

Terminal window
eval "$(ssh-agent -s)"
ssh-add ~/.ssh/id_ed25519

获取SSH公钥:

Terminal window
cat ~/.ssh/id_ed25519.pub

然后把内容粘贴进github即可。

配置paru#

paru是一款方便的包管理工具。

Terminal window
git clone https://aur.archlinux.org/paru-bin.git
cd paru
makepkg -si

更改配置文件使其支持代码高亮:

Terminal window
sudo vim /etc/pacman.conf

去掉Color行的注释。

更改配置更改排序方式:

Terminal window
sudo vim /etc/paru.conf

paru -Qtdq查看孤儿包。

去掉BottomUp行的注释。

配置Rust#

配置rustup#

Terminal window
pacman -S rustup

然后通过如下命令配置rustup国内镜像源:

Terminal window
vim ~/.bash_profile

然后添加如下两行:

Terminal window
export RUSTUP_UPDATE_ROOT=https://mirrors.ustc.edu.cn/rust-static/rustup
export RUSTUP_DIST_SERVER=https://mirrors.ustc.edu.cn/rust-static

下载Rust#

Terminal window
rustup default stable

使用rustup install stable不会从设置好的国内镜像下载,而是从国外下载,速度很慢

配置cargo镜像源#

Terminal window
vim ~/.cargo/config

并添加如下内容:

Terminal window
[source.crates-io]
registry = "https://github.com/rust-lang/crates.io-index"
replace-with = 'sjtu'
# 上海交通大学
[source.sjtu]
registry = "https://mirrors.sjtug.sjtu.edu.cn/git/crates.io-index/"

v2rayA#

Terminal window
paru v2raya-bin v2ray

同时开机启动:

Terminal window
sudo systemctl enable --now v2raya

然后从浏览器进入http://localhost:2017,创建一个帐号。

忘记密码使用sudo v2raya --reset-password命令重置。

进行如下设置:

  • 透明代理:大陆白名单
  • 透明代理方式:redirect
  • 规则端口分流模式:大陆白名单
  • 防止DNS污染:仅防止DNS劫持(快速)
  • 特殊模式:supervisor
  • TCPFastOpen:保持系统默认

其余选项均默认即可。

注意,若选择GFWList,则需要下载对应的规则库,点击右上角的更新来下载。

配置Neofetch#

Terminal window
paru neofetch

配置Terminal#

Terminal window
paru zsh
zsh

然后输入0。

Terminal window
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"

选择把shell切换为zsh,在这里需要重启系统。

安装插件#

自动补齐#
Terminal window
git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions

然后编辑配置文件:

Terminal window
vim ~/.zshrc

添加相应内容:

Terminal window
plugins=(other plugins... zsh-autosuggestions)

不同插件之间使用空格分割。

代码高亮#
Terminal window
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting

继续编辑配置文件:

Terminal window
plugins=( [plugins...] zsh-syntax-highlighting)
Powerlevel 10K#

安装对应字体:

Terminal window
paru ttf powerlevel10k

然后安装:

Terminal window
git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k

编辑配置文件,更改主题:

Terminal window
ZSH_THEME="powerlevel10k/powerlevel10k"

然后重启terminal进行自动配置。

输入p10k configure可以重新进行设置

Wezterm主题#

Terminal window
git clone https://github.com/catppuccin/wezterm.git
mkdir -p ~/.config/wezterm/colors
cp ./wezterm/Catppuccin.toml ~/.config/wezterm/colors/

中文输入支持#

Terminal window
paru fcitx5-im
paru fcitx5 chinese addon

安装所有与im相关的community包,然后在设置中搜索input method添加pinyin

设置环境变量#

欲在程序中正常启用 Fcitx5, 需设置以下环境变量,并重新登录:

Terminal window
sudo vim /etc/environment
GTK_IM_MODULE=fcitx
QT_IM_MODULE=fcitx
XMODIFIERS=@im=fcitx
INPUT_METHOD=fcitx
SDL_IM_MODULE=fcitx
GLFW_IM_MODULE=ibus

聊天软件#

Terminal window
paru tim qq
paru wechat desktop
paru telegram

配置vscode#

使得vscode的全局菜单起作用:

Terminal window
paru libdbusmenu-glib

支持vscode的keyring:

Terminal window
paru gnome keyring

为vscode设置clangd:

Terminal window
paru clang

然后在设置中设置clangd的地址:

Terminal window
whereis clangd

配置Chrome#

启用视频播放硬件加速:

Terminal window
mkdir -p ~/.config
echo "--disable-features=UseChromeOSDirectVideoDecoder --enable-features=VaapiVideoDecoder --ignore-gpu-blocklist --use-gl=desktop" > ~/.config/chrome-flags.conf

配置部分驱动#

Vulkan支持#

Terminal window
paru mesa vulkan
sudo sysctl dev.i915.perf_stream_paranoid=0

NTFS支持#

Terminal window
paru ntfsprogs-ntfs3

触控板多手势支持#

Terminal window
sudo pacman -S touchegg
paru touche
sudo systemctl enable touchegg.services

指纹识别支持#

Terminal window
paru fprint

系统主题配置#

首先需要下载一些依赖:

Terminal window
paru kvantum

配置dock#

Terminal window
paru latte dock

然后启动latte dock

高级模式#

右键dock点击编辑,然后开启高级模式:

Apperance:

  • background:
    • height: 100%
    • opacity: 30%
    • check: blur
    • radius: 15%
  • margins
    • screen edge: 4px

点击编辑面板左下角的Add panel,点击添加空白panel。

配置上边栏#

右键上边栏,选择编辑:

Apperance:

  • items
    • absolute size: 30px
  • length
    • maximum: 99%
  • margins
    • screen edge: 3px
  • background
    • opacity: 30%
    • check: blur
    • radius: 50%
    • check: prefre opac background when window touching

Behavior:

  • actions
    • check: hide floating gap when maxmaized window

配置Widgets#

首先下载一些控件:

  • better inline clock
  • application name mac style

右键桌面空白区域,点击添加Widgets:

  • 搜索system tray,添加到上边栏最右侧
  • 搜索application menu,添加到最左侧
  • 搜索bertter inline clock,添加到中间
  • 搜索application title,添加到application menu右侧
  • 搜索global menu,添加到application title右侧

编辑application title,编辑no active window label为custom text,并添加文本内容。

配置KRunner#

点击编辑,使其居中,取消勾选记住上次搜索。

系统设置#

首先把clicking files or folders改成selects them
打开workspace behaviordesktop effect里的blurmagic lampslide backoverview,并为overview设置快捷键,用touche配置相应的手势操作。

Global theme#

下载layan,并启用。

Application style#

下载layan gtk theme,并启用。

Window decoration#

编辑关闭、最大化、最小化按键位置。

Icons#

下载Mac mod flat icon,并启用Papirus。

配置Kvantum#

这里下载相应的文件,然后启动Kvantum manager,安装并使用该主题,编辑该主题,取消勾选Disable translucency when non-integer scaling,否则部分内容不会blur。

配置Arch Linux
https://blog.xiaobaizhang.top/posts/archlinux-setup/
作者
张小白
发布于
2022-03-17
许可协议
CC BY-NC-SA 4.0