See Arch Linux Installation for installation notes.

Network

In the newly installed Arch you might notice that there’s no network connectivity.

Wireless

To enable wireless do what you did during installation (see Arch Linux Installation, §2 Wireless Network). I did it only to realize, for netctl to hook to a WPA-secured network, the wpa_supplicant package is needed but was absent on the installed system. To connect to the internet, you need a package from the internet!? To get out of this Catch-22 situation, I’d to reboot from the installation USB, setup network and install wpa_supplicant to the new OS by chrooting

root@archiso / # mount /dev/lvmg1/root /mnt
root@archiso / # mount /dev/nvme0n1p5 /mnt/boot
root@archiso / # mount /dev/lvmg1/home /mnt/home
root@archiso / # mount /dev/sda5 /mnt/var
root@archiso / # swapon /dev/sda6
root@archiso / # arch-chroot /mnt
[root@archiso /]# pacman -S wpa_supplicant
[root@archiso /]# exit
root@archiso / # reboot

To permanently enable a network on boot, enable the service

netctl enable infoprobe

If on every boot you get this with a long wait

[***      ] A start job is running for dhcpcd on wlp3s0 (14 s / 1min 30s).

As discussed in the forums set /etc/systemd/system/systemd-user-sessions.service

[Unit]
Description=Permit User Sessions
Documentation=man:systemd-user-sessions.service(8)
After=remote-fs.target nss-user-lookup.target

