Table of Contents

Running (background) processes in Awesome

We want to have background processes running in Awesome. To do this we:

  • add a lua file listing each process to run
  • include this file in our Awesome config file

Create ~/bin/run_once

We use this shell script to provide a means to have a single instance of a process running.

#!/bin/sh
pgrep $1 > /dev/null || ($@ >/dev/null &)

Save this in ~/bin/runonce, make sure ~/bin is in your PATH and make it executable:

chmod 0755 ~/bin/run_once

Create ~/.config/awesome/autostart.lua

This file should list all processes you want to run, using the shell script we created above

awful.util.spawn_with_shell("/home/<USER>/bin/run_once dropbox start")
awful.util.spawn_with_shell("/home/<USER>/bin/run_once /usr/libexec/gnome-settings-daemon")

Load the autostart file in ~/.config/awesome/rc.lua

Add this in ~/.config/awesome/rc.lua:

require("autostart");

The restart Awesome (Super-shift-Q by default)