Arch Linux 环境配置
Basic
在开始前,确保能正确访问服务器,提前配置好clash-verge(可选) 避免出现不必要的问题
快速部署:crowforkotlin github arch dotfiles
archlinux
sudo nvim /etc/pacman.conf
添加到最后一行
[archlinuxcn]
Server = https://repo.archlinuxcn.org/$arch
sudo pacman -Sy
sudo pacman -S archlinuxcn-keyring
pacman
sudo pacman -Syu noto-fonts-emoji nvm fvm jenv pyenv android-tools net-tools tree bat fastfetch curl neovim vim ghostty fcitx5-im fcitx5-rime ttf-jetbrains-mono-nerd wl-clipboard cliphist tmux ripgrep btop zram-generator p7zip reflector jq imv mpv ffmpegthumbnailer gst-plugins-base gst-plugins-good gst-libav ddcutil obs-studio inter-font ttf-fira-code zenity baobab gdu zenity dnsmasq clang camke os-prober grub efibootmgr dconf-editor wine fsearch less --needed base-devel --noconfirm
obs for intel
sudo pacman -S onevpl-intel-gpu
yay
mkdir -p ~/develop/github/ && mkdir -p ~/develop/work/ && mkdir -p ~/deveop/agents/ && git clone https://aur.archlinux.org/yay.git ~/develop/github/yay/ && cd ~/develop/github/yay/ && makepkg -si && rm -rf ~/develop/github/yay/
yay -Syu niri-sidebar-git rime-ice-git ttf-jetbrains-maple-mono-nf-xx-xx visual-studio-code-bin aliyun-adrive-bin clash-verge-rev-bin linuxqq-clipsync-git satty paru android-studio ab-download-manager-bin wps-office-cn --noconfirm
paru
paru -S ttf-maplemono-nf-cn-unhinted wf-recorder
fonts | ghostty | gtk | cursor
nvim ~/.config/fontconfig/fonts.conf
<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
<alias>
<family>monospace</family>
<prefer>
<family>Maple Mono NF CN</family>
<family>Maple Mono NF</family>
<family>JetBrainsMono Nerd Font</family>
</prefer>
</alias>
</fontconfig>
mkdir -p ~/.local/share/fonts/truetype/K2D && \
curl -s "https://fonts.google.com/download/list?family=K2D" | \
sed '1s/^)]}'\''//' | \
jq -r '.manifest.fileRefs[] | select(.url != null and (.filename | endswith(".ttf"))) | "\(.url)\t\(.filename)"' | \
xargs -r -n 2 -P 8 sh -c 'curl -L -# -o "$HOME/.local/share/fonts/truetype/K2D/$2" "$1"' _ && \
fc-cache -fv
gsettings set org.gnome.desktop.interface font-name 'K2D:weight=semibold 11'
fc-cache -fv
fc-match "Maple Mono NF CN"
fc-list | grep -i "jetbrains\|maple|K2D"
mkdir -p ~/.local/share/icons && for v in Dark Light Black; do curl -L "https://github.com/ful1e5/BreezeX_Cursor/releases/download/v2.0.1/BreezeX-${v}.tar.xz" | tar -xJ -C ~/.local/share/icons/; done
memory(zram 8g | swap 10g)
echo -e "[zram0]\nzram-size = min(ram, 8192)\ncompression-algorithm = zstd" | sudo tee /etc/systemd/zram-generator.conf
sudo systemctl daemon-reload
sudo systemctl restart systemd-zram-setup@zram0.service
sudo dd if=/dev/zero of=/swapfile bs=1M count=10240 status=progress
sudo swapoff /swapfile
sudo rm /swapfile
sudo dd if=/dev/zero of=/swapfile bs=1M count=10240 status=progress
sudo chmod 600 /swapfile
sudo mkswap /swapfile
sudo swapon /swapfile
echo '/swapfile none swap defaults 0 0' | sudo tee -a /etc/fstab
zramctl && swapon --show && free -h
Brigness
sudo modprobe i2c_dev
echo "i2c_dev" | sudo tee /etc/modules-load.d/i2c_dev.conf
sudo pacman -S ddcutil
sudo usermod -aG i2c $USER
ddcutil detect
systemctl --user restart dms.service
Niri
直接git clone省去以下流程
git clone <https://github.com/crowforkotlin/crowforkotlin.config.niri.git> ~/.config/niri/
curl -L https://github.com/crowforkotlin/BreezeX_Cursor/releases/download/1.0/BreezeX-Dark.tar.xz -o /tmp/BreezeX-Dark.tar.xz && tar -xf /tmp/BreezeX-Dark.tar.xz -C /tmp && mkdir -p ~/.local/share/icons && cp -r /tmp/BreezeX-Dark ~/.local/share/icons/ && rm /tmp/BreezeX-Dark.tar.xz && rm -rf /tmp/BreezeX-Dark
```shell
nvim ~/.config/niri/config.kdl
include "dms/custom/index.kdl"
nvim ~/.config/niri/dms/custom/index.kdl
include "config.kdl"
include "cursor.kdl"
include "layout.kdl"
include "binds.kdl"
include "windowrules.kdl"
~/.config/niri/dms/custom/cursor.dms
cursor {
xcursor-theme "BreezeX-Dark"
xcursor-size 36
hide-after-inactive-ms 15000
}
nvim ~/.config/niri/dms/custom/binds.kdl
binds {
Mod+Alt+A { screenshot show-pointer=false; }
Mod+Alt+S { screenshot-screen show-pointer=false; }
Mod+Alt+D { spawn-sh "wl-paste | satty -f -"; }
Mod+G repeat=false { toggle-overview; }
Mod+A { consume-or-expel-window-left; }
Mod+D { consume-or-expel-window-right; }
Mod+Shift+Q { spawn "sh" "-c" "pid=$(niri msg -j focused-window | jq '.pid'); [ -n \"$pid\" ] && pkill -P $pid 2>/dev/null; kill $pid 2>/dev/null"; }
Mod+T hotkey-overlay-title="Open Terminal" { spawn "ghostty"; }
Mod+B hotkey-overlay-title="Open Chrome" { spawn "google-chrome-stable"; }
}
nvim ~/.config/niri/dms/custom/layout.kdl
layout {
gaps 12
border {
width 2
}
focus-ring {
width 2
}
shadow {
on
softness 20
spread 2
offset x=-4 y=-4
color "rgba(0, 0, 0, 0.7)"
}
}
window-rule {
geometry-corner-radius 12
clip-to-geometry true
tiled-state true
draw-border-with-background false
}
overview {
workspace-shadow {
on
}
zoom 0.5
}
nvim ~/.config/niri/dms/custom/windowrules.kdl
// .... https://github.com/crowforkotlin/crowforkotlin.config.niri/blob/main/dms/custom/windowrules.kdl
Fcitx5
git clone https://github.com/sanweiya/fcitx5-mellow-themes.git
cd fcitx5-mellow-themes/
mkdir -p ~/.local/share/fcitx5/themes && cp -r ./mellow-* ~/.local/share/fcitx5/themes
nvim ~/.config/fcitx5/conf/classicui.conf
PreferTextIcon=True
ShowLayoutNameInIcon=True
UseInputMethodLanguageToDisplayText=True
TrayFont="Sans Bold 10"
TrayOutlineColor=#000000
TrayTextColor=#ffffff
Vertical Candidate List=False
WheelForPaging=True
Font="Maple Mono NF CN SemiBold Demi-Bold 11"
MenuFont="Sans 10"
TrayFont="Sans Bold 10"
TrayOutlineColor=#00000001
TrayTextColor=#ffffff
PreferTextIcon=True
ShowLayoutNameInIcon=True
UseInputMethodLanguageToDisplayText=True
Theme=mellow-youlan
DarkTheme=mellow-youlan-dark
UseDarkTheme=False
UseAccentColor=True
PerScreenDPI=False
ForceWaylandDPI=0
EnableFractionalScale=True
rime
nvim ~/.local/share/fcitx5/rime/default.custom.yaml
patch:
schema_list:
- schema: rime_ice
"menu/page_size": 5
key_binder/bindings:
- { accept: bracketleft, send: Page_Up, when: has_menu }
- { accept: bracketright, send: Page_Down, when: has_menu }
- { accept: Left, send: Up, when: has_menu }
- { accept: Right, send: Down, when: has_menu }
本博客所有文章除特别声明外,均采用 CC BY-NC-SA 4.0 许可协议。转载请注明来源 crowforkotlin!
评论



