Ted Home

Ted's Arch Linux / Xfce laptop installation notes

Last updated 11/11/2018
  1. Introduction
  2. Initial installation
  3. Entering the chroot environment
  4. Setting up a swapfile and hibernate
  5. Installing the grub bootloader
  6. Booting the system for the first time and adding users; continuing installation
  7. Installing pamac
  8. Make sure alsa is working properly
  9. Installing Xorg
  10. Installing xfce
  11. Installing lightdm display manager
  12. Installing Network Manager
  13. Installing a browser
  14. Getting Bluetooth working
  15. Getting printing working
  16. Adding search to thunar
  17. Some useful applications (office, email, etc)
  18. Setting up the fingerprint reader for lightdm
  19. Enabling Avahi
  20. Setting up network time
  21. Setting up Japanese language entry
  22. Superfluous screenshot


This page is derived from my personal notes from setting up Arch Linux with Xfce on a laptop computer, in this case a Toshiba Tecra M6. It's a modernist, non-partisan, GUI-oriented setup that I originally worked out for someone who really isn't all that into computers.

This document is not a how-to or a tutorial, but if you are setting up Linux on a not-too-old laptop, you might find it useful. If you are using this as a "cheat sheet", you will of course need to adapt it to your system. You should know what you are doing.

Initial installation

Arch Linux Installation Guide
USB flash installation media
Arch Linux Downloads

The first thing to do after booting the thumb drive is set up networking.

(Wireless) During the install, I'm using the profile-based netctl, setting it up with wifi-menu.

Find out what the interface is with
# iw dev
For this computer, it's wlp2s0. Bring the interface down and start wifi-menu:
# ip link set wlp2s0 down
# wifi-menu

Follow the instructions for wifi menu. For further information on netctl, see Arch page on netctl.

(Wired) If wired ethernet is available, and the cable wasn't plugged in when the thumb drive was booted, might need to start dhcpcd.

# systemctl start dhcpcd

Check the connection, eg.

# ping tedsims.com

Note: The particular computer we are setting this up on, already has 2 partitions of equal size, /dev/sda1 and /dev/sda2. I'm installing on /dev/sda2 and there's another Arch install (one definitely not for civilians) on /dev/sda1. The laptop has BIOS, doesn't have a EFI system partition.

Prepare a partition for installation. In this case, it's /dev/sda2. We're going to make an ext4 file system on it and get started:

# mkfs.ext4 /dev/sda2
# mount /dev/sda2 /mnt
# pacstrap /mnt base base-devel

Create fstab. We'll edit it later to add the swapfile information:

# genfstab -U /mnt >> /mnt/etc/fstab

Entering the chroot environment

Enter the Arch chroot environment:

# arch-chroot /mnt

Set the root password:

# passwd

Set time zone:

# ln -sf /usr/share/zoneinfo/America/Kentucky/Louisville /etc/localtime
# hwclock --systohc

Uncomment 'en_US.UTF-8' in /etc/locale.gen:

# nano /etc/locale.gen

Generate locales:

# locale-gen
Tell the system which locale to use (though we only made one):
# echo LANG=en_US.UTF-8 > /etc/locale.conf

This computer is named after the cat:

# echo kittypet > /etc/hostname
Create or open /etc/hosts -
# nano /etc/hosts
and add the following:		localhost
::1			localhost		kittypet.localdomain kittypet

Setting up a swapfile and hibernate

We need to set up swap to have hibernate working. Hibernate is a really, really useful thing to have working on a laptop.

Make a swapfile the same size as RAM, in this case, 4GB:

# fallocate -l 4G /swapfile
# chmod 600 /swapfile
# mkswap /swapfile
# swapon /swapfile

Append the swap information to the end of /etc/fstab:

# echo /swapfile none swap defaults 0 0 >> /etc/fstab

We don't really need swap, except that we are going to use it for hibernate, so let's make sure it stays out of the way:

# echo vm.swappiness=10 > /etc/sysctl.d/99-sysctl.conf

Edit mkinitcpio.conf to add a hook for resume:

# nano /etc/mkinitcpio.conf

Add resume somewhere after udev but before fsck like this:

HOOKS="base udev autodetect modconf block filesystems keyboard resume fsck"

Regenerate the initramfs:

# mkinitcpio -p linux

Take a look at /etc/fstab and write down the uuid of root device.

Then find the first large number reported by

# filefrag -v /swapfile
under "physical offset" and write that down too. This is the offset number to be used for resume.

Installing the grub bootloader

Need grub, os-prober and some other packages we will use later:

# pacman -Sv grub os-prober polkit dialog wpa_supplicant

Now we are going to edit the grub config file so it knows where to resume from:

# nano /etc/default/grub

GRUB_CMDLINE_LINUX_DEFAULT = "resume=UUID=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx resume_offset=xxxxxx"
using the uuid and offset numbers written down earlier.

Mount the partition with the other system so that os-prober can find it:

# mount /dev/sda1 /mnt

Generate the grub.cfg file and install grub to MBR:

# grub-mkconfig -o /boot/grub/grub.cfg
# grub-install /dev/sda

Booting the system for the first time and adding users; continuing installation

Shutdown, remove the thumb drive, boot and log in to the new system. Check hibernate with:

# systemctl hibernate

Add a non-privileged user:

# useradd --create-home ted
# passwd ted
# usermod -aG power,users,storage,wheel	ted

Note: If you don't want a user to be able to make system changes, don't add them to group wheel, because we are going to enable sudo for group wheel. However, you need to add at least one user to group wheel, to complete installation.

Set up sudo for users in wheel group:

EDITOR=nano visudo

Uncomment out %wheel ALL=(ALL) ALL

