How To Install and Configure Awesome WM

ALB
6 min readOct 26, 2020

--

Awesome Window Manager is a highly configurable, dynamic tiling window manager. It is configured in the Lua programming language, and it is very fast and extensible. This is the official website of the Awesome WM.

Given below are installation instructions and some configuration steps to help you get started. This guide assumes you are running Arch Linux. We have a complete guide on installing Arch Linux on this blog if you want to install it or if you want to save it for future reference. It is one of the best guides on Medium.

After installing Awesome, you can check this link for installing applications for various uses.

1. Install Awesome

Use this command to install Awesome, Xorg and Xterm terminal:

# sudo pacman -S xorg-server xorg-xinit xterm awesome

2. Initialize And Start Awesome

This method is to initialize and start Awesome without a Display Manager like lightdm

Add Awesome to the xinitrc file:

# echo “exec awesome” > ~/.xinitrc

Start Awesome:

# startx

3. Install Some Packages

You can install some of these packages if need be. Some of them are necessary to make changes and get help online in the window manager:

# sudo pacman -S firefox vlc virtualbox xfce4-taskmanager xfce4-power-manager xfce4-settings scrot pcmanfm kitty nitrogen picom geany file-roller dmenu

4. Copy The Config File

For us to make changes and modify the window manager, we need to edit the rc.lua file, which is the configuration file for Awesome.

Copy the config file so that we can edit it later. Make sure you have the .config folder and the awesome folder created in your home directory:

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

5. Auto Start Applications

We can auto start some applications like picom and nitrogen when Awesome starts.

Add these lines at the bottom of the config file to start applications:

-- Autostart Applicationsawful.spawn.with_shell(“picom”)awful.spawn.with_shell(“nitrogen --restore”)

6. Change The Default Terminal

You can change the default terminal by making changes in the below given line:

-- This is used later as the default terminal and editor to run.
  • Under the above line, change the terminal where it says. It should be on line 51:
terminal = “xterm”

7. Change The Default Run Prompt

Change the run prompt to dmenu, assuming you have dmenu installed. It should be on line 313:

-- Prompt

Change the second line, from:

awful.screen.focused().mypromptbox:run()

to the following:

awful.util.spawn(“dmenu_run”)

Change the description to “run dmenu” instead of “run prompt”

8. Add A Keybinding To Firefox

You can add a keybinding to Firefox so that you can launch it easily like dmenu.

Copy the three ‘Prompt’ lines that you have modified above and paste it under it. It starts with Prompt and ends with group = “launcher”}),.

Now change the modkey from r to b, function to “firefox”, and the description and group to “firefox” and “applications”. Now your code should look like this:

-- Firefoxawful.key({ modkey }, “b”, function () awful.util.spawn(“firefox”) end,{description = “firefox”, group = “applications”}),

9. Volume Control

For volume control, you can install volumeicon

# sudo pacman -S volumeicon 

10. Change Themes, Backgrounds, Layouts And Tags

To customize Awesome, you can change the theme and the background wallpaper. You can also change the layouts of the applications and the tags on the Awesome bar. For all this you can follow the link given below and :

https://awesomewm.org/apidoc/documentation/07-my-first-awesome.md.html

11. Remove The Title Bar From Application Windows

Remove the title bar (The bar on top of all windows) by editing this line and changing true to false. This should be line 500.

}, properties = { titlebars_enabled = true }

12. Start Numlock At Boot

You can start numlock at boot by installing this package:

# sudo pacman -S numlockx

Then, insert this line in the ~/.xinitrc file two lines above the exec line:

numlockx &

13. ProtonMail Bridge

If you use ProtonMail, you can install the ProtonMail Bridge using the link given below.

You must have the base-devel group package installed on your system for this to work:

# sudo pacman -S base-devel

Link to install ProtonMail Bridge:

https://protonmail.com/support/knowledge-base/install-bridge-linux-pkgbuild-file/

14. Change Display Resolution And Refresh Rate

If you want to change the display resolution or the refresh rate of your monitor, you can use any of these programs.

NVIDIA cards:

# sudo pacman -S nvidia-settings 

XFCE settings manager:

# sudo pacman -S xfce4-settings

You can also use Xrandr to set your resolution and refresh rate. For a single 1080p monitor with 120Hz refresh rate, you can run this command

# xrandr --output DP-0 --mode 1920x1080 --rate 120

You can also just use xrandr to see what displays are connected and what resolutions and refresh rates they support

