Skip to content

Commit 1eee9fc

Browse files
committed
fix(launcher): Better descriptions and examples in help plugin
1 parent 501bbba commit 1eee9fc

File tree

6 files changed

+18
-9
lines changed

6 files changed

+18
-9
lines changed

src/launcher_plugins.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,7 @@ export namespace Plugin {
125125
exec: string
126126
icon: string
127127
fill?: string
128+
examples?: string
128129
}
129130

130131
export function read(file: string): Config | null {

src/plugin_help.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,14 @@ export class ShellBuiltin extends plugins.Builtin {
1717

1818
for (const [name, service] of ext.window_search.service.plugins) {
1919
if (service.config.pattern?.length > 0) {
20+
const example = service.config.examples
21+
? service.config.examples
22+
: service.config.pattern;
23+
2024
this.selections.push({
2125
id,
2226
name,
23-
description: service.config.description + `: ${service.config.pattern}`,
27+
description: service.config.description + `: ${example}`,
2428
fill: service.config.fill
2529
})
2630
id += 1;

src/plugins/calc/meta.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
{
22
"name": "Calculator",
3-
"description": "Perform calculations from terminal",
3+
"description": "Math.JS calculations",
44
"pattern": "^(=)+",
55
"exec": "main.js",
66
"icon": "x-office-spreadsheet",
7-
"fill": "="
7+
"fill": "=",
8+
"examples": "=5+5, =2 liters in quarts"
89
}

src/plugins/files/meta.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
{
2-
"name": "File Search",
3-
"description": "Searches files in the file system",
2+
"name": "File Navigation",
3+
"description": "Navigate the file system with tab auto-completion",
44
"pattern": "^(\/|~).*",
55
"exec": "main.js",
66
"icon": "system-file-manager",
7-
"fill": "~/"
7+
"fill": "~/",
8+
"examples": "~/Documents, /mnt/media/Videos"
89
}

src/plugins/terminal/meta.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,6 @@
44
"pattern": "^(:|t:|run ).*",
55
"exec": "main.js",
66
"icon": "utilities-terminal",
7-
"fill": "run "
7+
"fill": "run ",
8+
"examples": "run cmd, t:cmd, t cmd"
89
}

src/plugins/web/meta.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
{
22
"name": "Web Search",
3-
"description": "Searches",
3+
"description": "Site-specific web search",
44
"pattern": "^(amazon|wiki|bing|ddg|google|yt|stack|crates|arch|pp|ppw|rdt|bc|lib|npm|gist|fh|gh|dev|sdcl|twitch|yh|alie)\\s.*",
55
"exec": "main.js",
66
"icon": "system-search",
7-
"fill": "ddg "
7+
"fill": "ddg ",
8+
"examples": "ddg search, yt video, amazon product"
89
}

0 commit comments

Comments
 (0)