mirror of
https://github.com/wez/wezterm.git
synced 2024-11-23 15:04:36 +03:00
e4ae8a844d
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.
40 lines
1.2 KiB
TOML
40 lines
1.2 KiB
TOML
[package]
|
|
name = "env-bootstrap"
|
|
version = "0.1.0"
|
|
authors = ["Wez Furlong <wez@wezfurlong.org>"]
|
|
edition = "2018"
|
|
|
|
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
|
|
|
[dependencies]
|
|
backtrace = "0.3"
|
|
chrono = {version="0.4", features=["unstable-locales"]}
|
|
config = { path = "../config" }
|
|
dirs-next = "2.0"
|
|
lazy_static = "1.4"
|
|
libc = "0.2"
|
|
log = "0.4"
|
|
env_logger = "0.10"
|
|
termwiz = { path = "../termwiz" }
|
|
battery = { path = "../lua-api-crates/battery" }
|
|
color-funcs = { path = "../lua-api-crates/color-funcs" }
|
|
termwiz-funcs = { path = "../lua-api-crates/termwiz-funcs" }
|
|
logging = { path = "../lua-api-crates/logging" }
|
|
mux-lua = { path = "../lua-api-crates/mux" }
|
|
procinfo-funcs = { path = "../lua-api-crates/procinfo-funcs" }
|
|
filesystem = { path = "../lua-api-crates/filesystem" }
|
|
json = { path = "../lua-api-crates/json" }
|
|
plugin = { path = "../lua-api-crates/plugin" }
|
|
share-data = { path = "../lua-api-crates/share-data" }
|
|
ssh-funcs = { path = "../lua-api-crates/ssh-funcs" }
|
|
spawn-funcs = { path = "../lua-api-crates/spawn-funcs" }
|
|
time-funcs = { path = "../lua-api-crates/time-funcs" }
|
|
|
|
[target."cfg(windows)".dependencies]
|
|
winapi = "0.3"
|
|
|
|
[target.'cfg(target_os = "macos")'.dependencies]
|
|
cocoa = "0.20"
|
|
objc = "0.2"
|
|
|