See Arch Linux Installation for installation notes.
Network
In the newly installed Arch you might notice that there’s no network connectivity. Fix it with iwctl
.
iwd seems to be the simplest and fastest for wireless network on Linux. It’s self-sufficient having a built-in DHCP client. Manually fixing /etc/resolv.conf
with some standard DNS addresses should get you online. However, I prefer systemd-resolved
for DNS and systemd-networkd
for ethernet connections. I referred insanity.industries’ excellent guide to setup all of these. My final /etc/iwd/main.conf
:
[General]
EnableNetworkConfiguration=true
AddressRandomization=once
[Scan]
DisablePeriodicScan=true
[Network]
NameResolvingService=systemd
and /etc/systemd/resolved.conf
:
[Resolve]
FallbackDNS=1.1.1.1 1.0.0.1
This way an access point’s DNS preferred over the fallback Cloudfare’s.
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
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 enable Reverse scroll direction under Mouse and Touchpad settings.
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
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)
That’s it! Things work out of the box. You can check that GuC, HuC and FBC are enabled by default
# options with defaults
modinfo -p i915
# currently enabled options
systool -m i915 -av
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.
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 🤦
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 wheel
group as detailed in the Wiki:
/* Allow users in wheel 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("wheel")) {
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 udisks2
– the 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 wheel
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("wheel")) {
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 sudo/wheel group
pacman -S --needed base-devel
su
EDITOR=/usr/bin/nano visudo # allow wheel group members to sudo
groupadd wheel # if not already existing
usermod -aG wheel $USER
sudo -e /etc/makepkg.conf # disable *-debug builds: OPTIONS=(… !debug)
Install pre-built Yay from AUR
git clone https://aur.archlinux.org/yay-bin.git
cd yay-bin/
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-nerd
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, run fc-list
(from fontconfig
package)
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
- Unneeded ideally but texinfo’s
- plocate, findutils, binutils, util-linux, pax-utils (
lddtree
), pkgfile, man-dbsystemctl enable --now plocate-updatedb.timer pkgfile-update.timer man-db.timer
- Check timers:
systemctl list-timers
- Archive Manager
yay -S --needed 7zip unzip unrar
xarchiver
GUI integrates well with Thunar
lightlocker
is pretty good as a lock screen- Screenshots
xfce4-screenshooter
; had to be hooked to PrintScr throughxfce4-keyboard-settings
under the Application Shortcuts tab
- Preferred Applications
xdg-utils
(a dependency of packages likempv
,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
- Pick-up from iTerm2 Color Schemes
- Copy to
${HOME}/.local/share/xfce4/terminal/colorschemes
- Thunar + Emacs
- Edit with Emacs from Thunar by making a
emacs.desktop
; thanks Emacs.StackExchange
- Edit with Emacs from Thunar by making a
- Cloud Sync
- Books
- Images
- ImageMagick, the swiss-army knife of image formats
- geeqie (GUI) – versatile; supports many formats including camera RAW and vector
- Media
- Per-file A/V playback: mpv
- Console music player/library: Music on Console
- Conversion: ffmpeg
- Encoding: Handbrake
Issues
Check for kernel issues during boot up and down with
journalctl --list-boots
# Check current boot’s logs, use ‘-b -1’ for previous, etc.
journalctl -b [-0]
- Log out and in; mouse cursor is frozen!
- Fix:
sudo modprobe -r psmouse && modprobe psmouse
- Fix:
- 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
- Installation guide – ArchWiki
- Installing Arch Linux with LVM by George Ilyes
- Multi HDD/SSD Partitioning Scheme
- GRUB on Arch Linux Wiki
- Dual-boot with Windows
- Pick A Suitable Desktop Environment For Arch Linux