Dual booting arch and win11

Prerequisites

Before installing arch we need to do the following things

Disk partition

We’ll need to make a disk partition in windows 11 before proceeding to make sure both the OS run isolated, this can be done by the following steps

  1. Right-click on the Start menu and select Disk Management. Alternatively, you can press Win + X and choose Disk Management from the list.
  2. In the Disk Management window, locate the drive you want to partition (usually the C: drive). In my case I’ve installed in D drive on a separate disk
  3. Right-click on the drive and select Shrink Volume
  4. In the dialog that appears, enter the amount of space to shrink (in MB). This will be the size of the new partition for Arch Linux. Make sure to leave enough space for Windows. In my case I’ve allocated 100 gigs for Arch.
  5. Click Shrink. The unallocated space will appear in the Disk Management window.

Bios settings

  1. Disable Fast Startup
  2. Disable secure boot

Arch ISO setup

  1. Download arch ISO from the official site.
  2. Install a tool such as Rufus or Etcher and burn the ISO onto a USB drive.

Booting onto Arch

  1. Insert the drive into the computer
  2. Restart the computer into the BIOS/UEFI/Bootloader menu
  3. Select the boot option as the USB drive

Installing Arch

(under progress)

Crutial services

IWCTL - wifi configuration

To check whether you are connected to internet one of two commands can be used

  1. ip a: Can be used for showing all the ip information that are ongoing, shows the ip address of all the networking devices, these include, looplack device, wifi adaptor and ethernet (if you have one)
  2. ping (domain name): Can be used to hit a ping or do a packet transfer towards a domain on the net. Usage: ping www.exampleanydomainname.com.

The IWCTL CLI can be used via 1. IWCTL can be installed via the following command. bash sudo pacman -S iwd 2. We can iuse the iwctl cli app by just typing in iwctl 3. When inside iwctl the following command can be used to list the devices inside the computer, this can be done via bash device list 4. To scan for the available netowrks bash station <device_name> scan 5. To list hte available networks bash station <device_name> get-networks 6. Connect to a Wi-Fi network bash station <device_name> connect <SSID> 7. Get details of the connection bash station <device_name> show 8. Can be exited via bash exit

Sometimes IWCTL may not work because of DHCP issue, this can be resolved via

  1. Check installation of dhcpcd
    1
    
    dhcpcd --help
    
  2. If not already installed install it via
    1
    
    sudo pacman -S dhcpcd
    
  3. Start the service
    1
    
    sudo systemctl enable dhclient --now
    

Apps and user config

Pacman

Lets first see the base docs of pacman

The pacman command is a package manager used in Arch Linux and its derivatives to manage software packages. Here’s a basic guide on how to use it:

  1. Update Package Database:

    1
    
    sudo pacman -Sy
    

    Updates the package database to the latest version.

  2. Upgrade All Packages:

    1
    
    sudo pacman -Su
    

    Upgrades all installed packages to their latest versions.

  3. Install a Package:

    1
    
    sudo pacman -S package_name
    

    Replace package_name with the name of the package you want to install.

  4. Remove a Package:

    1
    
    sudo pacman -R package_name
    

    This removes the specified package.

  5. Remove a Package and Its Dependencies:

    1
    
    sudo pacman -Rns package_name
    

    This removes the package along with its unused dependencies.

  6. Search for a Package:

    1
    
    pacman -Ss search_term
    

    This searches the package database for the specified term.

  7. Show Package Information:

    1
    
    pacman -Si package_name
    

    Displays detailed information about a specified package.

  8. List Installed Packages:

    1
    
    pacman -Q
    
  9. Check for Package Updates:

    1
    
    pacman -Qu
    

    Lists all packages that have updates available.

Additional options

  • Verbose Mode: Add v for verbose output.
  • Help: Use pacman -h to see all available options.