# xrandr

15. ProtonVPN

If you use ProtonVPN, like we do, you can install and configure it using the below mentioned link:

https://github.com/ProtonVPN/linux-cli/blob/master/USAGE.md

16. Key Bindings

If you want to customize the way you use your keyboard with Awesome, you can change the default key bindings and add some new ones.

One such example is to change the key binding to close an application. It’s should be on line 346. By default, it is set to ‘modkey + Shift + c’. You can change it to, say, ‘modkey + q’ or ‘modkey + Shift + q’. Just search for ‘close’ in the rc.lua file and change it.

You have to be careful about one thing. That the key binding that you are setting is free and is not in use anywhere else in the rc.lua file. You will have to look at the file carefully or you can press the modkey + s key binding to check all the key bindings that are currently in use.

17. Mouse Bindings

If you don’t like the mouse bindings, you can comment all the lines below. These should be on line 222:

You can comment any line in the rc.lua file by adding two dash signs at the beginning of the line as shown below:

-- {{{ Mouse bindings--root.buttons(gears.table.join(--     awful.button({ }, 3, function () mymainmenu:toggle() end),--     awful.button({ }, 4, awful.tag.viewnext),--     awful.button({ }, 5, awful.tag.viewprev)----))-- }}}

18. Awesome Menu

Awesome has a menu at the top left corner by default which may be useless to some people. You can disable it if you want by commenting the lines like mentioned below. These lines should start from 83.

-- {{{ Menu
-- Create a launcher widget and a main menu
--myawesomemenu = {
-- { "hotkeys", function() hotkeys_popup.show_help(nil, awful.screen.focused()) end },
-- { "manual", terminal .. " -e man awesome" },
-- { "edit config", editor_cmd .. " " .. awesome.conffile },
-- { "restart", awesome.restart },
-- { "quit", function() awesome.quit() end },
--}
--mymainmenu = awful.menu({ items = { { "awesome", myawesomemenu, beautiful.awesome_icon },
{ "open terminal", terminal }
-- }
-- }}
--mylauncher - awful.widget.launcher({ image = beautiful.awesome_icon,
-- menu = mymainmenu })

19. Locate Files

To locate files on you system using the command line, mlocate can be used. First we need to install mlocate by running this command:

# sudo pacman -S mlocate

Then we need to update the database:

# sudo updatedb

And now we can search for a file on our system. Here rc.lua is the file that we are searching for.

# locate rc.lua

19. Configure The Terminal Emulator

We use alacritty as our default terminal emulator. There are some other good alternatives as well like st, termite, urxvt, etc. To configure alacritty, copy the yml file to your home directory:

# cp -i /usr/share/doc/alacritty/example/alacritty.yml ~/.config/alacritty

Make sure you have a folder called ‘alacritty’ in the .config folder

20. Mounting Hard Drives

Given below are steps to mount hard drives on startup:

Create a directory to mount the hard drive, for example, /media/data

# sudo mkdir /media/data
  • Run this command to get the UUID of the hard drive
# sudo blkid
  • Edit the fstab file
# sudo nano /etc/fstab
  • Insert a line with the UUID, path, file type, defaults and 0 0. The line should look like this
UUID=2f872a6b-2d86-6fb2-bc07-67ebe6de5025  / ext4 defaults  0 0
  • Check the mounts
# findmnt
  • Add a label to the hard drive
# e2label /dev/sdb1 Data

Here, Data is the label that we want to assign to the hard drive

  • To unmount the drive, use this command
# sudo umount /media/Data

You can also install ntfs-3g to get write access to NTFS formatted hard drives

# sudo pacman -S ntfs-3g

21. Force An Application To A Specific Tag

You can force an application to always open in a specific tag. To do this, add these lines in the rc.lua file

-- Set applications to always map on the tag 7 on screen 1.{ rule = { class = "Thunderbird" },properties = { screen = 1, tag = awful.util.tagnames[7] , switchtotag = true  } },

Here, we want Thunderbird to open on tag 7 and on screen 1. You can modify and duplicate to as many applications you want

22. Empty Trash

If you want to empty your trash can from the command line, Install the following program and use the commands given below:

# sudo pacman -S trash-cli

Command to list trashed items

# trash-list

Command to empty the trash can

# trash-empty

--

--

ALB
ALB

Written by ALB

A blog on Arch Linux and some other things. But mainly Arch Linux

No responses yet