[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=/usr/lib/systemd/systemd-user-sessions start
ExecStop=/usr/lib/systemd/systemd-user-sessions stop

According to Arch Wiki’s domain name resolution

The Glibc resolver provides only the most basic necessities, it does not cache queries nor provides any security features. If you require more functionality, use another resolver.

However, another statement admonitions that a router usually does this caching at the network-level, so you can skip setting up a more robust resolver.

Ethernet

If you just need ethernet/LAN connectivity, just enable what the installation image uses

systemctl enable --now systemd-networkd.service
systemctl enable --now systemd-resolved.service

You can verify if your preferred network interface is up

ip address show
# `UP` inside angle brackets
ip link set MY_IFACE_NAME up

Stable Interface

If you plan on using netctl, you need a profile for ethernet too (like wireless). However, I noticed that on every reboot the interface name kept changing between enp4s0 and eth0. ArchLinux documents this too! Basically create a rule file (/etc/udev/rules.d/10-network.rules) with the MAC address mapped to a name

SUBSYSTEM=="net", ACTION=="add", ATTR{address}=="fe:ed:f0:0d:ba:cc", NAME="eth0"

Check if the interface name is stable (ip link) after this change.

Check if the interface is down (cat /sys/class/net/eth0/operstate), else take it down: ip link set dev eth0 down. Create a profile for the wired network by copying from /etc/netctl/examples/ethernet-dhcp. Fix the interface name to match the one you named.

Interface=eth0
Connection=ethernet
IP=dhcp
DNS=('1.1.1.1' '1.0.0.1')

Start/switch to this profile as you normally would: netctl switch-to wired.

If you’re connecting a USB Type-C to 3.0 adapter with an ethernet port, its interface would not be eth0! Make sure you’ve a similar profile for its interface too.

Auto-Switching

To automatically configure your ethernet device on cable un/plug, install ifplugd and enable the service. Likewise to automatically start/stop profiles as you move from a wireless network’s range into another, you need to enable another service.

netctl disable infoprobe  # disable any earlier enabled profile

systemctl enable netctl-ifplugd@eth0.service
systemctl enable netctl-auto@wlp3s0.service

Refer Special systemd units for details.

Resurrecting Windows

On a dual boot setup, if you notice that Windows is’t an option in the boot menu, install the os-prober package. Mount the EFI partition and re-run GRUB config maker:

mount /dev/nvme0n1p1 /boot/efi
grub-mkconfig -o /boot/grub/grub.cfg

Windows would come up as an option now, as the prober would be able to see the Windows installation.

Real Time Clock Setup

Traditionally RTC — h/w clock that doesn’t understand time standards — is set in local time; Windows reads it as local by default; Linux doesn’t. It recommends setting it in GMT and let the OS services deal with time zone and DST variations. Forcing Linux with timedatectl set-local-rtc 1 is possible. However, man timedatectl warns that it will create problems when changing time zones and DST changes; one has to rely on booting into Windows at least twice annually (in Spring and Fall) for DST adjustments. Setting RTC in GMT seems appropriate (macOS does this too). A registry change + restart will make Windows read RTC as GMT too. This is the recommended way of setting time in dual boot machines. For time sync to an NTP server, do timedatectl set-ntp true. Do timedatectl status to check if everything is OK:

               Local time: Thu 2018-10-18 16:04:49 IST
           Universal time: Thu 2018-10-18 10:34:49 UTC
                 RTC time: Thu 2018-10-18 10:34:49
                Time zone: Asia/Kolkata (IST, +0530)
System clock synchronized: yes
              NTP service: active
          RTC in local TZ: no

Desktop Environment

To have Xfce up and running, you need a display system (Xorg; Xfce can’t run atop Wayland yet) and a display manager (LXDM)

pacman -Syu
pacman -S --needed xfce4 xfce4-goodies lxdm xf86-input-synaptics

Set graphical.target as default. Start and enable (for future boots) the display manager

systemctl set-default graphical.target
systemctl enable --now lxdm.service

For the first run, make sure to set the Session and Locale; not doing so led to a login screen loop.

If LXDM doesn’t show your full name, it isn’t set in /etc/passwd. Set it with chfn -f 'Full Name' login_id.

For natural scrolling with laptop’s touchpad, similar to iPad, enabling Reverse scroll direction under Mouse and Touchpad settings; this fixes scroll in most places except Terminal 😬.

For sanity, disable desktop zoom “feature” in Settings Editorxfwm4; uncheck zoom_desktop.

Display

I got infinite waits every time I tried poweroff -n due to Nouveau drivers for Nvidia; for this reason I disabled lxdm.service and operated from the terminal. To list the graphics devices you’ve, do

lspci -k | grep -A 2 -E "(VGA|3D)"

Intel

To get Intel graphics working

pacman -S --needed xf86-video-intel mesa mesa-demos

With Skylake and its successors (Kabylake, …) we can enable i915 module for early KMS start in /etc/mkinitcpio.conf and run mkinitcpio -p linux

# MODULES
# …
MODULES=(i915)

Enable GuC, HuC and FBC in /etc/modprobe.d/i915.conf

options i915 enable_guc=-1 enable_fbc=1

Screen tearing when scrolling large walls of text in Firefox is a common occurrence. To fix this set /etc/X11/xorg.conf.d/20-intel.conf to

Section "Device"
    Identifier "Intel Graphics"
    Driver "intel"
    Option "TearFree" "true"
EndSection

The Intel device needs only these but still I couldn’t startx or systemctl start lxdm.service; even if stuff shows up, it usually hung during power down sequence. All because the Nvidia device was preferred over Intel’s and its drivers were broken.

Nvidia

Using the discrete GPU for heavier workloads and powering it off (as integrated GPU does display stuff) would be ideal. Official (nvidia) method is to go with prime-run. Following PRIME - ArchWiki did most of the trick but power management isn’t there yet.

Basically uninstall all open-source video packages, bbswitch and bumblebee and install nvidia drivers and utilities:

pacman -Rsc nouveau xf86-video-nouveau xf86-video-intel xf86-video-vesa bumblebee bbswitch primus
rm -rf /etc/bumblebee /etc/modprobe.d/bbswitch.conf
pacman -S nvidia nvidia-utils nvidia-prime
systemctl enable --now nvidia-persistanced

prime-run a process to choose discrete GPU; the default would be integrated:

# should display integrated GPU
glxinfo -B
# should display discrete GPU
prime-run glxinfo -B
# useful (informative)
nvidia-smi
# information on GPU
cat /proc/driver/nvidia/gpus/0000\:01\:00.0/information

Dynamic power management is only for Turing+ architectures. Installing nvidia-prime-rtd3pm at least sets /sys/bus/pci/devices/0000:01:00.0/power/control to auto (better than on). cat /sys/bus/pci/devices/0000:01:00.0/power_state always shows D0, cat /proc/driver/nvidia/gpus/0000\:01\:00.0/power shows Disabled by default. What more, nvidia-smi isn’t able to show power stats as it’s unsupported for this GPU 🤦

Futile Alternatives

Using nouveau doesn’t help as it doesn’t support power management and hardware accelerated video decoding too for GeForce 1050 Ti; it’s worser than proprietary driver at the moment. bbswitch is non-viable too; it suspend the card on boot (if nvidia is blacklisted) and restoring it back again when needed doesn’t work. Without the blacklisting, it suspends the card only momentarily; it’s always ON once desktop loads.

USB Port Speed

If your machine has both USB 2 and 3 ports and boot logs show this warning

kernel: usb: port power management may be unreliable

there’s a good chance of a USB 3+ device (5000 Mbps) running with USB 2 (480 Mbps) speed; verify with lsusb -tvv. Refer UnixSE and ArchLinux forums for details. The problem maps to inability of the kernel to determine a port’s peer and set correct power. If that’s the case, find the port (dmesg | grep -i usb) and manually suspend it; refer

echo "0" > "/sys/bus/usb/devices/1-1:1.0/power/autosuspend_delay_ms"
echo "auto" > "/sys/bus/usb/devices/1-1:1.0/power/control"

Audio

Install pipewire-alsa, pipewire-pulse, pavucontrol and xfce4-pulseaudio-plugin; no fiddling was needed to get audio working. Pipewire + Wireplumber = 🎵💘!

After installing pipewire-alsa, my bluetooth headphones with handsfree microphone, earlier showing up only as Audio-Out device, exposes UI to pick between A2DP Sink and HSP/HFP profiles in Bluetooth Manager! Switching to the latter profile shows a new Audio-In device under pavucontrol :)