My installed pacman packages

  1. Zsh - Ref

    1. Setup and install

      1
      2
      3
      
      sudo pacman -S zsh
      chsh -s $(which zsh) # enter your password when prompted
      sh -c "$(curl -fsSL [https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh](https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh))" # this will install zsh
      
    2. My configuration - extensions Ref

      Extensions list

      1. Zsh autosuggest
      2. Zsh syntax highlight
      3. You should use
      4. Zsh-bat
      1
      2
      3
      4
      5
      
      # cloning all the repos
      git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
      git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting
      git clone https://github.com/MichaelAquilina/zsh-you-should-use.git $ZSH_CUSTOM/plugins/you-should-use
      git clone https://github.com/fdellwing/zsh-bat.git $ZSH_CUSTOM/plugins/zsh-bat
      

      Now go to the line that says plugins=(git) and replace them with the following

      1
      
      plugins=(git zsh-autosuggestions zsh-syntax-highlighting you-should-use zsh-bat)
      

      A note that bat needs a package dependency also, this may be done via running the following command

      1
      
      sudo pacman -S bat
      

      Now refresh the shell by using

      1
      
      source ~/.zshrc
      
    3. Configuring the theme

      For this install we are going to use powerlevel10k, via this command

      1
      
      git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k
      

      then we are going to configure the ~/.zshrc file to reflect the theme, this can be done via opening the ~/.zshrc file and paste the following

      1
      2
      
      # file can be opened by
      nano ~/.zshrc
      

      paste the following in place of ZSH_THEME="robbyrussell

      1
      
      ZSH_THEME="powerlevel10k/powerlevel10k"
      
  2. NodeJS: For installing the 20x version we are using the following command

    1
    
    sudo pacman -S nodejs npm
    
  3. Pip: A package manager for python

    1
    
    sudo pacman -S python-pip
    
  4. Hugo: A static site builder

    1
    
    sudo pacman -S hugo
    
  5. LibreOffice: Documentation and productivity suite

    1
    
    sudo pacman -S libreoffice-fresh # or libreoffice-still for stable version 
    
  6. Neovim: CLI based text editor

    1
    
    sudo pacman -S neovim
    

    Optional: I’ve set up neovim kickstart to quick start neovim.

AUR

  1. Setting up yay and basics of AUR

    For the initial setup of the AUR first you need to update all the packages inside it this can be done via. Then install the packages. This can be checked below. Ref.

    1
    2
    
    sudo pacman -Syu
    sudo pacman -S git base-devel
    

    Firstly we need to install yay which is a helper for installing software via AUR this can be done by the following commands

    1
    2
    3
    
    git clone https://aur.archlinux.org/yay.git
    cd yay
    makepkg
    

    if the program doesn’t compile then you may need to install the following dependencies (optional)

    1
    2
    
    sudo pacman -Syu go
    makepkg
    

    now we can install yay via pacman

    1
    
    sudo pacman -U yay-12.4.2-1-x86_64.pkg.tar.zst
    

    the install can be checked and verified via

    1
    
    yay -h
    
  2. My AUR packages

    Note: Packages installed via yay may not need sudo privalages

    1. Notion: A note taking app

      1
      
      yay -S notion-app-electron
      
    2. VSCode (official version): Text ediitor by microsoft

      1
      
      yay -S visual-studio-code-bin
      
    3. Google Chrome: Web browser

      1
      
      yay -S google-chrome
      

Additional settings

  1. Battery threshold

    In a laptop where the laptop is always plugged in it is important to set up a battery threshold to preserve the battery life. In KDE Plasma 6 this feature is already baked in, however in Plasma 6.2.1 (the one which I’m using the time of writing) resets the threshold value on every boot, this can be fixed in the following way. Ref.

    To achieve this i did the following steps

    1. Create a service - I named it kde-battery-threshold-workaround.service, this can be located in /etc/systemd/system

    2. Paste the following in it

       1
       2
       3
       4
       5
       6
       7
       8
       9
      10
      11
      
      [Unit]
      Description=Set Battery Charge Control Threshold
      
      [Service]
      ExecStart=/usr/bin/sudo /bin/sh -c 'echo "60" > /sys/class/power_supply/BAT1/charge_control_end_threshold' # you can change this line accordingly to your battery dir
      Type=oneshot
      RemainAfterExit=yes
      ExecStartPre=/bin/sleep 10
      
      [Install]
      WantedBy=multi-user.target
      
    3. Run the following commands

      1
      2
      3
      4
      
      sudo systemctl daemon-reload
      sudo systemctl enable kde-battery-threshold-workaround.service
      sudo systemctl start kde-battery-threshold-workaround.service
      sudo systemctl daemon-reload
      
  2. Git setup

    1
    2
    
      git config --global user.email "you@example.com"
      git config --global user.name "Your Name"