https://github.com/michaelbeaumont/awesome-leader
Leader key for Awesome WM
https://github.com/michaelbeaumont/awesome-leader
List: awesome-leader
Last synced: about 1 month ago
JSON representation
Leader key for Awesome WM
- Host: GitHub
- URL: https://github.com/michaelbeaumont/awesome-leader
- Owner: michaelbeaumont
- License: mit
- Created: 2015-01-09T20:33:56.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2021-02-08T09:15:38.000Z (over 4 years ago)
- Last Synced: 2025-04-15T16:01:57.267Z (2 months ago)
- Language: Lua
- Size: 16.6 KB
- Stars: 17
- Watchers: 4
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# awesome-leader
This module lets you string together key combinations in awesome triggered by pressing a leader key. It should roughly emulate vim's behavior here. Count arguments before combinations are also supported.
Note: This version needs the latest awesome-git
## Instructions
```
local leader = require "awesome-leader"local tab_keys = leader.bind_actions({
{"t",
function(args)
awful.tag.add("new", {index=args.count})
end,
"New tag!"
},
})local rec_leader =
leader.wrap(
leader.repeat_count,
leader.bind({
{"t", tab_keys, "Tags"},
}))local root_leader = leader.leader(rec_leader)
awful.key({ modkey }, "z", root_leader)
```Use `bind_actions` to bind a list of simple Lua functions, keys and
descriptions. To build up more complicated bindings (in this example, to put
`tab_keys` behind the `t` key) use `bind`.With this config, we can press combinations like `2t2` to add 2 new tabs at index 2.
We also get nifty popups at each stage telling us what keys are available.The `wrap` and second `bind` call are just examples, we can leave them out and directly call
`leader.leader(tab_keys)`.