Setting Up A "lightweight" Archlinux/Awesome WM VM.

Overview

This post is meant to document the various modifications I had to make to get an integrated and functional desktop environment working using Archlinux and Awesome WM. The setup is run on an iMac 5k in a VM which is copied to a surfacebook when traveling.

My goal in setting this up was to create an efficient DE with everything nicely integrated and nothing extra added. If it's there it's b/c I wanted it to be.

Basic DE requirements.

  • Tiling WM (chose awesome wm)
  • Beautiful – HiDPI enhanced fonts and elegant (minimal) interfaces.
  • Desktop Notifications
  • Keyring for ssh keys and passwords.
  • Spotlight like searches (i.e., data and metadata indexed in real-time)
  • Dropbox Integration
  • Quick Launch (hotkeys or phrases to quickly run apps or scripts)
  • Detachable remote sessions.
  • Screen captures

Important Applications.

  • Terminal App (Fast)
    • Mate terminal
  • Emacs
    • org mode for todo and mail tracking.
    • mu4e for mail
    • erc for jabber and irc
    • standard programming stuff.
    • Use Spacemacs and Profit.
  • Openvpn

Pleasant Surprises

  • Remote X11 login
  • Decent Sound

Notes

Archlinux AUR Packages

Install pacaur and use it.

Pacaur is a nice way to be able to install from community/extra repositories ala pacman, but also seamlessly fetch additional packages from AUR.

Tiling WM - Awesome

Installed AUR

$ pacaur -S awesome-git
$ pacaur -S obvious-git

Login Applications

In order to have things auto-started from packages you install that require this you should install and use the dex utility. Packages that want to be autostarted on session login add .desktop files to your .config/autostart directory. dex will find these files and execute them as appropriate

Enable dex by adding the following to the bottom of your .config/awesome/rc.lua file.

  os.execute("dex -a -e Awesome")
#+end_src lua

  To see what is enabled by this addition use the following command:

#+begin_src bash
  $ dex -d -a -e Awesome
  ...
  Executing command: zeitgeist-datahub
  Executing command: dropbox
  Executing command: kalu
  Executing command: recollindex -w 60 -m

Integration with Freedesktop DE software (GNOME, KDE, LXDE, …

Applications and services that come from other standard desktop environment (e.g., GNOME, KDE, et al). that want to be auto-started on session login add .desktop files under the /etc/xdg/autostart directory.

To enable one of these applications or services you need to modify their .desktop files in /etc/xdg/autostart directory. Search for the line OnlyShowIn line and add ";Awesome;" to it if it isn't there already.

For my instlation I enable the following desktop files:

$ dex -d -a -e Awesome
at-spi-core (reqd by gtk3)
gnome-keyring-pkcs11 (reqd by gnome-keyring)
gnome-keyring-secrets (reqd by gnome-keyring)
gnome-keyring-ssh (req'd by gnome-keyring)
pulseaudio

Desktop Notifications

pacman -S xfce4-notifyd

Awesome WM actually has support for notifications using the naughty package, but it was a bit ugly for me when the notifications included action buttons (they stacked vertically vs. horizontally). I checked out various other daemons listed on the archlinux wiki, and settled on xfce4-notifyd. xfce4-notifyd looked great and supported the general gnome dark theme, didn't block or stack notifications on top of each other. Some people want this I do not, I do not want to received superfluous notifications so I want to notice them. One major use I have for this is to stick non-expiring notifications for deadlines for TODOs in org mode. Having this allows me to depend on org mode as the keeper of all my notes and reminders.

In order to use an external (to awesome) notification daemon you need to make sure that naughty is not require'd by your rc.lua config (directly or indirectly). Look out for obvious widgets (e.g., obvious.battery). Eventually it would be nice to figure out how to not have this restriction and perhaps have the naughty API just proxy, and not listen for notifications.

To get customize the look of the notifications you need to use xfce4-notifyd-config

Keyring (GNOME)

I use the gnome keyring. After installing gnome-keyring you need to enable the .desktop files under /etc/xdg/autostart as described above in `Login Applications`. Additionally, you need to rename or remove the /usr/share/dbus-1/services/org.freedesktop.secrets.service file. If you do not do the latter then you will end up with 2 daemons the second of which was not given the password for unlocking from PAM, and so on the first use of the keyring you will be prompted with a pop-up window claiming that the keyring was not unlocked at login and to re-enter your login password.

Startup X11 files

It can be hard to tell what is actually executed during startup you should check: /etc/X11/xinit/xinitrc.d/ as these probably are and may affect your settings (like DPI and font dpi).

In particular xft-settings.sh may be resetting your dpi to 96

HiDPI

This can be quite tricky to get right. The end result is that you need xdpyinfo to show the correct display size (and thus DPI) for your screen resolution. You also need xrdb -query | grep dpi to show Xft.dpi being set to the same value.

The fastest way to do this is to run xrandr --dpi 217 (replace 217 with your actual DPI) somewhere. Here are the other modifications I made.

lightdm

  • display-setup-script can be used to call xrandr and others, primarily make sure your DPI is set correctly also Xft.dpi in your resources
  • xft.dpi in greeter config needs to be set for a nice gtk greeter window
# If inside vmware VM
/usr/bin/vmware-user-suid-wrapper
sleep 4

XRES=$(xdpyinfo | sed  -e '/dimen/!d;s, *dimensions: *\([0-9]*\)x\([0-9]*\) pixels.*,\1,')
YRES=$(xdpyinfo | sed  -e '/dimen/!d;s, *dimensions: *\([0-9]*\)x\([0-9]*\) pixels.*,\2,')
mode=${XRES}x${YRES}
dpi=192  # Whatever the correct value is or calculate by size and res.
x11screename=Virtual1
xrandr --output $x11screename --primary --mode $mode --dpi $dpi >> $tmpf 2>&1

vmware

  • XXX add section on /usr/bin/vmware-user-suid-wrapper, xrandr must be run after this as it messes up the display size.
  • This will be run initially by your login from /usr/x

Beautifully Rendered Fonts (infinality)

Follow these directions.

Don't forget to update the xft config to your HiDPI setting. This may be being set in /etc/X11/xinit/xinitrc.d/xft-settings.sh. You probably want to just remove that setting and set it elsewhere (perhaps in lightdm fixup.

No scaling setting (i.e., leave 1).

If you've done all the above you should nt need any scale adjustment hacks with environment variables or GUI configuration dialogs.

Important Applications

Terminal (mate)

I ended up doing some odd hacks on scripts I found to setup a bunch of color profiles. The important setting though that was hard to find was for setting the "system default monospace font". To set that to DejaVu Sans Mono 12 point enter the following:

gsettings set org.mate.interface monospace-font-name "'Ubuntu Mono 12'"