Bring up networking just like at the very beginning of the install. Now enable networking services so networking starts right up after booting. We only need to do this until we get Network Manager going in a GUI environment:

# netctl enable profilename
# systemctl enable dhcpcd
depending on whether using wifi or wired ethernet.

Reboot and log back in as the non-privileged user.

Under user directory, create Documents, Music, Pictures directories

$ mkdir Documents Music Pictures Video temp

Installing pamac

Install pamac to use as a GUI package manager, and for installing packages from AUR (Note this installs a lot of other things as dependencies of pamac, so if you decide not to install pamac, you could possibly have to install some of these explicitly at some point.):

$ sudo pacman -Sv git
$ cd ~/temp
$ git clone https://aur.archlinux.org/pamac-aur.git
$ cd pamac-aur
$ makepkg -si

Note: yay is very good if you don't like pamac, but you should like pamac.

Make sure alsa is working properly

Before installing Xorg, make sure alsa is working:

$ sudo pacman -Syu alsa-utils
$ alsamixer

(Use 'm' to unmute pcm, master, etc and turn the volumes up)

$ speaker-test -c2

Installing Xorg

We'll try X by itself before setting up xfce. This laptop has integrated Intel video, so it's pretty easy. We're also going to install some things we need later:

$ sudo pacman -Syu xorg xf86-video-intel mesa xorg-twm xorg-xclock xterm xorg-xinit

$ startx

Xorg should start right up. If it doesn't, go figure out what went wrong. If it's working, ctrl-D out of all the windows.

Installing xfce

$ sudo pacman -Syu xfce4 xfce4-goodies gvfs catfish ttf-dejavu ttf-liberation ttf-droid

Make a simple .xinitrc in the user's home directory and make it executable:

$ cd
$ echo exec startxfce4 >> .xinitrc
$ chmod +x .xinitrc

Start up xfce:

$ startx

Spend some time admiring what a virgin xfce install looks like.

Add a battery icon to the top right panel by opening Power Manager under settings, and turn on "System Tray Icons" and "Status Notifications"

Installing lightdm display manager.

$ pamac build lightdm-slick-greeter
$ sudo nano /etc/lightdm/lightdm.conf
Under [seat:*] change greeter-session to read as follows:
greeter-session=lightdm-slick-greeter Make sure the line is uncommented. Save and close.

Enable lightdm service

$ sudo systemctl enable lightdm.service

Reboot, and lightdm should come up. There will be an icon for pamac-manager in the notification bar. Click on it to start pamac-manager. Open preferences and enable AUR support.

The lock screen menu item doesn't work out of the box, need to add "dm-tool lock" to /usr/bin/xflock4 like this:

for lock_cmd in \
"xlock -mode blank" \
"slock" \
"dm-tool lock"

Installing Network Manager

$ sudo pacman -Syu network-manager-applet
$ sudo systemctl enable NetworkManager.service

Turn off some things we don't need anymore:

$ sudo systemctl disable dhcpcd
$ sudo netctl list

If any profiles show up with an asterisk next to them, disable with

$ sudo netctl disable profilename

Then reboot the computer. When you come back in, the Network Manager should be active on the task bar. Make sure it's working properly.

Installing a browser

This is probably a good point to install a browser. Personally, I like Google Chrome, so that's what I installed:

# pamac build google-chrome

Out of the box, Chrome has hardware acceleration disabled on my computer (GPU old, unsupported). I've re-enabled it through the menu at url chrome://flags/#ignore-gpu-blacklist

Getting Bluetooth working

Install Bluetooth packages along with pulseaudio. Install the following packages:


Create the file /etc/polkit-1/rules.d/51-blueman.rules using the instructions on the Arch web site under Permissions.

Bluetooth service will usually need to be restarted after coming out of hibernate or suspend. This script will make that happen automatically (thanks, Dennis Field):


	if [ $1 = post ]
		systemctl restart bluetooth
		echo "Hello, I'm resuming from $2"

Enable the bluetooth service:

$ sudo systemctl enable bluetooth.service

Reboot and make sure Bluetooth is working, for example, by pairing with a Bluetooth speaker.

Getting printing working

Install the following packages:

Note: This is a "well-tinkered" setup for printing. Among other things, it can find networked printers and set them up as automagically as possible.


Enable cupsd:

$ sudo systemctl enable org.cups.cupsd.service
$ sudo systemctl start org.cups.cupsd.service

Open Print Settings under Applications --> Settings and add your printers.

Adding search to thunar

Use the instructions at How to make xfce's file manager more usable to add catfish search to thunar file manager.

Some useful applications

Install the following useful applications (office, mail, etc.):

etcher-bin  (from AUR)

Setting up the fingerprint reader for lightdm

$ pamac build fingerprint-gui

Add the following line to /etc/pam.d/lightdm

auth 	sufficient 	pam_fingerprint-gui.so

For each user that going to be using the fingerprint reader,

$sudo gpasswd -a user plugdev

Reboot. Open the "Fingerprint GUI" setup application in the settings menu, following the instructions. Note, we have it set up for lightdm only, not sudo.

Enabling Avahi

This enables Avahi (Bonjour), if you should need it:
$ sudo pacman -S nss-mdns
$ sudo nano /etc/nsswitch.conf
Add mdns_minimal after hosts: files in /etc/nsswitch.conf
$ sudo systemctl enable avahi-daemon

Setting up network time synchronization using systemd-timesyncd

Follow the instructions on the Arch wiki page on systemd-timesyncd.

Setting up Japanese language entry

Install all of these packages:


Log out and log back in. Follow the Instructions for fcitx on the Arch site

(Superfluous Screenshot)