Bluetooth

Install bluez, bluez-utils and blueman – for a decent GTK+ bluetooth manager with an applet. Verify if bluetooth hardware is not hard blocked but is soft blocked.

rfkill list highlight

1: ideapad_bluetooth: Bluetooth
	Soft blocked: yes
	Hard blocked: no
3: hci0: Bluetooth
	Soft blocked: yes
	Hard blocked: no

As mentioned in ArchWiki

By default the bluetooth daemon will only give out bnep0 devices to users that are a member of the lp group.

Create and add yourself to it.

groups $USER            # check if user already in lp
groupadd lp
usermod -aG lp $USER

Enable and start bluetooth.service.

systemctl enable --now bluetooth.service

Though this is enough, at every login, there’d be an annoying prompt for the root password, to enable bluebooth. Add this to /etc/polkit-1/rules.d/51-blueman.rules to not prompt for users in the sudo group as detailed in the Wiki:

/* Allow users in sudo group to use blueman feature requiring root without authentication */
polkit.addRule(function(action, subject) {
    if ((action.id == "org.blueman.network.setup" ||
         action.id == "org.blueman.dhcp.client" ||
         action.id == "org.blueman.rfkill.setstate" ||
         action.id == "org.blueman.pppd.pppconnect") &&
        subject.isInGroup("sudo")) {

        return polkit.Result.YES;
    }
});

If after every login bluetooth is auto-powered ON; this is due to Blueman’s Power Manager plugin. Fix: right-click Blueman applet → Plugins → PowerManager → Configuration; uncheck Auto Power-on.

The default Obex push directory is set to ~/.cache/obex, named Root; change it to your convenience in Local services -> Transfer.

To show battery charge in bluetooth devices like headphones (as passive desktop notifications too) enable D-Bus experimental features in /etc/bluetooth/main.conf:

Experimental = true

Laptop Power Saving

laptop-mode-tools seems to be an important package for a laptop’s power saving. Additionally you need hdparm and cpupower

yay -S --needed laptop-mode-tools hdparm cpupower

Start with systemctl enable laptop-mode.service. Then set the following parameters in respective files

