┌───────────────────────┐
│                       │
│                       │
│                       │
│                       │
│                       │
│                       │
│                       │
│                       │
│                       │
│                       │
│                       │
│                       │
│                       │
│                       │
│                       │
└───────────────────────┘
Arch Linux + Bspwm 
~ CuB3y0nd
#  flex 
_PS:  [1llusion](https://git
hub.com/CuB3y0nd/1llusion)._

# 

 `Arch Linux`  1TB 
 512GB  Windows 



- EFI /efi 800MB
- / 100GB
- /home 

 Linux 

- 4GB EFI
- 200GB root
- 300GB home
- 8GB swap

`swap`  `RAM` 
 2GB

 `EFI ` 4GB使 800MB 

#  EFI  

 Windows  `EFI `  Win 10/Win 11  `Wi
n + X`  **** ** 0**  **EFI ** 
 100MB

# 

使 **GPT **  MBR 


## 

 ****  ** 0**  ****  **** **
**  `GPT `

## 

 ** 0** 
`Win + R`  `diskpart`  `list dis
k` 
 ** 0**  **GPT **  *****


# 

 **** `C`  ****  **** 
 Linux  _MB1GB = 1024MB_  _512
GB_ _524,288 MB_ 
****

# 

 Windows  ``  `` 
 [Dual boot with Windows](https://wiki.archlinux.org/title
/Dual_boot_with_Windows)

 [Dism++](https://dism.cf/) 

 `Dism++` -> `` -> `` 

**Windows 
**

# 

 `8GB`  U 

 [Rufus ](https://rufus.ie/)  [Arch Linux ](https://ar
chlinux.org/download/)使

```bash
certutil -hashfile <filename> SHA256
```

 Arch Linux  `sha256sum` 


 `Rufus` 


 `BIOS ` U  
 `UEFI` 

 `BIOS` BIOS 

 U   `Secure Boot` 


#  Secure Boot

 `Secure Boot` ban `BIOS`  `Se
cure Boot` 

 `BIOS`  `Advanced Settings`  `Security Settings`  `
Enable`  `Disable`

 U  


# Arch Linux 

## 

```bash
setfont ter-132b
```

##  UEFI

```bash
ls /sys/firmware/efi/efivars
```

西 `UEFI` `L
egacy` 

## 

`reflector` 


```bash
systemctl disable reflector.service
systemctl stop reflector.service
```

## 

```bash
timedatectl set-timezone Asia/Shanghai
timedatectl status
```

## 

 `lsblk`  `cfdisk` 



- 4G - EFI
- 200G - root
- 300G - home
- 8G - swap

`cfdisk`  ****

**`nvme0n1`  ID**

```bash
lsblk
cfdisk /dev/nvme0n1
```

## 

- EFI   fat
- root   ext4
- home   ext4
-  swap 

```bash
lsblk
mkfs.fat -F 32 /dev/nvme0n1p5
mkfs.ext4 /dev/nvme0n1p6
mkfs.ext4 /dev/nvme0n1p7
fallocate -l 8192M /mnt/swapfile
chmod 600 /mnt/swapfile
mkswap -L swap /mnt/swapfile
swapon /mnt/swapfile
lsblk
```

## 

**  EFI **

```bash
mount /dev/nvme0n1p6 /mnt
mkdir /mnt/efi
mount /dev/nvme0n1p5 /mnt/efi
mkdir /mnt/home
mount /dev/nvme0n1p7 /mnt/home
lsblk
```

## 

```bash
cp /etc/pacman.d/mirrorlist /etc/pacman.d/mirrorlist.bak
cat /dev/null > /etc/pacman.d/mirrorlist
vim /etc/pacman.d/mirrorlist


Server = https://mirrors.ustc.edu.cn/archlinux/$repo/os/$arch
Server = https://mirrors.tuna.tsinghua.edu.cn/archlinux/$repo/os/$arch
退

pacman -Sy
```

## 

 Arch Linux 

- `base`
- `base-devel`
- `linux-zen`
- `linux-zen-headers`
- `linux-firmware`

> [!TIP]
> 使 `zen`

 CPU `amd-ucode` / `intel-ucode`

使 X11 `xorg-xinit` `xorg-server`

fcitx5 

- `fcitx5`
- `fcitx5-chinese-addons`
- `fcitx5-configtool`
- `fcitx5-gtk`
- `fcitx5-material-color`
- `fcitx5-pinyin-zhwiki`



- `sudo`
- `neofetch`
- `vim`
- `neovim`
- `git`
- `wget`
- `proxychains`
- `btop`
- `bash-completion`

 `wlan` 

- `iwd`
- `networkmanager`



- `pipewire`
- `pipewire-pulse`
- `pipewire-alsa`
- `pipewire-jack`

`e2fsprogs` `ntfs-3g`



- `adobe-source-han-serif-cn-fonts`
- `wqy-zenhei`
- `noto-fonts-cjk`
- `noto-fonts-emoji`
- `noto-fonts-extra`

`bluez`



```
bat dust duf procs btop exa ripgrep fd fzf httpie hyperfine
bleachbit gimp gcolor3 simplescreenrecorder
thunar thunar-archive-plugin tumbler xarchiver
ueberzug viewnior zathura zathura-pdf-poppler
pacman-contrib copyq yt-dlp transmission-gtk
papirus-icon-theme ttf-joypixels terminus-font grsync
ffmpeg ffmpegthumbnailer aom libde265 x265 x264 libmpeg2 xvidcore libtheora libv
px sdl
jasper openjpeg2 libwebp webp-pixbuf-loader
unarchiver lha lrzip lzip p7zip lbzip2 arj lzop cpio unrar unzip zip unarj xdg-u
tils
xorg-server xorg-xinput xorg-xsetroot zramswap qogir-icon-theme
```

```bash
pacstrap -i /mnt base base-devel linux-zen linux-zen-headers linux-firmware amd-
ucode xorg-xinit xorg-server fcitx5 fcitx5-chinese-addons fcitx5-configtool fcit
x5-gtk fcitx5-material-color fcitx5-pinyin-zhwiki sudo neofetch neovim git wget 
proxychains btop iwd networkmanager alsa-utils e2fsprogs ntfs-3g bash-completion
 pipewire pipewire-pulse pipewire-alsa pipewire-jack adobe-source-han-serif-cn-f
onts wqy-zenhei noto-fonts-cjk noto-fonts-emoji noto-fonts-extra bluez
```

##  fstab

```bash
genfstab -U /mnt >>/mnt/etc/fstab
cat /mnt/etc/fstab
```

##  /mnt 

```bash
arch-chroot /mnt
```

## 

```bash
# root 使
 wheel  sudo
passwd
useradd -m cub3y0nd
passwd cub3y0nd
usermod -aG wheel,storage,power -s /usr/bin/zsh cub3y0nd
sudo nvim /etc/sudoers

 89 %wheel ALL=(ALL:ALL) ALL
```

_使 vim_

## 

```bash
nvim /etc/locale.gen

 171 en_US.UTF-8 UTF-8

locale-gen
echo 'LANG=en_US.UTF-8' > /etc/locale.conf
export LANG=en_US.UTF-8
```

##  hosts ASHES

```bash
echo ASHES > /etc/hostname
nvim /etc/hosts


127.0.0.1        localhost
::1              localhost
127.0.0.1        ASHES.localdomain        localhost
```

## 

```bash
ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
hwclock --systohc
```

## 

```bash
pacman -S grub efibootmgr os-prober ntfs-3g dosfstools mtools
nvim /etc/default/grub

 `GRUB_CMDLINE_LINUX_DEFAULT`  GRUB_CMDLINE_LINUX_DEFAULT="logle
vel=5 nowatchdog"

loglevel  5 便 nowatchdog 


 63 `GRUB_DISABLE_OS_PROBER=false`
```

##  UEFI

**使 `MBR/Legacy Boot` 
**

```bash
grub-install --target=x86_64-efi --efi-directory=/efi --bootloader-id=Arch --rec
heck
```

##  grub 

```bash
grub-mkconfig -o /boot/grub/grub.cfg
```

## 

```bash
systemctl enable NetworkManager.service
```

## 

```bash
exit
umount -lR /mnt
reboot
```

** `archiso` 
copy2ram**

 `Arch Linux`  `Wi
ndows`  `Arch Linux`使 `Wi
ndows `

**`mount`  `/dev/nvme0n1p1`  `Windows EFI` 
 `EFI `**

使 `MBR/Legacy Boot`  `mkdir` 

```bash
mkdir -p /boot/EFI/Windows
lsblk
mount /dev/nvme0n1p1 /boot/EFI/Windows
```

# Bspwm

使

 `dotfiles` [1llusion](https://github.com/CuB3y0nd/1llusion)

** fcitx  wmwindows manager bspwm**

```bash
nvim /etc/environment


export GTK_IM_MODULE=fcitx
export QI_IM_MODULE=fcitx
export XMODIFIERS=@im=fcitx
SDL_IM_MODULE=fcitx
export GLFW_IM_MODULE=ibus

cp /etc/X11/xinit/xinitrc ~/.xinitrc
nvim ~/.xinitrc


twm &
xclock -geometry 50x50-1+1 &
xterm -geometry 80x50+494+51 &
xterm -geometry 80x20+494-0 &
exec xterm -geometry 80x66+8+0 -name login


fcitx5 &
exec bspwm
```

## 

```bash
cd
curl https://raw.githubusercontent.com/CuB3y0nd/1llusion/master/install -o $HOME
/install
```

## 

```bash
chmod +x install
```

## 

```bash
./install
```

**_使 root _**

使 `startx`  `bspwm`

# AMD + NVIDIA 

## 

```bash
sudo pacman -S xf86-video-amdgpu
sudo pacman -S nvidia-dkms nvidia-settings nvidia-prime

# glmark2 
sudo pacman -S glmark2

yay -S optimus-manager optimus-manager-qt --noconfirm
```

##  optimus-manager

```bash
cp /usr/share/optimus-manager.conf /etc/optimus-manager/optimus-manager.conf

sudo -E nvim /etc/optimus-manager/optimus-manager.conf

 `pci_power_control`  `yes`

 `[amd]`  `driver`  `amdgpu`
```

## 

```bash
sudo -E nvim /etc/mkinitcpio.conf

 `kms`  `HOOKS` 

sudo mkinitcpio -p linux-zen
```

## 

```bash
sudo -E nvim ~/.xinitrc

 `/usr/bin/prime-offload`
```

使 `optimus-manager --print-mode` 使

使 `optimus-manager --switch nvidia`  `nvidia` 

 `prime-offload` `sudo prime-swi
tch`

 `wheel`  `prime-switch` 

```bash
sudo -E nvim /etc/sudoers

%wheel ALL=(ALL:ALL) NOPASSWD:/usr/bin/prime-switch
```