awesomerc/init.lua

154 lines
4.1 KiB
Lua

-- awesome_mode: api-level=4:screen=on
if os.getenv "LOCAL_LUA_DEBUGGER_VSCODE" == "1" then
require("lldebugger").start()
end
-- If LuaRocks is installed, make sure that packages installed through it are
-- found (e.g. lgi). If LuaRocks is not installed, do nothing.
pcall(require, "luarocks.loader")
local gtimer = require "gears.timer"
local legacy = require "awesome-legacy"
local naughty = require "naughty"
local ruled = require "ruled"
local slot = require "awesome-slot"
-- Load global awesome components from the C API
local capi = {
client = _G.client,
screen = _G.screen,
tag = _G.tag,
}
-- Beautiful needs to be initialized as soon as possible to make theme
-- variables available to the configuration module.
legacy.beautiful {
base = "default",
theme = require "rc.theme",
}
legacy.manage_error()
legacy.autofocus()
legacy.sloppy_focus()
local configuration = require "rc.configuration"
local my_slots = require "rc.slots"
-- This needs to be run after awesome has completed C API initialization and
-- the `root` object is available.
gtimer.delayed_call(function()
legacy.global_mouse_bindings(configuration.bindings.global_mousebindings)
legacy.global_keybindings(configuration.bindings.global_keybindings)
end)
-- luacheck: ignore unused variable load_wallpaper
local load_wallpaper = slot {
id = "LOAD_WALLPAPER",
connect = true,
target = capi.screen,
signal = "request::wallpaper",
slot = my_slots.wallpaper,
}
-- luacheck: ignore unused variable default_layout
local default_layout = slot {
id = "DEFAULT_LAYOUTS",
connect = true,
target = capi.tag,
signal = "request::default_layouts",
slot = slot.slots.tag.default_layouts,
slot_params = {
layouts = configuration.tag_layouts,
},
}
-- luacheck: ignore unused variable create_tag
local create_tag = slot {
id = "CREATE_TAGS",
connect = true,
target = capi.screen,
signal = "request::desktop_decoration",
slot = my_slots.create_tags,
}
-- luacheck: ignore unused variable desktop_decoration
local desktop_decoration = slot {
id = "DESKTOP_DECORATION",
connect = true,
target = capi.screen,
signal = "request::desktop_decoration",
slot = my_slots.build_desktop_decoration,
}
-- luacheck: ignore unused variable client_mousebinding
local client_mousebinding = slot {
id = "CLIENT_MOUSE_BINDINGS",
connect = true,
target = capi.client,
signal = "request::default_mousebindings",
slot = slot.slots.client.append_mousebindings,
slot_params = {
mousebindings = configuration.bindings.client_mousebindings,
},
}
-- luacheck: ignore unused variable client_keybinding
local client_keybinding = slot {
id = "CLIENT_KEY_BINDINGS",
connect = true,
target = capi.client,
signal = "request::default_keybindings",
slot = slot.slots.client.append_keybindings,
slot_params = {
keybindings = configuration.bindings.client_keybindings,
},
}
-- luacheck: ignore unused variable ruled_client
local ruled_client = slot {
id = "RULED_CLIENT",
connect = true,
target = ruled.client,
signal = "request::rules",
slot = slot.slots.ruled.append_client_rules,
slot_params = {
rules = configuration.rules.client,
},
}
-- luacheck: ignore unused variable client_titlebar
local client_titlebar = slot {
id = "CLIENT_TITLEBAR",
connect = true,
target = capi.client,
signal = "request::titlebars",
slot = my_slots.build_client_titlebars,
}
-- luacheck: ignore unused variable ruled_notification
local ruled_notification = slot {
id = "RULED_NOTIFICATION",
connect = true,
target = ruled.notification,
signal = "request::rules",
slot = slot.slots.ruled.append_notification_rules,
slot_params = {
rules = configuration.rules.notification,
},
}
-- luacheck: ignore unused variable naughty_display
local naughty_display = slot {
id = "NAUGHTY_DISPLAY",
connect = true,
target = naughty,
signal = "request::display",
slot = my_slots.naughty_display,
}
naughty.notify {
title = "Aire-One dots",
message = "You successfully ran the Aire-One default rc!",
}