102 lines
2.0 KiB
Lua
Executable File
102 lines
2.0 KiB
Lua
Executable File
-- AwesomeWM core
|
|
gears = require("gears")
|
|
awful = require("awful")
|
|
naughty = require("naughty")
|
|
beautiful = require("beautiful")
|
|
menubar = require("menubar")
|
|
wibox = require("wibox")
|
|
configuration_dir = gears.filesystem.get_configuration_dir()
|
|
require("awful.autofocus")
|
|
|
|
|
|
-- A "relative require" hack. Does the same thing as `require,`
|
|
-- But takes a relative path.
|
|
-- Called with req_rel(..., "module")
|
|
function req_rel(ddd, modname)
|
|
local parent_folder = (ddd):match("(.-)[^%.]+$")
|
|
return require(parent_folder .. modname)
|
|
end
|
|
|
|
-- Quick debug function
|
|
debug_message = function(msg)
|
|
naughty.notify({title = "Debug message:", text = tostring(msg)})
|
|
end
|
|
|
|
-- These must be loaded in order.
|
|
-- Make sure you've created conf.lua!
|
|
conf = require("conf")
|
|
|
|
|
|
layoutmanager = require("desktop.layoutmanager")
|
|
layoutmanager.layouts = conf.layouts
|
|
|
|
bin = require("bin")
|
|
wrapper = require("wrapper")
|
|
|
|
|
|
beautiful.init(require("theme"))
|
|
|
|
|
|
|
|
-- Load key bindings
|
|
local binds = require("binds")
|
|
local keys = binds.keys
|
|
local buttons = binds.buttons
|
|
|
|
-- Load modules
|
|
modules = {}
|
|
for k, v in ipairs({
|
|
"mpc",
|
|
"ibus"
|
|
}) do
|
|
modules[v] = require("modules." .. v)
|
|
|
|
-- If module defines keybinds, load keybinds.
|
|
if (modules[v]["keybinds"] ~= nil) then
|
|
keys = gears.table.join(
|
|
keys,
|
|
modules[v]["keybinds"]
|
|
)
|
|
end
|
|
end
|
|
|
|
-- Run all module init methods
|
|
for _, mod in ipairs(modules) do
|
|
if (mod["init"] ~= nil) then
|
|
mod["init"]()
|
|
end
|
|
end
|
|
|
|
|
|
-- Finalize keys
|
|
root.keys(keys)
|
|
root.buttons(buttons)
|
|
|
|
desktop = require("desktop")
|
|
|
|
|
|
|
|
-- Autostart
|
|
for i, v in ipairs(conf.startup_commands) do
|
|
awful.spawn(v)
|
|
end
|
|
|
|
|
|
-- Enable hotkeys help widget for VIM and other apps
|
|
-- when client with a matching name is opened:
|
|
--require("awful.hotkeys_popup.keys")
|
|
|
|
|
|
-- Check for errors
|
|
dofile(configuration_dir .. "errors.lua")
|
|
|
|
|
|
terminal = conf.terminal
|
|
menubar.utils.terminal = terminal
|
|
|
|
|
|
-- Load client methods
|
|
awful.rules.rules = require("clients.rules")
|
|
dofile(configuration_dir .. "clients/signals.lua")
|
|
require("clients.render")
|