loading...
Cover image for Awesome: A Versatile Window Manager

Awesome: A Versatile Window Manager

l04db4l4nc3r profile image Angad Sharma ・6 min read

Window Manager Hopping (10 Part Series)

1) Herbstluftwm: A Dead Simple Window Manager 2) Dwm: The Suckless Window Manager 3 ... 8 3) I3: The Improved Tiling Window Manager 4) Awesome: A Versatile Window Manager 5) Bspwm: A Bare-Bones Window Manager 6) Which Window Manager Are You Using? 7) Spectrwm: The Compact Window Manager 8) Ratpoison: Forget About Your Mouse 9) Monsterwm: 700 lines of pure beast 10) XMonad: Hackability, At a Cost

Awesome, or awesomewm, is a window manager which comes with a lot of features, right out of the box. It is written in the Lua programming language (almost), but configuring it does not require a lot of knowledge about the same. It is ideal for people starting out with window managers due to the fact that it is shipped with a lot of useful functionality which you would otherwise have to configure separately.


Features

  • Awesomewm is very stable, fast and with a small codebase and footprint.
  • It uses tags instead of workspaces: windows can be placed on several tags and displayed at the same time.
  • It can be configured during runtime. Which means that any customization made does not require the service to be restarted.
  • It uses the asynchronous XCB library instead of the old, synchronous XLIB.
  • It comes with a very comprehensive application menu as well as a run menu.

Setting Up

Awesomewm is available on most source repositories. In addition, you can download the release and build it from source.

GitHub logo awesomeWM / awesome

awesome window manager

Readme

About Awesome

Awesome is a highly configurable, next generation framework window manager for X.

Building and installation

After extracting the dist tarball, run:

make

This will create a build directory, run cmake in it and build Awesome.

After building is finished, you can either install via make install:

make install  # you might need root permissions

or by auto-generating a .deb or .rpm package, for easy removal later on:

make package
sudo dpkg -i awesome-x.y.z.deb
# or
sudo rpm -Uvh awesome-x.y.z.rpm

NOTE: Awesome uses cmake to build. In case you want to pass arguments to cmake, please use the CMAKE_ARGS environment variable. For instance:

CMAKE_ARGS="-DCMAKE_INSTALL_PREFIX=/opt/awesome" make

Installing current git master as a package receipts

Arch Linux AUR

sudo pacman -S --needed base-devel git
git clone https://aur.archlinux.org/awesome-git.git
cd awesome-git
makepkg -fsri

Debian-based

sudo apt build-dep awesome
git clone https://github.com/awesomewm/awesome
cd awesome
make package
sudo apt install *.deb

Build

The easiest way to get started (on debian based systems) is this:

sudo apt install awesome

To run it, simple add the following line in your ~/.xsession file:

exec awesome

Logout and log back in again, and boom! You are good to go.


Getting Started

When you login, awesomewm already has a default wallpaper set. Along with 9 tags on the menubar.

Alt Text

The default modifier in awesomewm is <Win>. To spawn a terminal, press <Win> + <Enter>. To get a list of all shortcuts, awesomewm provides a comprehensive cheat-sheet. Just press <Win> + s to view it.

Alt Text

To activate the application menu simply click on the top left corner of the menu bar, or right click anywhere. You will be greeted with something like this:

Alt Text

This menu can be used as a quick launcher, and even be configured to hold items which you want. In addition, <Win> + r can be used for spawning a run menu on the menubar. But I prefer dmenu instead.


Tags

In awesomewm, the status bar shows the number of active tags. Awesome gives you 9 tags that we can switch between. To do so, simply hit <Win> + [1-9]. For example <Win> + 6 will take you to the 6th workspace. Note that whatever was running on the previous workspace keeps on running there as usual.

To shift a currently running window to another tag, simply press <Win> + <Shift> + [1-9].


Layouts

In awesomewm, movement between windows is done using <Win> + j|k and window resizing is done using <Win> + h|l.

Awesome offers different layouts per tag, which can be viewed on the left top corner of the menu bar and can be changed by clicking on the same:

Cornernew: Alt Text

Cornetnww: Alt Text

Cornerser: Alt Text

Cornersww: Alt Text

Dwindlew: Alt Text

Fairhw: Alt Text

Fairvw: Alt Text

Floatingw: Alt Text

Fullscreenw: Alt Text

Magnifierw: Alt Text

Maxw: Alt Text

Spiralw: Alt Text

Tilebottomw: Alt Text

Tileleftw: Alt Text

Tiletopw: Alt Text
Tilww: Alt Text


Configuration

The awesome configuration lies in $XDG_CONFIG_HOME/awesome/rc.lua file. For example: /etc/xdg/awesome/rc.lua. By default awesomewm looks at the ~/.config/awesome/rc.lua file if it can find it. If it can't then it defaults to the aforementioned configuration.

