Skip to content

Instantly share code, notes, and snippets.

@hi-ogawa
Last active July 4, 2024 02:57
Show Gist options
  • Save hi-ogawa/a873d9406f580dfdf1e391a427a4dd0b to your computer and use it in GitHub Desktop.
Save hi-ogawa/a873d9406f580dfdf1e391a427a4dd0b to your computer and use it in GitHub Desktop.
archlinux-setup

references

dell inspiron

pre-installation

# network
iwctl
> station wlan0 connect <ssid>
>> <passphrase>

# install tools to navigate files
pacman -Sy tmux htop nnn

# file system
fdisk /dev/nvme0n1
  # keep   nvme0n1p1      (EFI)
  # create nvme0n1p2   8G (Linux swap)
  # create nvme0n1p3 450G (Linux root (x86-64))
mkswap /dev/nvme0n1p2
mkfs.ext4 /dev/nvme0n1p3

# (tweak backlight https://wiki.archlinux.org/title/backlight)
echo 100 > /sys/class/backlight/amdgpu_b10/brightness

# initialize file system
mount /dev/nvme0n1p3 /mnt
mount --mkdir /dev/nvme0n1p1 /mnt/boot
swapon /dev/nvme0n1p2
pacstrap /mnt base linux linux-firmware base-devel nano tmux htop nnn man-db man-pages networkmanager git bash-completion gnome gnome-tweaks
genfstab -U /mnt >> /mnt/etc/fstab
echo LANG=en_US.UTF-8 > /mnt/etc/locale.conf
echo myhostname > /mnt/etc/hostname

# chroot
arch-chroot /mnt

# localtime
ln -sf /usr/share/zoneinfo/Asia/Tokyo /etc/localtime
hwclock --systohc

# locale
# edit `/etc/locale.gen` to comment out
#   en_US.UTF-8 UTF-8
#   fr_FR.UTF-8 UTF-8
nano /etc/locale.gen
locale-gen

# set password for root
passwd

# boot loader (https://wiki.archlinux.org/title/Systemd-boot#Configuration)
pacman -S amd-ucode
bootctl install
cp /usr/share/systemd/bootctl/loader.conf /boot/loader/loader.conf
cp /usr/share/systemd/bootctl/arch.conf /boot/loader/entries/arch.conf # add `initrd /amd-ucode.img` and `PARTUUID`

post-installation

# create user https://wiki.archlinux.org/title/Users_and_groups#User_management
useradd -m -G wheel hiroshi
EDITOR=nano visudo  # comment out `%wheel ALL=(ALL) ALL`
passwd hiroshi # set password
passwd -l root # lock root user

# start desktop environment
systemctl enable --now NetworkManager
systemctl enable --now bluetooth
systemctl enable --now gdm

# sync time
timedatectl set-ntp true

backup/resize/restore partition

# backup and restore
dd if=/dev/nvme0n1p8 of=/mnt/backup.dd bs=64K conv=noerror,sync status=progress
dd if=/mnt/backup.dd of=/dev/sdb2 bs=64K conv=noerror,sync status=progress

# resize
e2fsck -f /dev/nvme0n1p8
resize2fs /dev/nvme0n1p8

# regenerate image
pacman -S linux

misc

  • Laptops

    • Dell Latitude
    • Dell XPS 13
  • packages

    • pacstrap
      • base-devel nano tmux htop nnn man-db man-pages networkmanager git bash-completion gnome gnome-tweaks
    • post install
      • pkgfile chromium ttf-roboto-mono noto-fonts-cjk otf-latinmodern-math
      • AUR
        • yay-bin downgrade volta-bin visual-studio-code-insiders-bin gnome-console
      • python
        • python -m ensurepip
        • python -m pip install pipx
git clone https://aur.archlinux.org/yay-bin.git
cd yay-bin
makepkg -si
  • Desktop settings

    • system
      • Touch pad
        • tap to click
        • speed
      • Keyboard: key repeat
    • Keyboard shortcut
      • Window move (Super+/)
      • translate French (Super+, and Super+.)
    • gnome-tweaks
      • Swap Control and CapsLock
      • Roboto mono as system monospace font
      • Emacs input mode
# touch pad
gsettings set org.gnome.desktop.peripherals.touchpad tap-to-click true # default false

# tweak key repeat https://askubuntu.com/a/1031070
# (EDIT: available from "Settings > Accessibility > Typing"
gsettings set org.gnome.desktop.peripherals.keyboard repeat-interval 25 # default 30
gsettings set org.gnome.desktop.peripherals.keyboard delay 150          # default 500

# keyboard shortcut
gsettings set org.gnome.desktop.wm.keybindings begin-move "['<Super>slash']" # default "['<Alt>F7']"
# create a copy of desktop app entry with `Exec=/usr/bin/chromium --gtk-version=4`
cp /usr/share/applications/chromium.desktop ~/.local/share/applications/chromium-gtk4.desktop
  • keyboard layout
    • TODO: patching Japanese Keyboard to fake US layout

drivers issues

$ lsusb | grep Fox
Bus 003 Device 002: ID 0489:e0c8 Foxconn / Hon Hai Wireless_Device

$ hex2hcd # bluez-utils

disk encryption

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment