Skip to content

Commit c4b024e

Browse files
Update bash completion
1 parent e98c18a commit c4b024e

File tree

2 files changed

+147
-79
lines changed

2 files changed

+147
-79
lines changed

completions/bash

Lines changed: 146 additions & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -9,30 +9,38 @@ __fastfetch_complete_help()
99
"os-format"
1010
"host-format"
1111
"kernel-format"
12+
"uptime-format"
13+
"processes-format"
1214
"packages-format"
1315
"shell-format"
1416
"resolution-format"
1517
"de-format"
1618
"wm-format"
19+
"wm-theme-format"
1720
"theme-format"
1821
"icons-format"
1922
"font-format"
23+
"cursor-format"
2024
"terminal-format"
2125
"terminal-font-format"
2226
"cpu-format"
2327
"cpu-usage-format"
2428
"gpu-format"
2529
"memory-format"
30+
"swap-format"
2631
"disk-format"
2732
"battery-format"
2833
"locale-format"
2934
"local-ip-format"
3035
"public-ip-format"
36+
"player-format"
37+
"media-format"
3138
"datetime-format"
3239
"date-format"
3340
"time-format"
34-
"media-format"
35-
"player-format"
41+
"vulkan-format"
42+
"opengl-format"
43+
"opencl-format"
3644
)
3745
COMPREPLY=($(compgen -W "${__ff_helps[*]}" -- "$CURRENT_WORD"))
3846
}
@@ -59,13 +67,51 @@ __fastfetch_complete_logo()
5967
COMPREPLY=($(compgen -W "$(fastfetch --list-logos-autocompletion)" -- "$CURRENT_WORD"))
6068
}
6169

70+
__fastfetch_complete_logo_type()
71+
{
72+
local __ff_logo_types=(
73+
"auto"
74+
"builtin"
75+
"file"
76+
"raw"
77+
"sixel"
78+
"kitty"
79+
"chafa"
80+
)
81+
COMPREPLY=($(compgen -W "${__ff_logo_types[*]}" -- "$CURRENT_WORD"))
82+
}
83+
84+
__fastfetch_complete_binary_prefix()
85+
{
86+
local __ff_binary_prefixes=(
87+
"iec"
88+
"si"
89+
"jedec"
90+
)
91+
COMPREPLY=($(compgen -W "${__ff_binary_prefixes[*]}" -- "$CURRENT_WORD"))
92+
}
93+
94+
__fastfetch_complete_gl()
95+
{
96+
local __ff_gl_types=(
97+
"auto"
98+
"egl"
99+
"glx"
100+
"osmesa"
101+
)
102+
COMPREPLY=($(compgen -W "${__ff_gl_types[*]}" -- "$CURRENT_WORD"))
103+
}
104+
62105
__fastfetch_complete_option()
63106
{
64107
local FF_OPTIONS_ALL=(
65108
"${FF_OPTIONS_BOOL[@]}"
66109
"${FF_OPTIONS_STRING[@]}"
67110
"${FF_OPTIONS_PATH[@]}"
68111
"${FF_OPTIONS_LOGO[@]}"
112+
"${FF_OPTIONS_LOGO_TYPE[@]}"
113+
"${FF_OPTIONS_BINARY_PREFIX[@]}"
114+
"${FF_OPTIONS_GL[@]}"
69115
)
70116

71117
if [[ $WORD_COUND -lt 3 ]]; then
@@ -136,6 +182,7 @@ __fastfetch_completion()
136182
"--escape-bedrock"
137183
"--pipe"
138184
"--title-fqdn"
185+
"--escape-bedrock"
139186
)
140187

