awesomewm/rc.lua

104 lines
2.0 KiB
Lua
Raw Normal View History

-- AwesomeWM core
2021-08-01 07:24:26 -07:00
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
2021-08-01 07:24:26 -07:00
-- 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")
2021-08-01 07:24:26 -07:00
2021-08-01 08:13:53 -07:00
layoutmanager = require("desktop.layoutmanager")
2021-08-01 07:24:26 -07:00
layoutmanager.layouts = conf.layouts
bin = require("bin")
wrapper = require("wrapper")
2021-08-01 07:24:26 -07:00
beautiful.init(require("theme"))
2022-07-16 15:47:42 -07:00
Sound = require("sound")
-- Load key bindings
local binds = require("binds")
local keys = binds.keys
local buttons = binds.buttons
-- Load modules
modules = {}
for k, v in ipairs({
"mpc",
2022-07-16 15:44:14 -07:00
"ibus",
"volume"
}) 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)
2021-08-01 07:24:26 -07:00
desktop = require("desktop")
2022-06-14 07:52:02 -07:00
-- Autostart
for i, v in ipairs(conf.startup_commands) do
awful.spawn(v)
end
2021-08-01 07:24:26 -07:00
-- 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")