awesome

From Gentoo Wiki
Jump to: navigation, search
This page contains changes which are not marked for translation.

External resources

awesome is a highly configurable, next generation framework window manager for X. It is primarly targeted at power users, developers and any people dealing with every day computing tasks and who want to have fine-grained control on theirs graphical environment.

Installation

Install x11-wm/awesome:

root # emerge --ask awesome

Configuration

Starting

To start awesome you can use a display manager or startx.

If want to use startx and want ConsoleKit support, setup ConsoleKit and create the following file:

File~/.xinitrc

exec ck-launch-session dbus-launch --sh-syntax --exit-with-session awesome

Configuration file

The default configuration file of awesome is located in ~/.config/awesome/rc.lua. If such a directory or file does not exist youe will need to create them. A default, out of the box, configuration is distributed with awesome and can be found at /etc/xdg/awesome/rc.lua. We would need to copy that configuration file to the users home directory.

First create the awesome directory:

user $ mkdir -p ~/.config/awesome/

Then we copy the lua configuration file:

user $ cp /etc/xdg/awesome/rc.lua ~/.config/awesome/rc.lua

If you do not have x11-terms/xterm installed, either install it or change the defalut terminal emulator. Shown here the default terminal emulator has been set to kde-base/konsole, the default for KDE4 installations.

File~/.config/awesome/rc.lua

-- This is used later as the default terminal and editor to run.
terminal = "konsole"

After making changes its useful to check the configuration file for errors:

user $ awesome -k
✔ Configuration file syntax OK


Add wallpaper:

root # emerge --ask feh


For instance, if you use awsetbg to set your wallpaper, you can write in the theme.lua page that you just selected:

theme.wallpaper_cmd = { "awsetbg -f .config/awesome/themes/awesome-wallpaper.png" }

Keyboard shortcuts

These are the most useful default shortcuts:

  • mod4+mouse1 = move client with mouse
  • mod4+mouse2 = resize client with mouse
  • mod4+enter = open terminal
  • mod4+r = run command
  • mod4+shift+c = kill
  • mod4+m = maximize
  • mod4+n = minimize
  • mod4+ctrl+n = restore minimized clients
  • mod4+f = fullscreen
  • mod4+tab = switch to previous client
  • mod4+ctrl+space = float
  • mod4+j = hilight left client
  • mod4+k = hilight right client
  • mod4+shift+j = move client right
  • mod4+shift+k = move client left
  • mod4+l = resize tiled client
  • mod4+h = resize tiled client
  • mod4+left / right = change tag
  • mod4+1-9 = change tag
  • mod4+shift+1-9 = send client to tag

Tags

Example of four tags with custom number symbols.

Filerc.conf

-- {{{ Tags
tags = {}
for s = 1, screen.count() do
    tags[s] = awful.tag({ "➊", "➋", "➌", "➍" }, s, layouts[1])
end
-- }}}

Menu

Example of custom awesome menu.

Filerc.conf

-- {{{ Menu
myawesomemenu = {
   { "manual", terminal .. " -e man awesome" },
   { "edit config", editor_cmd .. " " .. awesome.conffile },
   { "reload", awesome.restart },
   { "quit", awesome.quit },
   { "reboot", "reboot" },
   { "shutdown", "shutdown" }
}

appsmenu = {
   { "urxvt", "urxvt" },
   { "sakura", "sakura" },
   { "ncmpcpp", terminal .. " -e ncmpcpp" },
   { "luakit", "luakit" },
   { "uzbl", "uzbl-browser" },
   { "firefox", "firefox" },
   { "chromium", "chromium" },
   { "thunar", "thunar" },
   { "ranger", terminal .. " -e ranger" },
   { "gvim", "gvim" },
   { "leafpad", "leafpad" },
   { "htop", terminal .. " -e htop" },
   { "sysmonitor", "gnome-system-monitor" }
}

gamesmenu = {
   { "warsow", "warsow" },
   { "nexuiz", "nexuiz" },
   { "xonotic", "xonotic" },
   { "openarena", "openarena" },
   { "alienarena", "alienarena" },
   { "teeworlds", "teeworlds" },
   { "frozen-bubble", "frozen-bubble" },
   { "warzone2100", "warzone2100" },
   { "wesnoth", "wesnoth" },
   { "supertuxkart", "supertuxkart" },
   { "xmoto" , "xmoto" },
   { "flightgear", "flightgear" },
   { "snes9x" , "snes9x" },

}

mymainmenu = awful.menu({ items = { { "awesome", myawesomemenu },
                                    { "apps", appsmenu },
				    { "games", gamesmenu },
                                    { "terminal", terminal },
				    { "web browser", browser },
				    { "text editor", geditor }
                                  }
                        })

mylauncher = awful.widget.launcher({ image = image(beautiful.awesome_icon),
                                     menu = mymainmenu })
-- }}}

Date

Example of custom date format. %d.%m %H:%M = the format, 60 is the update interval in seconds. You can get the format options with date --help.

Filerc.conf

-- {{{ Wibox
-- Create a textclock widget
mytextclock = awful.widget.textclock({ align = "right" }," %d.%m %H:%M ", 60)

Volume control

media-sound/volumeicon handles volume keys automaticly and shows volume level in tray icon.

root # emerge --ask volumeicon

Autostart volumeicon from .xinitrc:

File~/.xinitrc

volumeicon &
exec ck-launch-session dbus-launch awesome

Alternativly, a lightweight method is to add volume keys straight to awesome config:

Filerc.confVolume keys

awful.key({ }, "XF86AudioLowerVolume", function () awful.util.spawn("amixer -q sset Master 2dB-") end)
awful.key({ }, "XF86AudioRaiseVolume", function () awful.util.spawn("amixer -q sset Master 2dB+") end)

MPD multimedia keys

Install media-sound/mpc to add multimedia keybindings for MPD:

root # emerge --ask mpc
Filerc.confVolume keybindings

awful.key({ }, "XF86AudioNext",function () awful.util.spawn( "mpc next" ) end),
awful.key({ }, "XF86AudioPrev",function () awful.util.spawn( "mpc prev" ) end),
awful.key({ }, "XF86AudioPlay",function () awful.util.spawn( "mpc play" ) end),
awful.key({ }, "XF86AudioStop",function () awful.util.spawn( "mpc pause" ) end),

Add a custom keybinding, like Alt+Tab, to switch to previous window:

Filerc.confAlt-TAB keybinding

-- {{{ Key bindings
globalkeys = awful.util.table.join(
...
    -- alt + tab
    awful.key({ "Mod1", }, "Tab",
        function ()
            awful.client.focus.history.previous()
            if client.focus then
                client.focus:raise()
            end
        end),

Debugging config with Xephyr

Xephyr is useful tool for debugging new config files as it creates an instance of an X server within a client window.

user $ Xephyr -ac -br -noreset -screen 800x600 :1

This will open an 800x600 window. To run awesome within it open a new terminal and run the following

user $ DISPLAY=:1.0 awesome

This will run awesome within a window.

User configuration files