You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/docs/customwidgets.mdx
+58-2Lines changed: 58 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -109,9 +109,65 @@ The `WidgetConfigType` takes the usual options common to all widgets. The `MetaT
109
109
| "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. |
110
110
| "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. |
111
111
112
-
## Example Terminal Widgets
112
+
## Example Shell Widgets
113
113
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 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.
115
171
116
172
Suppose I want a widget that will run speedtest-go when opened. Then, I can define a widget as
0 commit comments