Skip to content

Commit 69bb1d4

Browse files
authored
Fish and Pwsh Examples (#1549)
This adds example widgets to the docs for fish and powershell core (pwsh)
1 parent dbc2be1 commit 69bb1d4

File tree

1 file changed

+58
-2
lines changed

1 file changed

+58
-2
lines changed

docs/docs/customwidgets.mdx

Lines changed: 58 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,9 +109,65 @@ The `WidgetConfigType` takes the usual options common to all widgets. The `MetaT
109109
| "term:localshellpath" | (optional) Sets the shell used for running your widget command. Only works locally. If left blank, wave will determine your system default instead. |
110110
| "term:localshellopts" | (optional) Sets the shell options meant to be used with `"term:localshellpath"`. This is useful if you are using a nonstandard shell and need to provide a specific option that we do not cover. Only works locally. Defaults to an empty string. |
111111

112-
## Example Terminal Widgets
112+
## Example Shell Widgets
113113

114-
Here are a few simple widgets to serve as examples.
114+
If you have multiple shells installed on your machine, there may be times when you want to use a non-default shell. For cases like this, it is easy to create a widget for each.
115+
116+
Suppose you want a widget to launch a `fish` shell. Once you have `fish` installed on your system, you can define a widget as
117+
118+
```json
119+
{
120+
<... other widgets go here ...>,
121+
"fish" : {
122+
"icon": "fish",
123+
"color": "#4abc39",
124+
"label": "fish",
125+
"blockdef": {
126+
"meta": {
127+
"view": "term",
128+
"controller": "shell",
129+
"term:localshellpath": "/usr/local/bin/fish",
130+
"term:localshellopts": "-i -l"
131+
}
132+
}
133+
},
134+
<... other widgets go here ...>
135+
}
136+
```
137+
138+
:::info
139+
It is very possible that `fish` is not in your path. In this case, using `"fish"` as the value of `"term:localshellpath"` will not work. In these cases, you will need to provide a direct path to it. This is often somewhere like `"/usr/local/bin/fish"`, but it may be different on your system.
140+
:::
141+
142+
If you want to do the same for something like Powershell Core, or `pwsh`, you can define the widget as
143+
144+
```json
145+
{
146+
<... other widgets go here ...>,
147+
"pwsh" : {
148+
"icon": "rectangle-terminal",
149+
"color": "#2671be",
150+
"label": "pwsh",
151+
"blockdef": {
152+
"meta": {
153+
"view": "term",
154+
"controller": "shell",
155+
"term:localshellpath": "pwsh"
156+
}
157+
}
158+
},
159+
<... other widgets go here ...>
160+
}
161+
```
162+
163+
:::info
164+
It is very possible that `pwsh` is not in your path. In this case, using `"pwsh"` as the value of `"term:localshellpath"` will not work. In these cases, you will need to provide a direct path to it. This could be somewhere like `"/usr/local/bin/pwsh"` on a Unix system or <code>"C:\\Program&nbsp;Files\\PowerShell\\7\\pwsh.exe"</code> on
165+
Windows. but it may be different on your system. Also note that both `pwsh.exe` and `pwsh` work on Windows, but only `pwsh` works on Unix systems.
166+
:::
167+
168+
## Example Cmd Widgets
169+
170+
Here are a few simple cmd widgets to serve as examples.
115171

116172
Suppose I want a widget that will run speedtest-go when opened. Then, I can define a widget as
117173

0 commit comments

Comments
 (0)