1
1
mirror of https://github.com/wez/wezterm.git synced 2024-10-27 08:09:45 +03:00
wezterm/lua-api-crates
Wez Furlong e4ae8a844d
Add wezterm.plugin module, allows loading modules from git
Brief usage notes here:

```lua
local wezterm = require 'wezterm'
local a_plugin = wezterm.plugin.require "https://github.com/owner/repo"

local config = wezterm.config_builder()

a_plugin.apply_to_config(config)

return config
```

The referenced repo is expected to have a `plugin/init.lua` file,
and by convention, return a module that exports an `apply_to_config`
function that accepts at least a config builder parameter, but may
pass other parameters, or a lua table with a `config` field that maps
to a config build parameter.

`wezterm.plugin.require` will clone the repo if it doesn't already
exist and store it in the runtime dir under `plugins/NAME` where
`NAME` is derived from the repo URL.  Once cloned, the repo is
NOT automatically updated.

Only HTTP (or local filesystem) repos are allowed for the git URL;
we cannot currently use ssh for this due to conflicting version
requirements that I'll take a look at later.

`wezterm.plugin.require` will then perform `require "NAME"`,
and since the default `package.path` now includes the appropriate
location from the runtime dir, the module should load.

Two other functions are available:

`wezterm.plugin.list()` will list the plugin repos.

`wezterm.plugin.update_all()` will attempt to fast-forward or `pull
--rebase` each of the repos it finds. It doesn't currently do anything
proactive to reload the configuration afterwards; the user will need to
do that themselves.
2023-01-31 20:07:42 -07:00
..
battery config: split out lua functions into their own crates 2022-05-19 06:48:09 -07:00
color-funcs colors: add base16 indexed colors 16-21 like base16-shell sets 2022-09-08 06:51:01 -07:00
filesystem Fix compiler warning 2022-11-05 09:05:35 -07:00
json json: fix visited hash set 2022-07-25 07:25:41 -07:00
logging config: split out lua functions into their own crates 2022-05-19 06:48:09 -07:00
mux lua: add some more tab methods 2023-01-20 20:02:29 -07:00
plugin Add wezterm.plugin module, allows loading modules from git 2023-01-31 20:07:42 -07:00
procinfo-funcs lua: add wezterm.procinfo module 2022-07-16 08:49:58 -07:00
share-data wezterm.GLOBAL now returns references to stored data 2023-01-24 18:26:14 -07:00
spawn-funcs ensure that we spawn open calls on a background thread 2022-07-11 08:03:37 -07:00
ssh-funcs config: split out lua functions into their own crates 2022-05-19 06:48:09 -07:00
termwiz-funcs deps: upgrade finl_unicode to 1.2 2022-10-23 12:07:00 -07:00
time-funcs lua: add wezterm.time.call_after and wezterm.reload_configuration 2022-07-18 07:37:41 -07:00
window-funcs macos: report max_fps in ScreenInfo 2022-08-19 21:02:51 -07:00
README.md config: split out lua functions into their own crates 2022-05-19 06:48:09 -07:00

The crates in this directory provide modules and functions to wezterm's lua config file and interface.

They are registered into the lua config via env-bootstrap.

It is advantageous to build times to have multiple, smaller, crates.