141188
local FF_OPTIONS_STRING=(
@@ -151,136 +198,141 @@ __fastfetch_completion()
151198
"--logo-color-6"
152199
"--logo-color-7"
153200
"--logo-color-8"
201+
"--logo-width"
202+
"--logo-height"
154203
"--logo-color-9"
155204
"-c"
156205
"--color"
206+
"--color-keys"
207+
"--color-title"
157208
"--separator"
158209
"-s"
159210
"--structure"
160211
"--set"
161212
"--set-keyless"
162-
"--gl"
163-
"--binary-prefix"
164-
"--os-format"
213+
"--player-name"
214+
"--public-ip-timeout"
165215
"--os-key"
166-
"--host-format"
216+
"--os-format"
217+
"--os-error"
167218
"--host-key"
168-
"--kernel-format"
219+
"--host-format"
220+
"--host-error"
169221
"--kernel-key"
170-
"--uptime-format"
222+
"--kernel-format"
223+
"--kernel-error"
171224
"--uptime-key"
172-
"--processes-format"
225+
"--uptime-format"
226+
"--uptime-error"
173227
"--processes-key"
174-
"--packages-format"
228+
"--processes-format"
229+
"--processes-error"
175230
"--packages-key"
176-
"--shell-format"
231+
"--packages-format"
232+
"--packages-error"
177233
"--shell-key"
178-
"--resolution-format"
234+
"--shell-format"
235+
"--shell-error"
179236
"--resolution-key"
180-
"--de-format"
237+
"--resolution-format"
238+
"--resolution-error"
181239
"--de-key"
182-
"--wm-format"
240+
"--de-format"
241+
"--de-error"
183242
"--wm-key"
184-
"--wm-theme-format"
243+
"--wm-format"
244+
"--wm-error"
185245
"--wm-theme-key"
186-
"--theme-format"
246+
"--wm-theme-format"
247+
"--wm-theme-error"
187248
"--theme-key"
188-
"--icons-format"
249+
"--theme-format"
250+
"--theme-error"
189251
"--icons-key"
190-
"--font-format"
252+
"--icons-format"
253+
"--icons-error"
191254
"--font-key"
192-
"--cursor-format"
255+
"--font-format"
256+
"--font-error"
193257
"--cursor-key"
194-
"--terminal-format"
258+
"--cursor-format"
259+
"--cursor-error"
195260
"--terminal-key"
196-
"--terminal-font-format"
261+
"--terminal-format"
262+
"--terminal-error"
197263
"--terminal-font-key"
198-
"--cpu-format"
264+
"--terminal-font-format"
265+
"--terminal-font-error"
199266
"--cpu-key"
200-
"--cpu-usage-format"
201-
"--cpu-usage-key"
202-
"--gpu-format"
267+
"--cpu-format"
268+
"--cpu-error"
269+
"--cpu-useage-key"
270+
"--cpu-useage-format"
271+
"--cpu-useage-error"
203272
"--gpu-key"
204-
"--memory-format"
273+
"--gpu-format"
274+
"--gpu-error"
205275
"--memory-key"
206-
"--disk-format"
276+
"--memory-format"
277+
"--memory-error"
278+
"--swap-key"
279+
"--swap-format"
280+
"--swap-error"
207281
"--disk-key"
208-
"--battery-format"
282+
"--disk-format"
283+
"--disk-error"
209284
"--battery-key"
210-
"--locale-format"
285+
"--battery-format"
286+
"--battery-error"
211287
"--locale-key"
212-
"--disk-folders"
213-
"--disk-key"
214-
"--local-ip-format"
288+
"--locale-format"
289+
"--locale-error"
215290
"--local-ip-key"
216-
"--public-ip-format"
291+
"--local-ip-format"
292+
"--local-ip-error"
217293
"--public-ip-key"
218-
"--player-format"
294+
"--public-ip-format"
295+
"--public-ip-error"
219296
"--player-key"
220-
"--media-format"
297+
"--player-format"
298+
"--player-error"
221299
"--media-key"
300+
"--media-format"
301+
"--media-error"
222302
"--datetime-key"
223303
"--datetime-format"
224-
"--date-format"
304+
"--datetime-error"
225305
"--date-key"
226-
"--time-format"
306+
"--date-format"
307+
"--date-error"
227308
"--time-key"
309+
"--time-format"
310+
"--time-error"
228311
"--vulkan-key"
229312
"--vulkan-format"
313+
"--vulkan-error"
230314
"--opengl-key"
231315
"--opengl-format"
316+
"--opengl-error"
232317
"--opencl-key"
233318
"--opencl-format"
234-
"--os-error"
235-
"--host-error"
236-
"--kernel-error"
237-
"--uptime-error"
238-
"--processes-error"
239-
"--packages-error"
240-
"--shell-error"
241-
"--resolution-error"
242-
"--de-error"
243-
"--wm-error"
244-
"--wm-theme-error"
245-
"--theme-error"
246-
"--icons-error"
247-
"--font-error"
248-
"--cursor-error"
249-
"--terminal-error"
250-
"--terminal-font-error"
251-
"--cpu-error"
252-
"--cpu-usage-error"
253-
"--gpu-error"
254-
"--memory-error"
255-
"--disk-error"
256-
"--battery-error"
257-
"--locale-error"
258-
"--disk-error"
259-
"--local-ip-error"
260-
"--public-ip-error"
261-
"--player-error"
262-
"--media-error"
263-
"--datetime-error"
264-
"--date-error"
265-
"--time-error"
266-
"--vulkan-error"
267-
"--opengl-error"
268319
"--opencl-error"
269320
)
270321