# /etc/laptop-mode/conf.d/intel-sata-powermgmt.conf
CONTROL_INTEL_SATA_POWER="1"

# /etc/laptop-mode/conf.d/lcd-brightness.conf
# Follow comments to find brightness <value>s
CONTROL_BRIGHTNESS=1
BATT_BRIGHTNESS_COMMAND="echo 1500"
LM_AC_BRIGHTNESS_COMMAND="echo 2250"
NOLM_AC_BRIGHTNESS_COMMAND="echo 2250"
BRIGHTNESS_OUTPUT="/sys/class/backlight/intel_backlight/brightness"

# /etc/laptop-mode/laptop-mode.conf
BATT_HD_POWERMGMT=200
LM_AC_HD_POWERMGMT=240

Verify if last setting is in action with hdparm -B /dev/sda.

Mount Removable Drives

If you’re dual booting, mounting NTFS partitions/disks is common; and then there’re USB drives too. Though /etc/fstab is the traditional route for NTFS mounting, I don’t like this approach since this assumes you always need these drives. Also you need empty directories ready to use as mount points for these drives. It’d be good to do this automatically, on demand.

Enter udisks2the most-recommended approach; many desktop environments seem to use it too. This approach is intelligent compared to fstab’s plain hard-coding; respects per-user or group permissions; mount points are user-based too; having a common mount point is also possible. Install udisks2 for conveniently mounting NTFS partitions and removable (USB) disks from the command-line or in Thunar.

yay -S --needed udisks2

To allow users of group sudo to mount NTFS drives (with write permissions) without asking for root password, enable the group in polkit under /etc/polkit-1/rules.d/50-udisks.rules

polkit.addRule(function(action, subject) {
  var YES = polkit.Result.YES;
  var permission = {
    // only required for udisks2:
    "org.freedesktop.udisks2.filesystem-mount": YES,
    "org.freedesktop.udisks2.filesystem-mount-system": YES,
    "org.freedesktop.udisks2.encrypted-unlock": YES,
    "org.freedesktop.udisks2.eject-media": YES,
    "org.freedesktop.udisks2.power-off-drive": YES,
    // required for udisks2 if using udiskie from another seat (e.g. systemd):
    "org.freedesktop.udisks2.filesystem-mount-other-seat": YES,
    "org.freedesktop.udisks2.encrypted-unlock-other-seat": YES,
    "org.freedesktop.udisks2.eject-media-other-seat": YES,
    "org.freedesktop.udisks2.power-off-drive-other-seat": YES
  };
  if (subject.isInGroup("sudo")) {
    return permission[action.id];
  }
});

From now on, you should see NTFS and USB disk partitions in Thunar’s sidebar. One click mount and unmount will work.

Mount/unmount from command-line

Un/mounting from the comfort of your command-line is even better. Since you’d know your NTFS drives’ /dev, so you could

udisksctl mount --block-device /dev/sda3                         # NTFS disks
udisksctl unmount --block-device /dev/sda3

I’ve a convenient Lua script to mount and unmount an array of NTFS partitions with a single command

#! /bin/env lua

