1 -- Standard awesome library
2 gears = require("gears")
3 awful = require("awful")
4 awful.rules = require("awful.rules")
5 require("awful.autofocus")
6 -- Theme handling library
7 beautiful = require("beautiful")
8 -- Notification library
9 naughty = require("naughty")
10 menubar = require("menubar")
12 --local APW = require("apw/widget")
15 -- Check if awesome encountered an error during startup and fell back to
16 -- another config (This code will only ever execute for the fallback config)
17 if awesome.startup_errors then
18 naughty.notify({ preset = naughty.config.presets.critical,
19 title = "Oops, there were errors during startup!",
20 text = awesome.startup_errors })
23 -- Handle runtime errors after startup
25 local in_error = false
26 awesome.connect_signal("debug::error", function (err)
27 -- Make sure we don't go into an endless error loop
28 if in_error then return end
31 naughty.notify({ preset = naughty.config.presets.critical,
32 title = "Oops, an error happened!",
39 -- {{{ Variable definitions
40 -- Themes define colours, icons, and wallpapers
41 beautiful.init("/usr/share/awesome/themes/default/theme.lua")
43 -- This is used later as the default terminal and editor to run.
45 editor = os.getenv("EDITOR") or "vim"
46 editor_cmd = terminal .. " -e " .. editor
49 -- Usually, Mod4 is the key with a logo between Control and Alt.
50 -- If you do not like this or do not have such a key,
51 -- I suggest you to remap Mod4 to another key using xmodmap or other tools.
52 -- However, you can use another modifier like Mod1, but it may interact with others.
60 if beautiful.wallpaper then
61 for s = 1, screen.count() do
62 gears.wallpaper.maximized(beautiful.wallpaper, s, true)
80 -- Signal function to execute when a new client appears.
81 client.connect_signal("manage", function (c, startup)
82 -- Enable sloppy focus
83 c:connect_signal("mouse::enter", function(c)
84 if awful.layout.get(c.screen) ~= awful.layout.suit.magnifier
85 and awful.client.focus.filter(c) then
91 -- Set the windows at the slave,
92 -- i.e. put it at the end of others instead of setting it master.
93 -- awful.client.setslave(c)
95 -- Put windows in a smart way, only if they does not set an initial position.
96 if not c.size_hints.user_position and not c.size_hints.program_position then
97 awful.placement.no_overlap(c)
98 awful.placement.no_offscreen(c)
103 client.connect_signal("focus", function(c) c.border_color = beautiful.border_focus end)
104 client.connect_signal("unfocus", function(c) c.border_color = beautiful.border_normal end)
108 root.keys(globalkeys)
110 -- {{{ Autostart applications