Contents

Arch linux XPS-13 9310

Install

Before Installation

Enter BIOS with F2 and configure:

  • “System Configuration” > “SATA Operation”: “AHCI”
  • “Secure Boot” > “Secure Boot Enable”: “Disabled”

Create partitions

1
cgdisk /dev/nvme0n1
1
2
3
4
5
6
7
1 1024MB EFI partition
Block size 2147484
Hex code ef00
Label boot
2 100% Linux partition (to be encrypted)
Hex code 8300
Label root

Formatting and encryption

  • Format boot partition

    1
    
    mkfs.fat -F32 /dev/nvme0n1p1
    
  • create Lvm crypted partition

    1
    2
    3
    4
    5
    
    cryptsetup luksFormat /dev/nvme0n1p2
    
    cryptsetup open /dev/nvme0n1p2 luks
    
    mkfs.ext4 /dev/mapper/luks
    
  • Mount partition

    1
    2
    3
    
    mount /dev/mapper/luks /mnt
    mkdir -p /mnt/boot
    mount /dev/nvme0n1p1 /mnt/boot
    
  • Install base packages

    1
    
    pacstrap /mnt base base-devel vim git sudo
    
  • Generate fstab for mount partitions

     1
     2
     3
     4
     5
     6
     7
     8
     9
    10
    11
    
    genfstab -U /mnt >>/mnt/etc/fstab
    
    # Static information about the filesystems.
    # See fstab(5) for details.
    
    # <file system> <dir> <type> <options> <dump> <pass>
    # /dev/mapper/luks LABEL=luks
    UUID=<UUID-mapper-luks>	/         	ext4      	rw,noatime,nodiratime	0 1
    
    # /dev/nvme0n1p1
    UUID=<UUID-boot>      	/boot     	vfat      	rw,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=iso8859-1,shortname=mixed,utf8,errors=remount-ro	0 2
    
  • Loggin new arch linux

    1
    2
    3
    4
    5
    6
    
    arch-chroot /mnt
    
    rm /etc/localtime
    ln -s /usr/share/zoneinfo/Europe/Warsaw /etc/localtime
    
    echo <your-hostname> > /etc/hostname
    
  • Sound, and Video Drivers…

    1
    2
    3
    
    pacman -S  mesa xorg-server xorg-apps xorg-xinit xorg-twm xterm xorg-drivers alsa-utils pulseaudio pulseaudio-alsa xf86-input-synaptics xf86-input-libinput intel-ucode b43-fwcutter networkmanager nm-connection-editor network-manager-applet polkit-gnome ttf-dejavu gnome-keyring xdg-user-dirs gvfs virtualbox-guest-modules-arch virtualbox-guest-utils wpa_supplicant dialog
    
      systemctl enable NetworkManager
    
  • Cups (printer)

    1
    2
    3
    
    pacman -S ghostscript gsfonts system-config-printer gtk3-print-backends cups cups-pdf cups-filters
    
    systemctl enable org.cups.cupsd.service
    
  • Add language and keyboard

    1
    2
    3
    4
    5
    
    echo LANG=en_US.UTF-8 > /etc/locale.conf
    echo LANG=pl_PL.UTF-8 >> /etc/locale.conf
    echo KEYMAP=pl > /etc/vconsole.conf
    
    locale-gen
    
  • Add user

    1
    2
    3
    
    useradd -m -G wheel $username
    passwd $username
    echo "$username ALL=(ALL) ALL" >> /mnt/etc/$username
    
  • timezone

    1
    2
    
    ln -s /usr/share/zoneinfo/Europe/Warsaw /etc/localtime
    hwclock --systohc --utc
    
  • Install bootloader

     1
     2
     3
     4
     5
     6
     7
     8
     9
    10
    11
    12
    13
    14
    15
    16
    
    bootctl --path=/boot install
    vim /etc/mkinitcpio.conf
          MODULES="ext4"
          HOOKS=(base udev autodetect modconf block encrypt lvm2 filesystems keyboard fsck)
    
    blkid -s UUID -o value /dev/nvme0n1p2
    
    #Create  /boot/loader/entries/arch.conf
    title		Arch Linux
    linux		vmlinuz-linux
    initrd	initramfs-linux.img
    initrd	intel-ucode.img
    options	cryptdevice=UUID=<YOUR-PARTITION-UUID>:luks root=/dev/mapper/luks rw quite
    
    #Generate mkintcpio
    mkinitcpio -p linux
    
  • X11 keyboard

    1
    2
    3
    4
    5
    6
    7
    8
    
    # Written by systemd-localed(8), read by systemd-localed and Xorg. It's
    # probably wise not to edit this file manually. Use localectl(1) to
    # instruct systemd-localed to update it.
    Section "InputClass"
            Identifier "system-keyboard"
            MatchIsKeyboard "on"
            Option "XkbLayout" "pl"
    EndSection
    
  • locale.gen

    1
    2
    
    echo 'pl_PL.UTF-8 UTF-8' > /etc/locale.gen  
    echo 'en_US.UTF-8 UTF-8' >> /etc/locale.gen  
    
  • vconsole.conf

    1
    
    echo 'KEYMAP=pl2' > /etc/vconsole.conf
    
  • zswap

     1
     2
     3
     4
     5
     6
     7
     8
     9
    10
    11
    12
    
     modprobe zram
     echo lz4 > /sys/module/zswap/parameters/compressor
     echo 8G > /sys/block/zram0/disksize
     mkswap --label zram0 /dev/zram0
     swapon --priority 100 /dev/zram0
    
     echo 'zram'  > /etc/modules-load.d/zram.conf
     echo 'options zram num_devices=2' > /etc/modprobe.d/zram.conf
     echo 'KERNEL=="zram0", ATTR{disksize}="4GB" RUN="/usr/bin/mkswap /dev/zram0", TAG+="systemd"' > /etc/udev/rules.d/99-zram.rules
     echo 'KERNEL=="zram1", ATTR{disksize}="4GB" RUN="/usr/bin/mkswap /dev/zram1", TAG+="systemd"' >> /etc/udev/rules.d/99-zram.rules
     echo '/dev/zram0 none swap defaults 0 0' >> /etc/fstab
     echo '/dev/zram1 none swap defaults 0 0' >> /etc/fstab
    
  • paru

    1
    2
    3
    
    git clone https://aur.archlinux.org/paru.git
    cd paru
    makepkg -si
    
  • shell

    1
    
    pacman -S gnome gnome-extra gdm
    

