#
i3wmarchlinux 2026-06-18

Arch Linux + i3wm 配置使用

By io 113 Views 13 MIN READ 0 Comments
基于 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 /mnt

3. 基础配置

# 时区
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
reboot

4. 装完系统后

# 联网
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  # AMD

6. 拉配置

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/zsh

7. 启动 i3

sudo systemctl enable --now sddm
reboot

8. 快捷键速查

快捷键功能快捷键功能
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重载配置
Print全屏截图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 注释

本文由 io 原创

采用 CC BY-NC-SA 4.0 协议进行许可

转载请注明出处:https://godd.asia/index.php/archives/39/

TAGS: 无标签

相关推荐

  • 暂无相关推荐,看看别的吧。

0 评论

发表评论