# How to write an [awesome-wm](https://awesomewm.org/) config with [Fennel](https://fennel-lang.org)

Awesome-WM is a X11 window manager, that is configured via Lua.  Fennel
is a Lisp for Lua.  This shows a general setup of how to write your
awesome-wm config using fennel directly without the compilation step
(which would also work, but is not needed).

## General setup 

Fetch a [recent Fennel version](https://fennel-lang.org/downloads) (the
code here uses **1.0.0**) and whatever else you want to use (e.g.
I also use [`fun.fnl`](https://github.com/luafun/luafun)) into your
`~/.config/awesome/` directory.

Then put some bootstrap code to allow Fennel require files in the
`rc.lua`:

```lua
local fennel = require("./fennel").install()
fennel.path = fennel.path .. ";.config/awesome/?.fnl"
-- for `import-macro` to work, also enhance `fennel['macro-path']`
```

Note: add the path to your config relative to your home directory.

After that block require your Awesome Fennel at the end (in my case
the file is named `cfg.fnl` and I use `require("cfg")`).

## Special setup

Download Fennel and LuaFun and add the files `fennel.lua` and `fun.lua`
to the config dir with the `rc.lua` and `cfg.fnl` from this gist.

My config focuses on the following features:

- minimalistic, think of evilwm; single client has no decorations at
  all, if there is more than one client on screen, all get a border and
  a changing focus color
- two-dimensional, "infinite" desktops (vi-bindings to navigate the
  "camera"); escape hatch to show all clients as tiles, select the
  client you are looking for and jump to that desktop; the goal here is
  to have many desktops and very few clients per desktop
- only a few layouts to choose from and even less are used by me; the
  default layout is showing clients in columns which can have a colspan
  (e.g. on a 21:9 monitor, you can have a browser at 16:9 and your
  editor beside it with 5:9)
- only focus on the window-manager - programs are started via
  [xbindkeys](https://www.nongnu.org/xbindkeys/)