local cmd = (#arg > 0) and (arg[1] == "u") and "unmount" or "mount"

os.execute("udisksctl " .. cmd .. " --block-device /dev/disk/by-label/Windows")
os.execute("udisksctl " .. cmd .. " --block-device /dev/disk/by-label/Data")
os.execute("udisksctl " .. cmd .. " --block-device /dev/disk/by-label/Media")
os.execute("udisksctl " .. cmd .. " --block-device /dev/disk/by-label/Backup")

Since you’d be having udev running, it should populate /dev/disk/by-label which might be useful for USB drives.

udisksctl mount --block-device /dev/disk/by-label/CAPSULE
udisksctl unmount --block-device /dev/disk/by-label/CAPSULE
udisksctl power-off --block-device /dev/disk/by-label/CAPSULE    # power-off before unplug

A recommended GUI, if needed, is udiskie.

Package Management, yay!

Many essential packages live in AUR, the unofficial Arch repository; just the official repositories won’t cut it. The default package manager client pacman works only with official repos. Many famous AUR helpers and pacman wrappers have been written hence. The former deals only with AUR packages, while letting pacman work with the official repo packages; the latter is more wholesome. Pacman wrappers take care of both official and AUR repos; effectively letting the user deal with both transparently e.g. yay -Syu updates all packages irrespective of their repo.

Yay — the pacman wrapper written in Go — simple interface, feature-rich and an active project. I recommend it over the many, now-defunct, pacman wrappers out there. Once installed, Yay should take care of your AUR (and official repo) package needs. However, to get Yay itself, you need to do manual AUR package installation. To make packages from AUR you need the base-devel package group and super user permissions; you can’t sudo before getting added to the group, so

pacman -S --needed base-devel
su
EDITOR=/usr/bin/nano visudo    # uncomment sudo group
groupadd sudo                  # if not already existing
usermod -aG sudo $USER

Now install Yay from AUR

git clone https://aur.archlinux.org/yay.git
cd yay/
makepkg -si    # this needs sudo to install built package

Yay respects /etc/pacman.conf settings; enable Color and ParallelDownloads – very useful! I found a few useful tricks as (my machine’s) admin:

  • Map an existing file back to its (installed) package: pacman -Qo FILE-PATH
    > pacman -Qo mandelbrot
    /usr/bin/mandelbrot is owned by mesa-demos 8.4.0-1
  • Map any command/file name (not necessarily existing) to its (to-be-installed) package: pkgfile FILE
    > pkgfile hexl
    extra/emacs
    community/emacs-nox
  • List installed packages with fzf; a panel shows highlighted package’s details
    > yay -Qq | fzf --preview 'yay -Qil {}' --layout=reverse --bind 'enter:execute(yay -Qil {} | less)'

Irrespective of the wrapper used, pacman maintains /var/log/pacman.log since day 1 of its usage; very useful to know package management history.

Pac Cache Management

Periodically /var gets full due to cached downloaded packages. Clear it manually using the paccache script

paccache -rk 2    # keep last 2 versions of each package

Automate cache clearance with a pacman hook (refer man alpm-hooks) run post install:

cat > /etc/pacman.d/hooks/clean_pac_cache.hook
[Trigger]
Operation = Upgrade
Operation = Install
Operation = Remove
Type = Package
Target = *

[Action]
Description = Cleaning pacman cache...
When = PostTransaction
Exec = /usr/bin/paccache -rk 1

If you’ve issues with keyring or keys, reinitialize keyring.

Fonts

I’m a Tamilian and a programmer. Since most of my consumption is textual data, I’ve strong tastes in fonts. First for greater unicode coverage I followed Emacs’ unicode-fonts recommendation of at least installing

  • DejaVu Sans
  • Symbola
  • Quivira
  • Noto TTFs
yay -S --needed ttf-dejavu  ttf-symbola quivira noto-fonts noto-fonts-emoji

Fonts can be installed manually by copying into ${HOME}/.local/share/fonts.

Noto has excellent coverage across languages. noto-fonts-emoji is the Emacs-recommended font for Emojis; xfce4-terminal shows them too 🤗. With these my missing-glyph agonies were gone.

Tamil

To have Tamil rendered in Firefox (both content and UI like menu, etc.)

yay -S --needed ttf-tamil firefox-i18n-ta

Looks beautiful 😇 அருமை அருமை!

Monospace

I seem to be partial to fonts with curves. I’m a fan of Mononoki and Ubuntu Mono.

yay -S --needed ttf-ubuntu-font-family ttf-mononoki

This starts showing up inside the browser — for code snippets — too!

Nerd Fonts is a project that lets you impregnate your favourite font with glyphs from icon packages like Font Awesome, Devicons, …. It’s useful if you’re used to using these special icons. Most popular fonts don’t need anything manual – the legwork is already done; just download! I removed ttf-mononoki and installed mononoki Nerd Font manually.

Xfce4 Settings

To see available fonts, install fontconfig and do fc-list.

Under Appearance set

  • Default Font: Noto Sans 12
  • Default Monospace Font: mononoki 13

If setting system monospace wasn’t enough

gsettings set org.gnome.desktop.interface monospace-font-name 'mononoki 13'

does it! This also fixes the inline code face used by Emacs’ markdown-mode 😮

Another option is to customize font setting per user by fixing {HOME}/.config/fontconfig/fonts.conf. I did this too for good measure.

<match target="pattern">
  <test name="family" qual="any">
    <string>monospace</string>
  </test>
  <edit binding="strong" mode="prepend" name="family">
    <string>mononoki</string>
  </edit>
</match>

I got both of these from Unix.StackExchange.

Multi-monitor Setup

Targus DisplayLink DOCK180USZ setup was easy; followed first few steps of DisplayLink - ArchWiki and fiddled with Display settings.

yay -S evdi displaylink linux-headers
systemctl enable --now displaylink.service
cat > /etc/X11/xorg.conf.d/20-evdi.conf
Section "OutputClass"
	Identifier "DisplayLink"
	MatchDriver "evdi"
	Driver "modesetting"
	Option "AccelMethod" "none"
EndSection

Memory Card Write Access

Add to storage group to get read-write, instead of read-only, access to SD cards.

usermod -aG storage $USER

User land

Miscellaneous user land customizations and tune-ups:

  • Manuals
    • yay -S --needed texinfo
    • for f in /usr/share/info/*; do install-info ${f} /usr/share/info/dir 2>/dev/null; done
      • Unneeded ideally but texinfo’s post_install() doesn’t do it
  • plocate, findutils, binutils, util-linux, pax-utils (lddtree), pkgfile, man-db
    • systemctl enable --now plocate-updatedb.timer pkgfile-update.timer man-db.timer
    • Check timers: systemctl list-timers
  • Archive Manager
    • yay -S --needed p7zip unzip unrar
    • xarchiver GUI integrates well with Thunar
  • Lock screen
    • xlockmore works fine, just be aware that switching to TTY (with Ctrl + Alt + 2, …) is still possible with it
    • Integrates seamlessly with xflock4 a script (/usr/bin/xflock4) which tries different lockers
    • Other lockers have issues
      • gnome-screensaver, sflock – didn’t work
      • physlock – only root can unlock
      • light-lock – needs a display manager
  • Screenshots
    • xfce4-screenshooter; had to be hooked to PrintScr through xfce4-keyboard-settings under the Application Shortcuts tab
  • Preferred Applications
    • xdg-utils (a dependency of packages like mpv, blender, etc.)
      • xdg-open opens file with preferred application from terminal
    • Another option: perl-file-mimeinfo
    • Xfce4 has MIME Type Editor whose settings both MC and Thunar respect
      • When something unassociated is opened in Thunar, what you choose gets updated here only
  • Xfce4 Terminal Colour Scheme
  • Thunar + Emacs
  • Cloud Sync
    • rclone syncs to remote drives; all popular cloud storage services are supported.
    • You can also make it a VFS!
  • Books
  • Images
  • Media

Issues

Check for kernel issues during boot up and down with

journalctl --list-boots
journalctl -b1
  1. Log out and in; mouse cursor is frozen!
    • Fix: sudo modprobe -r psmouse && modprobe psmouse
  2. Reverse scrolling in Xfce4 Terminal.

Epilogue

Phew! What a long post! Despite those petty issues, it’s an amazingly productive and stable setup.

I find excuses to use this environment; smooth and pleasant!

I hope this helps someone trying to figure out stuff in Arch or Linux in general. If you’ve tips or suggestions to share, you’re most welcome!

Thanks to all those who report issues, document fixes, share and help unknown people in open forums like StackExchange, GitHub, Reddit, ….

Hat tip to all developers/creators who’ve worked to create this synergy ☯.

References

  1. Installation guide – ArchWiki
  2. Installing Arch Linux with LVM by George Ilyes
  3. Multi HDD/SSD Partitioning Scheme
  4. GRUB on Arch Linux Wiki
  5. Dual-boot with Windows
  6. Pick A Suitable Desktop Environment For Arch Linux

See Also

  1. Linux Desktop Setup