diff --git a/README.md b/README.md index 19b3657..77a41d1 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 0000000..e69de29 diff --git a/doc/wezterm-types.txt b/doc/wezterm-types.txt index 0c2e222..a4a0730 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 09 +*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 diff --git a/docs/README.md b/docs/README.md index ac1c097..e93b8c8 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 0000000..14931dc --- /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 0000000..321e9b0 --- /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: