From c37579099d5df91447a2fca11ca0ca5a4531138d Mon Sep 17 00:00:00 2001 From: Guennadi Maximov C Date: Tue, 23 Jun 2026 01:28:03 -0600 Subject: [PATCH 1/2] feat(widgets.wez): add type annotations Signed-off-by: Guennadi Maximov C --- README.md | 1 + doc/wezterm-types-plugin.widgets.txt | 0 docs/README.md | 1 + docs/widgets.md | 11 +++ lua/wezterm/types/plugins/widgets.lua | 110 ++++++++++++++++++++++++++ 5 files changed, 123 insertions(+) create mode 100644 doc/wezterm-types-plugin.widgets.txt create mode 100644 docs/widgets.md create mode 100644 lua/wezterm/types/plugins/widgets.lua diff --git a/README.md b/README.md index 19b36574..77a41d16 100644 --- a/README.md +++ b/README.md @@ -114,6 +114,7 @@ This project also features type annotations for various WezTerm plugins. | [wezterm-sync](https://github.com/dfsramos/wezterm-sync) | [Documentation](docs/sync.md) | [Neovim Helpdoc](doc/wezterm-types-plugin.sync.txt) | | [wezterm-tabs](https://github.com/yriveiro/wezterm-tabs) | [Documentation](docs/wezterm-tabs.md) | [Neovim Helpdoc](doc/wezterm-types-plugin.wezterm-tabs.txt) | | [wezterm-theme-rotator](https://github.com/koh-sh/wezterm-theme-rotator) | [Documentation](docs/wezterm-theme-rotator.md) | [Neovim Helpdoc](doc/wezterm-types-plugin.wezterm-theme-rotator.txt) | +| [widgets.wez](https://github.com/usrivastava92/widgets.wez) | [Documentation](docs/widgets.md) | [Neovim Helpdoc](doc/wezterm-types-plugin.widgets.txt) | | [workspace-picker.wezterm](https://github.com/isseii10/workspace-picker.wezterm) | [Documentation](docs/workspace-picker.md) | [Neovim Helpdoc](doc/wezterm-types-plugin.workspace-picker.txt) | | [workspacesionizer.wezterm](https://github.com/vieitesss/workspacesionizer.wezterm) | [Documentation](docs/workspacesionizer.md) | [Neovim Helpdoc](doc/wezterm-types-plugin.workspacesionizer.txt) | | [wsinit.wezterm](https://github.com/JuanraCM/wsinit.wezterm) | [Documentation](docs/wsinit.md) | [Neovim Helpdoc](doc/wezterm-types-plugin.wsinit.txt) | diff --git a/doc/wezterm-types-plugin.widgets.txt b/doc/wezterm-types-plugin.widgets.txt new file mode 100644 index 00000000..e69de29b diff --git a/docs/README.md b/docs/README.md index ac1c0979..e93b8c8d 100644 --- a/docs/README.md +++ b/docs/README.md @@ -50,6 +50,7 @@ We will keep adding more community plugins as we find them. - [wezterm-sync](./sync.md) - [wezterm-tabs](./wezterm-tabs.md) - [wezterm-theme-rotator](./wezterm-theme-rotator.md) +- [widgets.wez](./widgets.md) - [workspace-picker.wezterm](./workspace-picker.md) - [workspacesionizer.wezterm](./workspacesionizer.md) - [wsinit.wezterm](./wsinit.md) diff --git a/docs/widgets.md b/docs/widgets.md new file mode 100644 index 00000000..14931dc0 --- /dev/null +++ b/docs/widgets.md @@ -0,0 +1,11 @@ +### `widgets.wez` + +You can import type annotations for +[`usrivastava92/widgets.wez`](https://github.com/usrivastava92/widgets.wez) as shown below: + +```lua +---@type Widgets +local sys = wezterm.plugin.require("https://github.com/usrivastava92/widgets.wez") +``` + + diff --git a/lua/wezterm/types/plugins/widgets.lua b/lua/wezterm/types/plugins/widgets.lua new file mode 100644 index 00000000..321e9b08 --- /dev/null +++ b/lua/wezterm/types/plugins/widgets.lua @@ -0,0 +1,110 @@ +---@meta +---@diagnostic disable:unused-local + +---@class Widgets.WidgetOpts +---@field color? string +---@field icon? string|false +---@field throttle? integer + +---@class WidgetsOpts +---@field left? Widgets.Widget[] +---@field right? Widgets.Widget[] +---@field separator? { text?: string, color?: string } + +---@class Widgets.Battery +---@field charge Widgets.Battery.Charge + +---@class Widgets.CPU +---@field utilization Widgets.CPU.Utilization + +---@class Widgets.Disk +---@field read Widgets.Disk.Read +---@field space Widgets.Disk.Space +---@field write Widgets.Disk.Write + +---@class Widgets.Network +---@field download Widgets.Network.Download +---@field upload Widgets.Network.Upload + +---@class Widgets.RAM +---@field utilization Widgets.RAM.Utilization + +---@class Widgets.CPU.Utilization +local U = {} + +---@param opts? WidgetsOpts +---@return Widgets.Widget widget +function U.widget(opts) end + +---@class Widgets.Battery.Charge +local C = {} + +---@param opts? WidgetsOpts +---@return Widgets.Widget widget +function C.widget(opts) end + +---@class Widgets.Disk.Read +local R = {} + +---@param opts? WidgetsOpts +---@return Widgets.Widget widget +function R.widget(opts) end + +---@class Widgets.Disk.Space +local S = {} + +---@param opts? WidgetsOpts +---@return Widgets.Widget widget +function S.widget(opts) end + +---@class Widgets.Disk.Write +local Write = {} + +---@param opts? WidgetsOpts +---@return Widgets.Widget widget +function Write.widget(opts) end + +---@class Widgets.Network.Download +local D = {} + +---@param opts? WidgetsOpts +---@return Widgets.Widget widget +function D.widget(opts) end + +---@class Widgets.RAM.Utilization +local RU = {} + +---@param opts? WidgetsOpts +---@return Widgets.Widget widget +function RU.widget(opts) end + +---@class Widgets.Network.Upload +local Upload = {} + +---@param opts? WidgetsOpts +---@return Widgets.Widget widget +function Upload.widget(opts) end + +---@class Widgets.Widget +---@field opts Widgets.WidgetOpts +local W = {} + +---@return string formatted +function W.get_text() end + +---@return { [1]: { Foreground: string }, [2]: { Text: string } } +function W.get_formatted() end + +---@class Widgets +---@field battery Widgets.Battery +---@field cpu Widgets.CPU +---@field disk Widgets.Disk +---@field network Widgets.Network +---@field ram Widgets.RAM +local M = {} + +---@param config Config +---@param opts WidgetsOpts +function M.apply_to_config(config, opts) end + +-- vim: set ts=2 sts=2 sw=2 et ai si sta: From 200ab4284c9469d771cea86fae88b1f08e3859ef Mon Sep 17 00:00:00 2001 From: DrKJeff16 <72052712+DrKJeff16@users.noreply.github.com> Date: Tue, 23 Jun 2026 07:28:50 +0000 Subject: [PATCH 2/2] docs: auto generate docs --- doc/wezterm-types.txt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/doc/wezterm-types.txt b/doc/wezterm-types.txt index 86bd956e..a4a07302 100644 --- a/doc/wezterm-types.txt +++ b/doc/wezterm-types.txt @@ -1,4 +1,4 @@ -*wezterm-types.txt* For NVIM >=v0.7.0 Last change: 2026 June 01 +*wezterm-types.txt* For NVIM >=v0.7.0 Last change: 2026 June 23 ============================================================================== 1. wezterm-types *wezterm-types-wezterm-types* @@ -169,6 +169,8 @@ This project also features type annotations for various WezTerm plugins. wezterm-theme-rotator Documentation Neovim Helpdoc + widgets.wez Documentation Neovim Helpdoc + workspace-picker.wezterm Documentation Neovim Helpdoc workspacesionizer.wezterm Documentation Neovim Helpdoc