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