-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
/
Copy pathneofetch.ts
534 lines (527 loc) · 11.7 KB
/
neofetch.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
const infoLines = {
name: "Information lines",
suggestions: [
"os",
"host",
"kernel",
"uptime",
"packages",
"shell",
"term",
"cpu",
"gpu",
"memory",
"disk",
"battery",
"resolution",
"wm",
"de",
"theme",
"wm_theme",
"icons",
],
};
const onOff: Fig.Arg = {
name: "on/off",
suggestions: ["on", "off"],
};
const onOffTiny: Fig.Arg = {
name: "on/off",
suggestions: ["on", "off", "tiny"],
};
const anyNum = "[0-9]+";
const num: Fig.Arg = {
name: anyNum,
};
const bar: Fig.Arg = {
name: "mode",
suggestions: ["bar", "infobar", "barinfo", "off"],
};
const completionSpec: Fig.Spec = {
name: "neofetch",
description: "The most complete system information CLI tool",
args: { ...infoLines, isVariadic: true },
options: [
{
name: ["--help", "-h"],
description: "Show help for neofetch",
},
{
name: "--disable",
description: "Disable information line",
args: infoLines,
},
{
name: "--title_fqdn",
description: "Hide/Show Fully Qualified Domain Name in title",
args: onOff,
},
{
name: "--package_managers",
description: "Hide/Show Package Manager names",
args: onOffTiny,
},
{
name: "--os_arch",
description: "Hide/Show OS architecture",
args: onOff,
},
{
name: "--speed_type",
description: "Change the type of cpu speed to display",
args: {
name: "type",
suggestions: [
"current",
"min",
"bios",
"scaling_current",
"scaling_min",
"scaling_max",
],
},
},
{
name: "--speed_shorthand",
description: "Whether or not to show decimals in CPU speed",
args: onOff,
},
{
name: "--cpu_brand",
description: "Enable/Disable CPU brand in output",
args: onOff,
},
{
name: "--cpu_cores",
description: "Whether or not to display the number of CPU cores",
args: {
name: "type",
suggestions: ["logical", "physical", "off"],
},
},
{
name: "--cpu_speed",
description: "Hide/Show cpu speed",
args: onOff,
},
{
name: "--cpu_temp",
description: "Hide/Show cpu temperature",
args: {
name: "unit/off",
suggestions: ["C", "F", "off"],
},
},
{
name: "--distro_shorthand",
description: "Shorten the output of distro",
args: onOffTiny,
},
{
name: "--kernel_shorthand",
description: "Shorten the output of kernel",
args: onOff,
},
{
name: "--uptime_shorthand",
description: "Shorten the output of uptime",
args: onOffTiny,
},
{
name: "--refresh_rate",
description: "Whether to display the refresh rate of each monitor",
args: onOff,
},
{
name: "--gpu_brand",
description: "Enable/Disable GPU brand in output",
args: onOff,
},
{
name: "--gpu_type",
description: "Which GPU to display",
args: {
name: "type",
suggestions: ["all", "dedicated", "integrated"],
},
},
{
name: "--de_version",
description: "Show/Hide Desktop Environment version",
args: onOff,
},
{
name: "--gtk_shorthand",
description: "Shorten output of gtk theme/icons",
args: onOff,
},
{
name: "--gtk2",
description: "Enable/Disable gtk2 theme/font/icons output",
args: onOff,
},
{
name: "--gtk3",
description: "Enable/Disable gtk3 theme/font/icons output",
args: onOff,
},
{
name: "--shell_path",
description: "Enable/Disable showing $SHELL path",
args: onOff,
},
{
name: "--shell_version",
description: "Enable/Disable showing $SHELL version",
args: onOff,
},
{
name: "--disk_show",
description: "Which disks to display",
args: {
name: "disk",
suggestions: [
"/dev/sd",
"/dev/nvme",
"/dev/mmcblk",
"/dev/mapper",
"/mnt",
"/run/media",
],
},
// todo write function to get block devices and current mountpoints
},
{
name: "--disk_subtitle",
description: "What information to append to the Disk subtitle",
args: {
name: "type",
suggestions: ["name", "mount", "dir", "none"],
},
},
{
name: "--disk_percent",
description: "Hide/Show disk percent",
args: onOff,
},
{
name: "--ip_host",
description: "URL to query for public IP",
args: { name: "https://..." },
},
{
name: "--ip_timeout",
description: "Public IP timeout",
args: { name: "X seconds" },
},
{
name: "--memory_percent",
description: "Display memory percentage",
args: onOff,
},
{
name: "--memory_unit",
description: "Memory output unit",
args: {
name: "unit",
suggestions: ["kib", "mib", "gib"],
},
},
{
name: "--colors",
description: "Changes the text colors",
args: [
{ name: "Title" },
{ name: "@" },
{ name: "Underline" },
{ name: "Subtitle" },
{ name: "Colon" },
{ name: "Info" },
],
},
{
name: "--underline",
description: "Enable/Disable the underline",
args: onOff,
},
{
name: "--underline_char",
description: "Character to use when underlining title",
args: { name: "char" },
},
{
name: "--bold",
description: "Enable/Disable bold text",
args: onOff,
},
{
name: "--separator",
description: "Changes the default ':' separator to the specified string",
args: { name: "string" },
},
{
name: "--color_blocks",
description: "Enable/Disable the color blocks",
args: onOff,
},
{
name: "--col_offset",
description: "Left-padding of color blocks",
args: {
name: "number",
suggestions: ["auto", anyNum],
},
},
{
name: "--block_width",
description: "Width of color blocks in spaces",
args: num,
},
{
name: "--block_height",
description: "Height of color blocks in lines",
args: num,
},
{
name: "--block_range",
description: "Range of colors to print as blocks",
args: [num, num],
},
{
name: "--bar_char",
description: "Characters to use when drawing bars",
args: [{ name: "Elapsed char" }, { name: "Total char" }],
},
{
name: "--bar_border",
description: "Whether or not to surround the bar with '[]'",
args: onOff,
},
{
name: "--bar_length",
description: "Length in spaces to make the bars",
args: num,
},
{
name: "--bar_colors",
description: "Colors to make the bar",
args: [{ name: "Elapsed" }, { name: "Total" }],
},
{
name: "--cpu_display",
description: "CPU bar mode",
args: bar,
},
{
name: "--memory_display",
description: "Memory display mode",
args: bar,
},
{
name: "--battery_display",
description: "Battery display mode",
args: bar,
},
{
name: "--disk_display",
description: "Disk display mode",
args: bar,
},
{
name: "--backend",
description: "Which image backend to use",
args: {
name: "backend",
suggestions: [
"ascii",
"caca",
"chafa",
"jp2a",
"iterm2",
"off",
"pixterm",
"pot",
"sixel",
"termpix",
"tycat",
"w3m",
"kitty",
],
},
},
{
name: "--source",
description: "Which image or ascii file to use",
args: {
name: "source",
suggestions: ["auto", "ascii", "wallpaper"],
template: "filepaths",
},
},
{
name: "--ascii",
description: "Same as --backend ascii",
},
{
name: "--caca",
description: "Same as --backend caca",
},
{
name: "--chafa",
description: "Same as --backend chafa",
},
{
name: "--iterm2",
description: "Same as --backend iterm2",
},
{
name: "--jp2a",
description: "Same as --backend jp2a",
},
{
name: "--kitty",
description: "Same as --backend kitty",
},
{
name: "--pot",
description: "Same as --backend pot",
},
{
name: "--pixterm",
description: "Same as --backend pixterm",
},
{
name: "--sixel",
description: "Same as --backend sixel",
},
{
name: "--termpix",
description: "Same as --backend termpix",
},
{
name: "--tycat",
description: "Same as --backend tycat",
},
{
name: "--w3m",
description: "Same as --backend w3m",
},
{
name: "--off",
description: "Same as --backend off",
},
{
name: "--ascii_colors",
description: "Colors to print the ascii art",
args: [
{ name: "Color 1" },
{ name: "Color 2" },
{ name: "Color 3" },
{ name: "Color 4" },
{ name: "Color 5" },
{ name: "Color 6" },
],
},
{
name: "--ascii_distro",
description: "Which Distro's ascii art to print",
args: { name: "OS" },
},
{
name: "--ascii_bold",
description: "Whether or not to bold the ascii logo",
args: onOff,
},
{
name: ["-L", "--logo"],
description: "Hide the info text and only show the ascii logo",
},
{
name: "--loop",
description: "Redraw the image constantly until Ctrl+C is used",
},
{
name: "--size",
description: "How to size the image",
args: {
name: "size",
suggestions: ["auto", anyNum + "px", anyNum + "%"],
},
},
{
name: "--crop_mode",
description: "Which crop mode to use",
args: {
name: "mode",
suggestions: ["normal", "fit", "fill"],
},
},
{
name: "--crop_offset",
description: "Change the crop offset for normal mode",
args: {
name: "offset",
suggestions: ["northwest", "north", "northeast"],
},
},
{
name: "--xoffset",
description:
"How close the image will be to the left edge of the window. This only works with w3m",
args: num,
},
{
name: "--yoffset",
description:
"How close the image will be to the top edge of the window. This only works with w3m",
args: num,
},
{
name: "--gap",
description: "Gap between image and text",
args: num,
},
{
name: "--clean",
description: "Delete cached files and thumbnails",
},
{
name: "--config",
description: "Specify a path to a custom config file",
args: {
name: "file/none",
suggestions: ["none"],
template: "filepaths",
},
},
{
name: "--no_config",
description: "Don't create the user config file",
},
{
name: "--print_config",
description: "Print the default config file to stdout",
},
{
name: "--stdout",
description: "Turn off all colors and disables any ASCII/image backend",
},
{
name: "--version",
description: "Show neofetch version",
},
{
name: "-v",
description: "Display error messages",
},
{
name: "-vv",
description: "Display a verbose log for error reporting",
},
{
name: "--gen-man",
description: "Generate a manpage for neofetch in your PWD",
},
],
};
export default completionSpec;