Introduction

I dislike spending lots of time setting up my desktop. I like to be up and running as fast as possible. I also like Arch linux, because it’s quite barebones and light and relatively cruft-free.

Because I like to get up and running fast, I’ve made some tools to speed up this process. Check out https://git.hackerheaven.org/ekollof/desktop-installer.

Prerequisites

  • A resonably high specced machine. Minimally 8 GB of memory is probably best (some packages like nerd-fonts-complete are really large and stress tmpfs. You don’t really want a desktop with less than that anyway.
  • A minimal Arch installation with no users except root.
    • The following packages installed: git sudo python wget
    • If your machine has wifi, make sure these are installed for wifi-menu: dialog wireless_tools wget unzip wpa_supplicant
  • A working internet connection. Pacman should at least be able to install packages.
  • A bit of patience, and a cup of coffee.

How to install

I’m not going to go into installing Arch, that’s outside of the scope of this document, and it’s been documented to death already. So I’m not going to repeat that. I’m going to assume you’ve gone through this wonderful process, and have a working and booting system, with a root account, and a working internet connection.

So, given that you are in this pristine state, fetch and unzip the desktop-installer in your homedirectory:

wget https://tinyurl.com/dinstaller && unzip dinstaller

You will end up with a folder called desktop-installer. cd into there.

Here’s a directory structure you should see:

drwxr-xr-x  8 ekollof ekollof  4096 Aug 20 13:15 .git
-rw-r--r--  1 ekollof ekollof    40 Jul 29 11:58 .gitignore
-rw-r--r--  1 ekollof ekollof  3362 Jul 29 11:58 README.md
-rw-r--r--  1 ekollof ekollof   989 Jul 29 11:58 Vagrantfile
-rw-r--r--  1 ekollof ekollof 19219 Jul 29 11:58 ansible.cfg
-rw-r--r--  1 ekollof ekollof   169 Jul 29 11:58 desktop.yml
-rw-r--r--  1 ekollof ekollof    45 Jul 29 11:58 hosts
-rwxr-xr-x  1 ekollof ekollof  2435 Jul 29 11:58 install-desktop
drwxr-xr-x  3 ekollof ekollof  4096 Jul 29 11:58 my_modules
drwxr-xr-x  4 ekollof ekollof  4096 Jul 29 11:58 roles
drwxr-xr-x  2 ekollof ekollof  4096 Aug  2 11:04 vars

Here’s a rundown of what you will find here.

  • Vagrantfile - I use this for testing. I’ve included it so you can sandbox things for yourself and kick the tires.
  • desktop.yml - The ansible playbook that installs users and packages.
  • vars/ - This is a pretty important folder. Here you can specify which packages you want, and which users you want created. You can also specify in a bare git repository for dotfiles, like mine at https://git.hackerheaven.org/ekollof/dotfiles.
  • install-desktop - A python script that makes sure some prerequisites (like ansible) are installed. It will also try to detect some details from your system and add packages with drivers to the manifest.

Setup

First, make the vars/user.yml in order. There is an vars/users.yml.example which you can copy to vars/user.yml which contains the following:

users:
  ekollof:
    realname: "Emiel Kollof"
    shell: "/usr/bin/zsh"
    dotfiles: "https://git.hackerheaven.org/ekollof/dotfiles.git"
    password: "changethis"

Yes, is is made for me, and obviously I don’t use that password. :)

Also, it references my dotfiles. If you want to have a desktop with some nice tiling WMs ready to go, just leave it. You can check it out here: https://git.hackerheaven.org/ekollof/dotfiles

If you want to be really fancy, you can encrypt it using ansible-vault. Be sure to edit ansible.cfg accordingly.

Running

Just fire off desktop-installer and you’re off. You can rerun it as many times as you want if you have to fix something. This isn’t perfect, but it usually works for me.

Postinstall

When desktop-installer is done, it will leave a cleanup.sh in all the users homedirectories. Log in as your user and run it before you reboot. It will check out all the repo submodules and build my version of dwm and st. The cleanup script lives at roles/users/files/cleanup.sh, customize it to whatever you need.

Aftercare

This setup has support for nvidia-based or virtualbox based machines, but it should work on everything with some coaxing. When it doesn’t ‘find’ your graphics card, it will assume VESA. For VMWare, you might have to install vmware-tools yourself.

All done!

If all goes well, and if you have a speedy internet connection, it shouldn’t take more than ~15 minutes to set everything up.

To do

Of course this thing isn’t perfect, but it’s made deploying my preferred desktop environment a lot more streamlined. I might change/add the following:

  • Run cleanup as the user during the desktop-installer run
  • Support VMware by installing vmware-tools and creating a service for systemd
  • Optimize the list of packages, there is a bit of bloat there with stuff I don’t use
  • Support other distributions/operating systems than Arch Linux
  • Maybe split things up so people can choose what they want to install, instead of everything