2012-07-06 14:19:54 +02:00
|
|
|
require("awful")
|
|
|
|
require("awful.autofocus")
|
|
|
|
require("awful.rules")
|
|
|
|
require("beautiful")
|
|
|
|
require("naughty")
|
|
|
|
|
|
|
|
-- Simple function to load additional LUA files from rc/.
|
2012-07-14 16:29:19 +02:00
|
|
|
function loadrc(name, mod)
|
2012-07-06 14:19:54 +02:00
|
|
|
local success
|
|
|
|
local result
|
2012-07-14 16:29:19 +02:00
|
|
|
|
|
|
|
-- Which file? In rc/ or in lib/?
|
|
|
|
local path = awful.util.getdir("config") .. "/" ..
|
|
|
|
(mod and "lib" or "rc") ..
|
|
|
|
"/" .. name .. ".lua"
|
|
|
|
|
|
|
|
-- If the module is already loaded, don't load it again
|
|
|
|
if mod and package.loaded[mod] then return package.loaded[mod] end
|
|
|
|
|
|
|
|
-- Execute the RC/module file
|
2012-07-06 14:19:54 +02:00
|
|
|
success, result = pcall(function() return dofile(path) end)
|
|
|
|
if not success then
|
2012-07-10 22:21:04 +02:00
|
|
|
naughty.notify({ title = "Error while loading an RC file",
|
|
|
|
text = "When loading `" .. name ..
|
|
|
|
"`, got the following error:\n" .. result,
|
|
|
|
preset = naughty.config.presets.critical
|
|
|
|
})
|
2012-07-06 14:19:54 +02:00
|
|
|
return print("E: error loading RC file '" .. name .. "': " .. result)
|
|
|
|
end
|
2012-07-14 16:29:19 +02:00
|
|
|
|
|
|
|
-- Is it a module?
|
|
|
|
if mod then
|
|
|
|
return package.loaded[mod]
|
|
|
|
end
|
|
|
|
|
2012-07-06 14:19:54 +02:00
|
|
|
return result
|
|
|
|
end
|
|
|
|
|
2012-07-15 17:10:40 +02:00
|
|
|
loadrc("errors") -- errors and debug stuff
|
|
|
|
|
2012-11-06 11:51:56 +01:00
|
|
|
-- Create cache directory
|
|
|
|
os.execute("test -d " .. awful.util.getdir("cache") ..
|
|
|
|
" || mkdir -p " .. awful.util.getdir("cache"))
|
|
|
|
|
2012-07-06 14:19:54 +02:00
|
|
|
-- Global configuration
|
|
|
|
modkey = "Mod4"
|
|
|
|
config = {}
|
2014-09-17 17:52:04 +02:00
|
|
|
config.terminal = "xfce4-terminal --perl-lib " .. awful.util.getdir("config") .. "/lib/rxvt"
|
|
|
|
config.termclass = "Xfce4-terminal"
|
2012-07-06 14:19:54 +02:00
|
|
|
config.layouts = {
|
|
|
|
awful.layout.suit.tile,
|
2012-07-07 14:48:38 +02:00
|
|
|
awful.layout.suit.tile.left,
|
2012-07-08 09:46:08 +02:00
|
|
|
awful.layout.suit.tile.bottom,
|
2012-07-14 01:06:48 +02:00
|
|
|
awful.layout.suit.fair,
|
2012-07-06 14:19:54 +02:00
|
|
|
awful.layout.suit.floating,
|
|
|
|
}
|
|
|
|
config.hostname = awful.util.pread('uname -n'):gsub('\n', '')
|
2013-06-27 08:59:13 +02:00
|
|
|
config.browser = "chromium"
|
2012-07-06 14:19:54 +02:00
|
|
|
|
|
|
|
-- Remaining modules
|
2012-07-14 11:04:08 +02:00
|
|
|
loadrc("xrun") -- xrun function
|
|
|
|
loadrc("appearance") -- theme and appearance settings
|
2012-07-15 17:10:40 +02:00
|
|
|
loadrc("debug") -- debugging primitive `dbg()`
|
2012-07-14 12:29:48 +02:00
|
|
|
|
2012-07-14 11:04:08 +02:00
|
|
|
loadrc("start") -- programs to run on start
|
|
|
|
loadrc("bindings") -- keybindings
|
|
|
|
loadrc("wallpaper") -- wallpaper settings
|
|
|
|
loadrc("widgets") -- widgets configuration
|
2012-09-08 22:47:35 +02:00
|
|
|
loadrc("tags") -- tags handling
|
2012-07-14 11:04:08 +02:00
|
|
|
loadrc("xlock") -- lock screen
|
|
|
|
loadrc("signals") -- window manager behaviour
|
|
|
|
loadrc("rules") -- window rules
|
|
|
|
loadrc("quake") -- quake console
|
2012-07-15 16:14:39 +02:00
|
|
|
loadrc("xrandr") -- xrandr menu
|
2012-07-06 14:19:54 +02:00
|
|
|
|
|
|
|
root.keys(config.keys.global)
|