Installing Arch Linux — A Beginners Guide (Part 2)

David H Smith IV
7 min readApr 7, 2020

Now, given that you have successfully completed all the steps in part one of this guide, you should be ready to begin the installation of a window manager and some basic applications. This portion of the guide will cover:

  • Xorg installation.
  • i3-gaps window manager installation and configuration.
  • tryone-compton compositor installation and configuration.
  • Installation and configuration of some basic packages.

What is X?

The X Windowing System (X11 or X) is a networked windowing system that allows for applications to make requests to draw to a user’s screen. Though little used today, the software was originally intended to be used over networks for remote graphical user interfaces and therefore adopted a client-server model. When an X server is launched it provides an interface between the user’s peripheral devices (e.g. keyboard, mouse, screen) and applications on the “remote” computer. Applications make requests to the server to render things on the screen and the server sends requests to clients based on user input. It’s best thought of as a sandbox that provides basic user I/O functionality as well as the ability to draw and manipulate the screen. All the other fancy GUI stuff is handled by other applications that connect and make requests to the x-server.

Now for a little history lesson. You might be asking yourself “Why the 11 in X11?”. Well, that’s because the software has been on version 11 since 1987. Yeah… It’s the granddaddy of window systems and is still used widely to this day. It was originally developed in 1984 at MIT lead by Robert Scheifler.

X is currently maintained by the X.Org foundation. From their website:

The X.Org project provides an open source implementation of the X Window  System. The development work is being done in conjunction with the freedesktop.org community.  The X.Org Foundation is the educational non-profit corporation whose Board serves this effort, and whose Members lead this work.

Installation Process

Graphics Drivers

The first thing we have have to do is determine the type of graphics card present on your system. This is done via the following command:

lspci | grep -e VGA 

This command lists all Peripheral Component Interconnect (PCI) devices and sends its output to a program called “grep” with uses a regular expression to scan through the output it has been sent in search of a line with the word “VGA”.

As you can see I’m currently doing this installation in a VM

Once you have identified your card refer to the driver installation page on the Arch wiki to determine which driver package you should install:

https://wiki.archlinux.org/index.php/Xorg#Driver_installation

Xorg Installation

All the packages that are included within xorg

The xorg installation is as easy as the following command:

sudo pacman -S xorg xterm xorg-xinit

Each of these does the following:

  • xorgThe main xorg package with all necessary dependencies.
  • xorg-apps → A group of useful apps related to Xorg.
  • xorg-xinit → The initialization script for Xorg.

Xinit, Startx, and xinitrc

The xorg package includes many things including the following:

  • xinit → A program that allows for the user to manually start an Xorg display server.
  • startx → The command used to launch the Xorg display server.
  • xinitrc → This is the configuration file for X11 which controls the startup routine. By default it is located in /etc/X11/xinit/ however, if you choose to use a modified version, the startx command first looks for it as a dot file (.xinitrc) in your current user’s home directory.

To test the installation of Xorg simply type in the startx command and you should be greeted by the default twm window manager.

With all that in mind copy the default xinitrc to your home directory:

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

Make the following modifications to the file you just copied into your home directory:

This will cause X11 to start i3 by default upon its initialization once we have installed it. To lauch X11 on system login, add the following to you ~/.bash_profile:

if [[ -z $DISPLAY ]] && [[ $(tty) = /dev/tty1 ]]; then
startx
fi

The first portion of the logical statement check to see if there isn’t a display connected (i.e. no Xorg session currently running). The second portion checks to see if the first tty you are logging into is tty1. If both of these statements are true then it launches the Xorg session.

Useful Packages

The following is a list of packages that I will be installing and find personally useful:

  • Alacritty → A GPU accelerated terminal emulator written in Rust.
  • rofi A run dialog similar to dmenu that has additional functionality as an SSH launcher and window switcher.
  • firefoxThe only web browser worth using.
  • rangerA terminal based file browser with some cool features implemented in python.
sudo pacman -S alacritty rofi firefox ranger

i3-Gaps Installation

To install i3-gaps run the following command:

sudo pacman -S i3-gaps i3status

then begin the X session by running:

startx

This will cause two prompts to appear. The first will ask if you want i3 to generate a configuration file for you. Say yes to this.

The next will ask you which “modifier” key you wish to use. The modifier key is used for keyboard shortcuts within i3. I generally select the alt key as mine given it is more ergonomic, however, select whichever one you find more comfortable.

After this is completed edit the i3 configuration file to include gaps by adding the following lines:

gaps inner 25
gaps outer 0

Make sure to play with their values until you have them the way you want. To view the effects, restart i3 after saving the file using mod+r.

Next, replace the bindings for the default applications to use the applications installed earlier.

  1. Bind the mod+enter key combination to launch alacritty.
  2. Bind the mod+d key to lauch rofi.

To accomplish this, find the following entries in the i3 config file and modify them to match:

bindsym $mod+Return exec alacritty
bindsym $mod+d exec rofi -show run

tryone-compton

A compositor is a program that gives applications a memory buffer to write to prior to that memory being written to the actual display memory. This can be thought of as an off-screen canvas for a bunch of applications to write to prior to it being rendered to your screen. In this case, we will be using the tryone-compton fork to do our compositing as it supports transparency and the addition of fun blur effects.

To install compton, first install git in order to clone the package from the Arch User Repository (AUR). So to install git run the following command:

sudo pacman -S git

Then clone the repository via:

git clone https://aur.archlinux.org/compton-tryone-git.git

cd into the directory that is created and run:

makepkg -sri

Once the installation is complete create ~/.config/compton.conf and fill it with the settings pictured below:

My preferred default settings

Now, to run compton, run the following command:

compton -b

The “-b” flag means we wish to “daemonize” the process. This means that upon program initialization it will be forked to the background. If you want compton to run upon i3 startup add the following line to your ~/.config/i3/config:

exec compton

For the wallpaper the image viewing program “feh” can be used to set the background image. Find and download a nice wallpaper then set it to the background with feh using the “--bg-fill” flag. This will cause the image to be stretched to fill the dimension of your screen.

Once everything is set up your new i3 desktop should look something like this:

Compton, Alacritty, and our new wallpaper

To have your background image set upon i3 startup add the following to your ~/.config/i3/config:

exec --no-startup-id feh --bg-fill <path-to-image>

And with that you should be done! Have fun configuring your system from here!! 🎉🐧

--

--