This wiki will shut down!

Please note that this wiki will be made read-only and eventually be taken offline.

A replacement is being discussed at We'd be happy to have more input for that discussion and volunteers who help us migrate the content of this wiki to its replacement.

Space Invaders

From awesome
Jump to: navigation, search

Awesome Invaders[edit]


Screenshot of Awesome Invaders

Awesome Invaders is, as the name says, an implementation of Space Invaders using Awesome 3's Lua interface. Everything is displayed using the new WiBox from Awesome 3 GIT, which allows arbitrary placement of widgets anywhere on the screen. On this page, I will walk you through setting it up and running.

Setting it up[edit]


  • Awesome 3 GIT, get this from git with the following command:
 git clone git://

Editing the config file[edit]

Open up ~/.config/awesome/rc.lua with your favourite editor. The top of the file should look like this (or similar):


Add the following line below the last line containing a require, in this case, you would add it after require('beautiful'):


The result should look similar to this:


Then, find the section of your configuration file where keybindings are set. It may look something like this:

 keybinding({ modkey, "Mod1" }, "c", function () client.focus:kill() end):add()
 keybinding({ modkey }, "Up", function () awful.client.focus.byidx(-1); client.focus:raise() end):add()
 keybinding({ modkey }, "Down", function () awful.client.focus.byidx(1);  client.focus:raise() end):add()
 keybinding({ modkey }, "Left", function () awful.client.swap(1) end):add()

Add a keybinding to start invaders like this:

 keybinding({ modkey, "Mod1" }, "i",

Running the game with awesome-client / the lua prompt[edit]

You can also run the game without the need to edit your config file. Simply run awesome-client in a terminal, then run the following two commands:


The same can be done with the lua prompt if you are running Awesome from the next branch of the git repository.

Running the game without awesome-client[edit]

To start the game, press the keybinding you just specified. If you copied the above one, hit Modkey+Alt+i. Pressing left and right moves your spaceship, space fires. If you want to quit the game, press Q. Pressing S will create a screenshot in ~/.cache/awesome. For creating screenshots, you need ImageMagick installed.

Note #1: On some systems, X and awesome might eat a lot of ressources while running Space Invaders. This performance impact should vanish once you quit the game. If not, let me know about it.

Note #2: If you run the game on top of other windows, you will notice squares around the player and enemies. Through these squares, the screens background is shining through, therefore, it is the best if you run the game on a free tag with no windows behind it.

Running the game from the awesome menu[edit]

After requiring invaders from either your rc.lua file or awesome-client, you can launch the game from your awesome menu with this entry:

  { "Invaders", }


I wrote the code for the game, while Garoth made the sprites. If you want to comment, complain, compliment on this piece of code, please keep in mind that this is more of a proof-of-concept than of a completely functioning game, and drop me a line in #awesome.

Also, if you are having problems, please make sure to grab the latest GIT checkout.

Have fun playing :)