Configuring Arch Linux on Dell XPS 15
In the previous post, we’ve successfully booted into Arch Linux from our encrypted root partition.
Let’s now configure it to our (my) liking.
Contents
- User management
- Arch User Repository
- X11 and Window Manager: dwm
- Terminal: xterm
- Input: Trackpad gestures (libinput)
- Sound
- Storage: NVMe SSD
- Graphics: Nvidia and Bumblebee
- Power Management
- Suspend/hibernate
- Networking: netctl, Unbound
- Security
- Browser: Firefox
- Backups: rsnapshot
- Password Management: pass
- Gaming: Steam/Wine
- iPhone
- Sources
User management
Arch User Repository
The Arch User Repository (AUR) contains community-driven packages. yaourt
is a popular front-end for it. Enable it by:
X11 and Window Manager: dwm
Determine your 3D card:
Configure dwm
to e.g. use xterm
as terminal and change the modifier key to Windows key (Mod4Mask
):
dwm
should start.
Terminal: xterm
For some reason, I’m stuck on using xterm
. Even its manual page says that it needs to be rewritten, so feel free to go find an alternative.
For the rest of us, at least the following tweaks are useful:
Finally, use the .Xresources
from my dotfiles:
Important things for me is that Caps Lock is mapped as a Control key, and that the Alt (or whatever is left of space bar) acts as Meta. These can be found from the dotfiles
, but I’ll highlight them here too:
Furthermore, I like to have my tilde character lower on the keyboard, on the right side of left-shift:
Additionally, increase the Linux console font size:
And apply it to early userspace too:
Input: Trackpad gestures (libinput)
I chose to use libinput
over synaptics for the touchpad driver.
These can be found from xutils
in my dotfiles (described above).
Sound
Just install alsa-utils
, and use alsamixer
to unmute the master channel. Should just work.
For keyboard hotkeys, add the following to xbindkeys
configuration:
Storage: NVMe SSD
Trimming is an operation SSDs benefit greatly of. However, enabling it for encrypted drives is a security risk1. The options are to enable trim and suffer the weakened security, or at regular intervals take maintenance on the drive.
One way of minimizing writes, which can especially wear down SSD, is to use the noatime
or relatime
in the drives mount options. For me, this was enabled by default:
Graphics: Nvidia and Bumblebee
Let’s install bumblebee for smart switching of the integrated and dedicated graphics:
Power Management
Powertop
powertop
is the best. Install it.
Run calibration as many times as you like. Eventually, powertop will start to show accurate power consumption estimates. Additionally, run it also with --auto-tune
:
Also, add a systemd service for autotuning on startup:
Battery status
I use the command acpi -b
for checking battery status. You need the package acpi
for it.
Backlight
The display’s backlight is a huge power drain, and it is often convenient to have a hotkey to adjust it.
Now, add commands to xbindkeys
for manipulating the backlight:
Laptop mode
Also, activate laptop-mode2:
Suspend/hibernate
Add resume
to the kernel parameters:
Add the resume
hook to initramfs.
Note that the resume
hook should be after lvm2
!
Then, regenerate the initramfs:
Debugging suspend/hibernation
If suspend/hibernation does not work at first, debug it by setting pm_test
Go through the different stages (freezer
, devices
..) and watch the output of journalctl -r
for what goes wrong.
Locking screen on sleep
I want to lock the screen (slock
) whenever the system is put to sleep.
This can be achieved by setting systemd units that have the sleep.target
activated3. See more examples from dotfiles/systemd
:
Networking: netctl, Unbound
Use whatever network manager that rows your boat. I have experience in NetworkManager, but the default netctl
in Arch Linux might be worth using too.
I’ve used dnsmasq
in the past, but unbound
seems like a cool caching DNS resolver that handles DNSSEC as well.
See the documentation how to configure it. Most importantly your /etc/resolv.conf
should point to 127.0.0.1
to use your own DNS program.
Security
These are the basic steps I took to harden my Arch Linux.
To lockout a user for ten minutes after three failed login attempts:
Do not allow SSH login as root:
Restrict access to dmesg:
Configure firewall to drop pretty much all incoming connections, but allow outgoing and already established ones:
Do the same for IPv6 (ip6tables). You have to adjust some of the rules to IPv6.
Harden the Linux TCP/IP stack:
Browser: Firefox
I use Firefox. With a high DPI screen, however, you should increase the pixel density. Go to about:config
and set the layout.css.devPixelsPerPx
to 2.
Backups: rsnapshot
I use rsnapshot
4. TODO.
Password Management: pass
This is kind of an extra section, since password management is pretty personal. I, however, have liked the utility pass
, which is a simplistic bash script for linux utilities like pwgen
.
pass
uses your gpg-keys for encrypting/decrypting the files by default. See my earlier blog post on how to establish GPG.
Then, synchronize the ~/.password-store
between computers however you like.
Gaming: Steam/Wine
Because Wine uses 32-bit libraries, you have to enable the multilib
repo
Setup a 32-bit wine environment:
Then, use `winetricks to install Steam:
You should be able to start Steam/Wine. Your mileage may vary. It is easy to have missed lib32 packages on a 64-bit system, so you might have to chase down dependencies.
Gamepad
My generic xbox pad just worked out-of-the-box. See the kernel docs for more info5.
You can test the pad:
iPhone
I like the robustness of iPhones. I tried a Sony Z5 Compact, but the first drop broke the glass. My iPhone 5 of three years has taken a substantial amount of beating and does not have a dent. Go figure.
Install libimobiledevice
to access the iPhone in Linux:
Then, connect your iPhone via USB. Have the screen unlocked. It should be detected:
Then, you can backup your iPhone:
If you liked this post, you can share it with your followers and follow me on Twitter!