引导设置
这部分内容将把Linux暴露给Opencore,以从Opencore直接启动。
- 通过OC进入Linux
开启OC的Openshell,通过执行\EFI\grub_uefi\grubx64.efi
来进入linux。
输入
fs0:
或者fs1:
等进入文件系统, 通过lsblk
查看硬盘,一般而言,fs0:
是第一个硬盘位,fs1:
是第二个硬盘位
由于之前执行
grub-install
时指定了--bootloader-id=grub_uefi
因此入口在grub_uefi
文件夹下
- 生成配置
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
- 重启
在Opencore界面会发现一个新的叫EFI
的入口,即为该linux。
配置部分软件
配置git
sudo pacman -S gitgit config --global user.name "YOUR NAME"
给git配置代理:
git config --global http.proxy http://127.0.0.1:10809git config --global https.proxy http://127.0.0.1:10809
配置SSH
生成SSH Key:
全部默认即可。
然后把Key添加进SSH agent:
eval "$(ssh-agent -s)"ssh-add ~/.ssh/id_ed25519
获取SSH公钥:
cat ~/.ssh/id_ed25519.pub
然后把内容粘贴进github即可。
配置paru
paru是一款方便的包管理工具。
git clone https://aur.archlinux.org/paru-bin.gitcd parumakepkg -si
更改配置文件使其支持代码高亮:
sudo vim /etc/pacman.conf
去掉Color行的注释。
更改配置更改排序方式:
sudo vim /etc/paru.conf
paru -Qtdq
查看孤儿包。
去掉BottomUp
行的注释。
配置Rust
配置rustup
pacman -S rustup
然后通过如下命令配置rustup国内镜像源:
vim ~/.bash_profile
然后添加如下两行:
export RUSTUP_UPDATE_ROOT=https://mirrors.ustc.edu.cn/rust-static/rustupexport RUSTUP_DIST_SERVER=https://mirrors.ustc.edu.cn/rust-static
下载Rust
rustup default stable
使用
rustup install stable
不会从设置好的国内镜像下载,而是从国外下载,速度很慢
配置cargo镜像源
vim ~/.cargo/config
并添加如下内容:
[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
paru v2raya-bin v2ray
同时开机启动:
sudo systemctl enable --now v2raya
然后从浏览器进入http://localhost:2017
,创建一个帐号。
忘记密码使用
sudo v2raya --reset-password
命令重置。
进行如下设置:
- 透明代理:大陆白名单
- 透明代理方式:redirect
- 规则端口分流模式:大陆白名单
- 防止DNS污染:仅防止DNS劫持(快速)
- 特殊模式:supervisor
- TCPFastOpen:保持系统默认
其余选项均默认即可。
注意,若选择GFWList,则需要下载对应的规则库,点击右上角的更新来下载。
配置Neofetch
paru neofetch
配置Terminal
paru zshzsh
然后输入0。
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
选择把shell切换为zsh,在这里需要重启系统。
安装插件
自动补齐
git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
然后编辑配置文件:
vim ~/.zshrc
添加相应内容:
plugins=(other plugins... zsh-autosuggestions)
不同插件之间使用空格分割。
代码高亮
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting
继续编辑配置文件:
plugins=( [plugins...] zsh-syntax-highlighting)
Powerlevel 10K
安装对应字体:
paru ttf powerlevel10k
然后安装:
git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k
编辑配置文件,更改主题:
ZSH_THEME="powerlevel10k/powerlevel10k"
然后重启terminal进行自动配置。
输入
p10k configure
可以重新进行设置
Wezterm主题
git clone https://github.com/catppuccin/wezterm.gitmkdir -p ~/.config/wezterm/colorscp ./wezterm/Catppuccin.toml ~/.config/wezterm/colors/
中文输入支持
paru fcitx5-imparu fcitx5 chinese addon
安装所有与im相关的community包,然后在设置中搜索input method
添加pinyin
。
设置环境变量
欲在程序中正常启用 Fcitx5, 需设置以下环境变量,并重新登录:
sudo vim /etc/environmentGTK_IM_MODULE=fcitxQT_IM_MODULE=fcitxXMODIFIERS=@im=fcitxINPUT_METHOD=fcitxSDL_IM_MODULE=fcitxGLFW_IM_MODULE=ibus
聊天软件
paru tim qqparu wechat desktopparu telegram
配置vscode
使得vscode的全局菜单起作用:
paru libdbusmenu-glib
支持vscode的keyring:
paru gnome keyring
为vscode设置clangd:
paru clang
然后在设置中设置clangd的地址:
whereis clangd
配置Chrome
启用视频播放硬件加速:
mkdir -p ~/.configecho "--disable-features=UseChromeOSDirectVideoDecoder --enable-features=VaapiVideoDecoder --ignore-gpu-blocklist --use-gl=desktop" > ~/.config/chrome-flags.conf
配置部分驱动
Vulkan支持
paru mesa vulkansudo sysctl dev.i915.perf_stream_paranoid=0
NTFS支持
paru ntfsprogs-ntfs3
触控板多手势支持
sudo pacman -S toucheggparu touchesudo systemctl enable touchegg.services
指纹识别支持
paru fprint
系统主题配置
首先需要下载一些依赖:
paru kvantum
配置dock
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 behavior
中desktop effect
里的blur
、magic lamp
、slide back
、overview
,并为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。