#
Arch Linux + i3wm 配置使用
基于 shikaij/workstation 配置仓库
1. 制作启动盘
- Rufus(Windows)或
sudo dd if=arch.iso of=/dev/sdx bs=4M status=progress && sync - BIOS 关 Secure Boot,U 盘启动
2. 安装系统
# 连网
iwctl # 进入交互
station wlan0 connect "WiFi名" # 连 WiFi
exit
# 换清华源
vim /etc/pacman.d/mirrorlist
# 加一行: Server = https://mirrors.tuna.tsinghua.edu.cn/archlinux/$repo/os/$arch
# 分区 (NVMe: nvme0n1, SATA: sda)
lsblk
cfdisk /dev/nvme0n1
# 建: EFI(512M) + root(30-50G) + home(剩余)
# 格式化
mkfs.fat -F32 /dev/nvme0n1p1
mkfs.ext4 /dev/nvme0n1p2
mkfs.ext4 /dev/nvme0n1p3
# 挂载
mount /dev/nvme0n1p2 /mnt
mkdir -p /mnt/boot/efi /mnt/home
mount /dev/nvme0n1p1 /mnt/boot/efi
mount /dev/nvme0n1p3 /mnt/home
# 安装基础
pacstrap /mnt linux linux-headers linux-firmware base base-devel efibootmgr \
networkmanager neovim grub os-prober intel-ucode sof-firmware
genfstab -U /mnt >> /mnt/etc/fstab
arch-chroot /mnt3. 基础配置
# 时区
ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
hwclock --systohc
# 语言
nvim /etc/locale.gen # 去掉 en_US.UTF-8 前的 #
locale-gen
echo 'LANG=en_US.UTF-8' > /etc/locale.conf
# 主机名
echo "myarch" > /etc/hostname
nvim /etc/hosts # 加: 127.0.0.1 localhost / ::1 localhost / 127.0.1.1 myarch.localdomain myarch
# 密码&用户
passwd
useradd -mG wheel <用户名>
passwd <用户名>
EDITOR=nvim visudo # 取消 %wheel ALL=(ALL) ALL 注释
# 引导
grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=GRUB
grub-mkconfig -o /boot/grub/grub.cfg
exit
umount -a
reboot4. 装完系统后
# 联网
systemctl enable --now NetworkManager
nmcli dev wifi connect "WiFi名" password "密码"5. 装 i3wm 整套
# 装 yay
sudo pacman -S --needed git base-devel
git clone https://aur.archlinux.org/yay.git && cd yay && makepkg -si
# 装系统包(i3wm + 所有工具)
yay -Syy xorg-server sddm neovim i3-wm i3lock xss-lock polybar rofi \
rofi-emoji alacritty kitty pcmanfm mate-polkit picom nitrogen feh \
ttf-jetbrains-mono-nerd ttf-font-awesome noto-fonts-emoji pavucontrol \
network-manager-applet starship dunst zathura zathura-pdf-poppler \
zsh zsh-syntax-highlighting zsh-autosuggestions tmux eza ranger \
ripgrep lazygit flameshot firefox blueman bluez brightnessctl \
xorg-xrandr xclip python-pip mpv dunst lxappearance-gtk3
# 装驱动(根据 CPU 选)
yay -Syy xorg intel-media-driver vulkan-intel intel-gmmlib # Intel
# yay -Syy xf86-video-amdgpu xf86-video-ati amd-ucode amdvlk vulkan-radeon # AMD6. 拉配置
cd ~
git clone https://github.com/shikaij/workstation.git
# 复制配置
cp workstation/.zshrc ~/
cp workstation/.bashrc ~/
cp workstation/.vimrc ~/
cp workstation/.tmux.conf ~/
cp -r workstation/.config/* ~/.config/
# 改默认 shell 为 zsh
chsh -s /bin/zsh7. 启动 i3
sudo systemctl enable --now sddm
reboot8. 快捷键速查
| 快捷键 | 功能 | 快捷键 | 功能 |
|---|---|---|---|
| Win+Enter | 终端 | Win+d | 应用启动器 |
| Win+w | 浏览器 | Win+n | 文件管理器 |
| Win+1~8 | 切工作区 | Win+Shift+1~8 | 移窗口到工作区 |
| Win+h/j/k/l | 移动焦点 | Win+Shift+h/j/k/l | 移动窗口 |
| Win+Ctrl+h/j/k/l | 调窗口大小 | Win+m | 全屏 |
| Win+Space | 浮动切换 | Win+z/a | 水平/垂直分割 |
| Win+Shift+q | 关闭窗口 | Win+Shift+e | 电源菜单 |
| Win+Shift+x | 锁屏 | Win+Shift+c | 重载配置 |
| 全屏截图 | Win+Print | 区域截图 | |
| Fn+亮度和音量键 | 调亮度/音量 |
9. 笔记本额外设置
# 触摸板手势
sudo tee /etc/X11/xorg.conf.d/90-touchpad.conf <<'EOF'
Section "InputClass"
Identifier "touchpad"
MatchIsTouchpad "on"
Driver "libinput"
Option "Tapping" "on"
EndSection
EOF
# 亮度控制
sudo tee /etc/udev/rules.d/backlight.rules <<'EOF'
ACTION=="add", SUBSYSTEM=="backlight", RUN+="/bin/chgrp video $sys$devpath/brightness", RUN+="/bin/chmod g+w $sys$devpath/brightness"
EOF
sudo usermod -aG video $USER
# 合盖锁屏
sudo nvim /etc/systemd/logind.conf # 取消 HandleLidSwitch=suspend 注释
TAGS:
无标签
相关推荐
- 暂无相关推荐,看看别的吧。
0 评论