To edit it, simply run the following command for getting started:

cp /etc/xdg/awesome/rc.lua ~/.config/awesome/
vim ~/.config/awesome/rc.lua

After making any changes in rc.lua, awesomewm can be reloaded by pressing <Win> + <Ctrl> + r. In addition, the awesome-client can also be used for the same:

echo 'awesome.restart()' | awesome-client

In this blog, we will be configuring the following things:


Changing Default Keybindings

The configuration file, rc.lua, contains a globalkeys option which is a table that stores keybindings.

Alt Text

The first section stores the modifier keys, eg: {modkey,}, {modkey, "Shift"} or {modkey, "Control"}. The second part can be used to add keys to be pressed along with the modifier, and the third part is the function to be performed when the particular binding is pressed.

Each keybinding is a part of a group and a description can be provided to go along with them. Adding a keybinding is as simple as copy-pasting the above binding and changing it with respect to what action you want to perform. For example, the following binding spawns firefox whenever I press modkey + b:

awful.key({modkey, }, "b", awful.spawn("firefox"))

Adding Startup Processes

You can spawn processes or applications easily by using the following commands in rc.lua. To open these applications on startup, simply add the commands at the bottom of the configuration:

-- spawning a program
awful.spawn("firefox")

-- running a script inside a shell
awful.spawn.with_shell("launch.sh")

-- setting wallpaper using nitrogen
awful.spawn.with_shell("nitrogen --set-scaled /usr/share/backgrounds/crysis.jpg")

Adding and Removing Layouts

Lain is a library which provides a lot of useful commands for configuring widgets, adding layouts and other useful tweaks. Follow the repository to see how to use lain to its fullest:

GitHub logo lcpz / lain

Awesome WM complements

Lain

Layouts, widgets and utilities for Awesome WM 4.x

Author: Luca CPZ
Version: git
License: GNU-GPL2
Source: https://github.com/lcpz/lain

Description

Successor of awesome-vain, this module provides alternative layouts, asynchronous widgets and utility functions for Awesome.

Contributions

Constructive criticism and suggestions are welcome.

If you want to create a pull request, make sure that:

  • Your code fits with the general style of the module. In particular, you should use the same indentation pattern that the code uses, and also avoid adding space at the ends of lines.
  • Your code its easy to understand, maintainable, and modularized. You should also avoid code duplication wherever possible by adding functions to or using lain.helpers. If something is unclear, or you can not write it in such a way that it will be clear, explain it with a comment.
  • You test your changes before submitting to make sure that you code works and…

Let us get started by importing lain in our rc.lua:

local lain = require("lain")

To add a layout, namely centerwork, defined by lain, simply go to the awful.layout.layouts section and add lain.layout.centerwork. Other layouts can be removed from here, if you want to. The order of the layouts matter!

Alt Text


Adding Useless Gaps

Useless gaps refers to the space between windows that can be added for aesthetic purposes. For example:

Alt Text

These gaps can be configured at runtime by adding the following keybindings to globalkeys:

awful.key({ modkey, "Control" }, "=", function () lain.util.useless_gaps_resize(1) end),

awful.key({ modkey, "Control" }, "-", function () lain.util.useless_gaps_resize(-1) end),

These commands will resize the gaps by a factor of 1 pixel every time we press modkey + Control + =|-.


Verdict

Even though configuring awesomewm is not as easy as i3, it offers a lot of things right out of the box and is easy to get started with. Lua configuration is slightly challenging when it comes to adding additional libraries and trying to keep the code modular but there is a very supportive community and third party libraries for the same.

Awesome is a solid window manager for both beginners and experts, and I highly recommend it for both.

Judgement Rubric Rating
Simplicity of use ❤️ ❤️ ❤️ ❤️
Simplicity of Configuration ❤️ ❤️
Learning curve (lesser is better) ❤️ ❤️ ❤️
Productivity ❤️ ❤️ ❤️ ❤️
Fun ❤️ ❤️

References

Window Manager Hopping (10 Part Series)

1) Herbstluftwm: A Dead Simple Window Manager 2) Dwm: The Suckless Window Manager 3 ... 8 3) I3: The Improved Tiling Window Manager 4) Awesome: A Versatile Window Manager 5) Bspwm: A Bare-Bones Window Manager 6) Which Window Manager Are You Using? 7) Spectrwm: The Compact Window Manager 8) Ratpoison: Forget About Your Mouse 9) Monsterwm: 700 lines of pure beast 10) XMonad: Hackability, At a Cost

Posted on by:

l04db4l4nc3r profile

Angad Sharma

@l04db4l4nc3r

Backend Developer and DevOps SysAdmin

Discussion

markdown guide