awesome-ez/README.md

70 lines
1.4 KiB
Markdown
Raw Permalink Normal View History

2019-05-23 16:49:35 +02:00
# awesome-ez
awesome-ez is a library for [Awesome](https://github.com/awesomeWM/awesome)
window manager that aims to simplify the creation of key and button bindings.
It is based on code from the old Awesome wiki.
2019-07-04 23:35:22 +02:00
## Installation
2022-09-02 21:30:48 +02:00
Install the latest stable release with `luarocks`:
```sh
luarocks install awesome-ez
2019-07-04 23:35:22 +02:00
```
2019-05-23 16:49:35 +02:00
## Usage
Require the library:
2022-09-02 21:05:42 +02:00
2019-05-23 16:49:35 +02:00
```lua
local ez = require("awesome-ez")
```
Use `ez.keytable` to define key bindings:
2022-09-02 21:05:42 +02:00
2019-05-23 16:49:35 +02:00
```lua
local globalkeys = ez.keytable {
2020-07-23 21:03:12 +02:00
["M-Return"] = {awful.spawn, "xterm"},
2019-05-23 16:49:35 +02:00
...
}
```
Use `ez.btntable` to define button bindings:
2022-09-02 21:05:42 +02:00
2019-05-23 16:49:35 +02:00
```lua
local clientbtns = ez.btntable {
["1"] = function (c) client.focus = c end,
["M-1"] = awful.mouse.client.move,
["M-3"] = awful.mouse.client.resize,
}
```
Binding definition strings consist of modifier characters and a key or button
separated by hyphens, e.g. `M-S-x` is the combination of `Mod4`, `Shift`, and
the `x` key.
2019-05-23 16:59:49 +02:00
See the [API documentation](https://jcrd.github.io/awesome-ez/) for
descriptions of all functions.
2019-05-23 16:49:35 +02:00
### Modifiers
2022-09-02 21:05:42 +02:00
The following modifiers can be identified by their default shorthand characters
2019-05-23 16:49:35 +02:00
in key and button definitions:
2022-09-02 21:05:42 +02:00
Character | Modifier
--------- | --------
M | Mod4
A | Mod1
S | Shift
C | Control
The `modifiers` table can be customized:
```lua
ez.modifiers["M"] = "Mod1"
```
2019-05-23 16:49:35 +02:00
## License
2020-09-16 19:32:13 +02:00
This project is licensed under the MIT License (see [LICENSE](LICENSE)).