271322
local FF_OPTIONS_PATH=(
323+
"--load-config"
272324
"--os-file"
273-
"--lib-PCI"
325+
"--lib-pci"
274326
"--lib-vulkan"
275327
"--lib-wayland"
276328
"--lib-xcb-randr"
277329
"--lib-xcb"
278-
"--lib-Xrandr"
330+
"--lib-xrandr"
279331
"--lib-X11"
280332
"--lib-gio"
281-
"--lib-DConf"
282-
"--lib-DBus"
283-
"--lib-XFConf"
333+
"--lib-dconf"
334+
"--lib-dbus"
335+
"--lib-xfconf"
284336
"--lib-sqlite3"
285337
"--lib-rpm"
286338
"--lib-imagemagick"
@@ -291,14 +343,25 @@ __fastfetch_completion()
291343
"--lib-osmesa"
292344
"--lib-opencl"
293345
"--battery-dir"
294-
"--load-config"
295346
)
296347

297348
local FF_OPTIONS_LOGO=(
298349
"-l"
299350
"--logo"
300351
)
301352

353+
local FF_OPTIONS_LOGO_TYPE=(
354+
"--logo-type"
355+
)
356+
357+
local FF_OPTIONS_BINARY_PREFIX=(
358+
"--binary-prefix"
359+
)
360+
361+
local FF_OPTIONS_GL=(
362+
"--gl"
363+
)
364+
302365
if __fastfetch_previous_matches "${FF_OPTIONS_SINGLE[@]}"; then
303366
return
304367
elif [[ $WORD_COUND -gt 3 && ( ${COMP_WORDS[$COMP_CWORD - 2]} == "--help" || ${COMP_WORDS[$COMP_CWORD - 2]} == "-h" ) ]]; then
@@ -315,9 +378,14 @@ __fastfetch_completion()
315378
__fastfetch_complete_path
316379
elif __fastfetch_previous_matches "${FF_OPTIONS_LOGO[@]}"; then
317380
__fastfetch_complete_logo
381+
elif __fastfetch_previous_matches "${FF_OPTIONS_LOGO_TYPE[@]}"; then
382+
__fastfetch_complete_logo_type
383+
elif __fastfetch_previous_matches "${FF_OPTIONS_BINARY_PREFIX[@]}"; then
384+
__fastfetch_complete_binary_prefix
385+
elif __fastfetch_previous_matches "${FF_OPTIONS_GL[@]}"; then
386+
__fastfetch_complete_gl
318387
else
319388
__fastfetch_complete_option
320389
fi
321-
}
322390

323391
complete -F __fastfetch_completion fastfetch

presets/all

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
--structure Title:Separator:OS:Host:Kernel:Uptime:Processes:Packages:Shell:Resolution:DE:WM:WMTheme:Theme:Icons:Font:Cursor:Terminal:TerminalFont:CPU:GPU:Memory:Disk:Battery:Player:Song:PublicIP:LocalIP:DateTime:Locale:Vulkan:OpenGL:OpenCL:Break:Colors
1+
--structure Title:Separator:OS:Host:Kernel:Uptime:Processes:Packages:Shell:Resolution:DE:WM:WMTheme:Theme:Icons:Font:Cursor:Terminal:TerminalFont:CPU:GPU:Memory:Swap:Disk:Battery:Player:Song:PublicIP:LocalIP:DateTime:Locale:Vulkan:OpenGL:OpenCL:Break:Colors

0 commit comments

Comments
 (0)