0

a few days ago I began to hit Awesomewm and a doubt came to me to customize. By standard AWM comes with a unique configuration file called RC.Lua, I would like to separate my Key Bindings from separate files.

Example: Keybindings/keys1.Lua Keybindings/keys2.Lua.

Besides that I would like to know the difference between clientkeys and globalkeys?

I was successful dividing the files, but one keys configuration file always excelled the other

Exemple:

keys1.lua

local beautiful = require("beautiful")
local hotkeys_popup = require("awful.hotkeys_popup")
local awful = require("awful")

------------------------------------------------
local my_table = awful.util.table or gears.table
------------------------------------------------


----------------------------------------------------
local config = require("config")
----------------------------------------------------

globalkeys = my_table.join(

-- modkey + enter = launch terminal
awful.key({modkey}, "Return", function()
    awful.spawn(terminal)
end, {
    description = "launch terminal",
    group = "awesome"
}))

keys2.lua

local beautiful = require("beautiful")
local hotkeys_popup = require("awful.hotkeys_popup")
local awful = require("awful")

------------------------------------------------
local my_table = awful.util.table or gears.table
------------------------------------------------


----------------------------------------------------
local config = require("config")
----------------------------------------------------

globalkeys = my_table.join(


-- modkey + "b" = launch browser
awful.key({modkey}, "b", function()
    awful.spawn(browser)
end, {
    description = "launch browser",
    group = "awesome"
}))

rc.lua

local keys1 = require("keys1")
local keys2 = require("keys2")

At this point the last place Keys surpass the first so ignoring the configuration made in the same

  • Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking. – Community Jan 20 '23 at 08:02

1 Answers1

0

In the git-master version of AwesomeWM, you get the awful.keyboard.append_client_keybindings and awful.keyboard.append_global_keybindings. You also get a "request::default_keybindings" signal on the client class.

Those APIs are designed for modular configs. Actually, you can cut and paste entire sections from the newer rc.lua into new files with minimal effort.