Used applications

Programming tools

1
2
pacman -S zsh  #Oh-my-zsh
sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
1
2
3
paru -S docker docker-compose
usermod -aG docker $USER
systemctl start  docker
1
pacman -Sy kitty
1
paru phpstorm phpstorm-jre pycharm pycharm-jre

Addistional Content

Plymouth

1
paru aur/plymouth aur/plymouth-theme-arch-glow 
1
2
vim /etc/mkinitcpio.conf
        HOOKS=(base udev plymouth autodetect modconf block plymouth-encrypt lvm2 filesystems keyboard fsck)

Gnome video thumbs

1
pacman -S ffmpegthumbnailer gst-{plugins{-bad,-good,-ugly,-base},ffmpeg}

I3 gapps and additional

1
2
3
pacman -S i3-gaps polybar rofi dunst
paru -S gnome-i3 autotiling lsd hamster-time-tracker
paru -S comptray compton-tryone-git

Gtk theme config

1
pacman -S lxappearance

Icons

1
git clone --depth=1 https://github.com/taurthil/vertex-maia-icon-themes ~/.local/share/icons/Vertex-Maia

File manager

1
pacman -S nemo ranger nemo-fileroller nemo-preview nemo-seahorse udiskie

Additional Content

1
2
gvfs-mtp - media players and mobile devices that use MTP
gvfs-smb - to access Windows/CIFS/Samba

password storege

1
paru -S bitwarden-cli bitwarden-rofi-git

Nerd font

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
mkdir -p ~/.local/share/fonts
cd ~/.local/share/fonts && curl -fLo "Droid Sans Mono for Powerline Nerd Font Complete.otf" https://github.com/ryanoasis/nerd-fonts/raw/master/patched-fonts/DroidSansMono/complete/Droid%20Sans%20Mono%20Nerd%20Font%20Complete.otf

cd ~/.local/share/fonts && curl -fLo "DejaVu Sans Mono Nerd Font Complete Mono.ttf" https://github.com/ryanoasis/nerd-fonts/blob/master/patched-fonts/DejaVuSansMono/Regular/complete/DejaVu%20Sans%20Mono%20Nerd%20Font%20Complete%20Mono.ttf

cd ~/.local/share/fonts && curl -fLo "Fura Code Retina Nerd Font Complete.otf" https://github.com/ryanoasis/nerd-fonts/blob/master/patched-fonts/FiraCode/Retina/complete/Fura%20Code%20Retina%20Nerd%20Font%20Complete.otf?raw=true

chmod 644 ~/.local/share/fonts/*

fc-cache /usr/local/share/fonts/

Cpu frequency and Thermald

1
paru