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-07-06 14:19:54 +02:00
|
|
|
-- Global configuration
|
|
|
|
modkey = "Mod4"
|
|
|
|
config = {}
|
2012-07-16 01:14:07 +02:00
|
|
|
config.terminal = table.concat(
|
|
|
|
{
|
|
|
|
"urxvtcd",
|
|
|
|
"++iso14755", -- Disable ISO 14755 mode
|
|
|
|
"+sb", -- Disable scrollbar
|
|
|
|
"-si -sw", -- Don't scroll to bottom
|
|
|
|
"-j", -- Enable jump scrolling
|
|
|
|
"-sl 2000", -- Scrollback buffer
|
|
|
|
"-bc", -- Blink cursor
|
|
|
|
"-cr green", -- Cursor color
|
|
|
|
"-depth 32",
|
|
|
|
"-sh 30", -- Darken the background
|
|
|
|
-- Color stuff
|
|
|
|
"-bg rgba:0000/0000/0000/dddd",
|
|
|
|
"-fg white",
|
|
|
|
"--color0 rgb:00/00/00",
|
|
|
|
"--color1 rgb:AA/00/00",
|
|
|
|
"--color2 rgb:00/AA/00",
|
|
|
|
"--color3 rgb:AA/55/00",
|
|
|
|
"--color4 rgb:41/69/E1", -- Royal Blue
|
|
|
|
"--color5 rgb:AA/00/AA",
|
|
|
|
"--color6 rgb:00/AA/AA",
|
|
|
|
"--color7 rgb:AA/AA/AA",
|
|
|
|
"--color8 rgb:55/55/55",
|
|
|
|
"--color9 rgb:FF/55/55",
|
|
|
|
"--color10 rgb:55/FF/55",
|
|
|
|
"--color11 rgb:FF/FF/55",
|
|
|
|
"--color12 rgb:55/55/FF",
|
|
|
|
"--color13 rgb:FF/55/FF",
|
|
|
|
"--color14 rgb:55/FF/FF",
|
|
|
|
"--color15 rgb:FF/FF/FF",
|
|
|
|
"-fn xft:DejaVuSansMono-8", -- Font
|
|
|
|
"-letsp -1", -- Fix font width
|
|
|
|
"-pe matcher", -- Enable "matcher extension" (to detect URL)
|
|
|
|
}, " ")
|
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,
|
|
|
|
}
|
2012-07-14 01:29:24 +02:00
|
|
|
config.tags = {
|
|
|
|
{ layout = awful.layout.suit.fair }, -- 1
|
|
|
|
{ name = "emacs", mwfact = 0.6 },
|
|
|
|
{ name = "www", mwfact = 0.7 },
|
|
|
|
{ name = "im" , mwfact = 0.2 },
|
|
|
|
{ }, -- 5
|
|
|
|
{ }, -- 6
|
|
|
|
{ }, -- 7
|
|
|
|
}
|
2012-07-06 14:19:54 +02:00
|
|
|
config.hostname = awful.util.pread('uname -n'):gsub('\n', '')
|
|
|
|
|
|
|
|
-- 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
|
2012-07-14 12:29:48 +02:00
|
|
|
loadrc("keyboard") -- keyboard configuration
|
2012-07-14 11:04:08 +02:00
|
|
|
loadrc("wallpaper") -- wallpaper settings
|
|
|
|
loadrc("tags") -- tags handling
|
|
|
|
loadrc("widgets") -- widgets configuration
|
|
|
|
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)
|