Simple plugin for awesomewm that works as a simple way to create keyboard shortcuts without having to edit your rc.lua
file. Originally made this so I could remove sxhkd from my setup, but I thought I'd clean it up a bit and make it an actual repo.
Download the source code and move it into the same directory as your rc.lua
. Next, copy the shortcuts.json
file into the same directory as your rc.lua
file.
$ cp awesome-shortcut-lua/ext/shortcuts.json .
Your file structure should look something like this.
/awesome-shortcut-lua
/src
...
/lib
...
/ext
...
awesome-shortcut.lua
rc.lua
shortcuts.json
Next you'll want to configure your shortcuts.json
. For reference on how to do this, read ext/shortcuts.md
. Finally, you need to require awesome-shortcut-lua/awesome-shortcut.lua
in your rc.lua
file. This can vary between setups, but the basic idea is to require
the module and call it with root.keys
.
root.keys(
require("awesome-shortcut-json.awesome-shortcut")
)
If you already have shortcuts you don't want to overwrite you can also combine them.
root.keys(gears.table.join(
require("awesome-shortcut-json.awesome-shortcut"),
globalkeys -- or whatever you have this named as
))
Finally, you need to edit awesome-shortcut.lua
. Set the shortcuts.json
path to any location you want. Don't use a relative path.
AWESOME_SHORTPATH = "/home/USERNAME/.config/awesome/shortcuts.json"
And that's it! Just reload awesome and the shortcuts should load. If shortcuts.json
has any errors like an unset value you will get a warning notification. If you want to change the default modkey or change the directory of the shortcuts.json
file, edit awesome-shortcut.lua
.
rxi/log.lua
doesn't exist on luarocks so it has been installed in the /lib
directory.