awesomerc/init.lua

147 lines
3.9 KiB
Lua
Raw Normal View History

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