general: Started working on completion.
This commit is contained in:
parent
c0708d86c2
commit
0e73d7c9ae
1 changed files with 131 additions and 3 deletions
|
@ -3,9 +3,10 @@
|
||||||
# Shell completion for neofetch.
|
# Shell completion for neofetch.
|
||||||
|
|
||||||
_neofetch_completions() {
|
_neofetch_completions() {
|
||||||
local flags cur prev usage
|
local flags cur prev usage config
|
||||||
|
|
||||||
usage="$(neofetch --help)"
|
usage="$(neofetch --help)"
|
||||||
|
config="$(neofetch --print_config)"
|
||||||
|
|
||||||
# User input.
|
# User input.
|
||||||
cur="${COMP_WORDS[COMP_CWORD]}"
|
cur="${COMP_WORDS[COMP_CWORD]}"
|
||||||
|
@ -17,7 +18,6 @@ _neofetch_completions() {
|
||||||
# Complete partial matches.
|
# Complete partial matches.
|
||||||
IFS=$'\n' read -d "" -ra COMPREPLY < <(compgen -W "${flags[*]}" -- "$cur")
|
IFS=$'\n' read -d "" -ra COMPREPLY < <(compgen -W "${flags[*]}" -- "$cur")
|
||||||
|
|
||||||
|
|
||||||
case "$prev" in
|
case "$prev" in
|
||||||
"--disable")
|
"--disable")
|
||||||
conf="${HOME}/.config/neofetch/config.conf"
|
conf="${HOME}/.config/neofetch/config.conf"
|
||||||
|
@ -53,7 +53,135 @@ _neofetch_completions() {
|
||||||
"--color_blocks"|\
|
"--color_blocks"|\
|
||||||
"--bar_border"|\
|
"--bar_border"|\
|
||||||
"--ascii_bold")
|
"--ascii_bold")
|
||||||
COMPREPLY=("on" "off")
|
COMPREPLY=(
|
||||||
|
"on"
|
||||||
|
"off"
|
||||||
|
)
|
||||||
|
;;
|
||||||
|
|
||||||
|
"--speed_type")
|
||||||
|
COMPREPLY=(
|
||||||
|
"current"
|
||||||
|
"min"
|
||||||
|
"max"
|
||||||
|
"bios"
|
||||||
|
"scaling_current"
|
||||||
|
"scaling_min"
|
||||||
|
"scaling_max"
|
||||||
|
)
|
||||||
|
;;
|
||||||
|
|
||||||
|
"--cpu_cores")
|
||||||
|
COMPREPLY=(
|
||||||
|
"logical"
|
||||||
|
"physical"
|
||||||
|
"off"
|
||||||
|
)
|
||||||
|
;;
|
||||||
|
|
||||||
|
"--cpu_temp")
|
||||||
|
COMPREPLY=(
|
||||||
|
"C"
|
||||||
|
"F"
|
||||||
|
"off"
|
||||||
|
)
|
||||||
|
;;
|
||||||
|
|
||||||
|
"--gpu_type")
|
||||||
|
COMPREPLY=(
|
||||||
|
"all"
|
||||||
|
"dedicated"
|
||||||
|
"integrated"
|
||||||
|
)
|
||||||
|
;;
|
||||||
|
|
||||||
|
"--disk_show")
|
||||||
|
COMPREPLY=(
|
||||||
|
"/dev/sd"*
|
||||||
|
"/"
|
||||||
|
)
|
||||||
|
;;
|
||||||
|
|
||||||
|
"--disk_subtitle")
|
||||||
|
COMPREPLY=(
|
||||||
|
"name"
|
||||||
|
"mount"
|
||||||
|
"dir"
|
||||||
|
)
|
||||||
|
;;
|
||||||
|
|
||||||
|
"--ip_host")
|
||||||
|
COMPREPLY=(
|
||||||
|
"http://ident.me"
|
||||||
|
)
|
||||||
|
;;
|
||||||
|
|
||||||
|
"--song_format")
|
||||||
|
COMPREPLY=(
|
||||||
|
"\"%artist% - %album% - %title%\""
|
||||||
|
"\"%artist - %title\""
|
||||||
|
)
|
||||||
|
;;
|
||||||
|
|
||||||
|
"--music_player")
|
||||||
|
COMPREPLY=(
|
||||||
|
"amarok"
|
||||||
|
"audacious"
|
||||||
|
"banshee"
|
||||||
|
"bluemindo"
|
||||||
|
"clementine"
|
||||||
|
"cmus"
|
||||||
|
"deadbeef"
|
||||||
|
"deepin-music"
|
||||||
|
"elisa"
|
||||||
|
"exaile"
|
||||||
|
"gnome-music"
|
||||||
|
"Google Play"
|
||||||
|
"guayadeque"
|
||||||
|
"iTunes"
|
||||||
|
"juk"
|
||||||
|
"lollypop"
|
||||||
|
"mocp"
|
||||||
|
"mopidy"
|
||||||
|
"mpd"
|
||||||
|
"pogo"
|
||||||
|
"pragha"
|
||||||
|
"qmmp"
|
||||||
|
"quodlibet"
|
||||||
|
"rhythmbox"
|
||||||
|
"sayonara"
|
||||||
|
"spotify"
|
||||||
|
"Spotify"
|
||||||
|
"tomahawk"
|
||||||
|
"vlc"
|
||||||
|
"xmms2d"
|
||||||
|
"yarock"
|
||||||
|
)
|
||||||
|
;;
|
||||||
|
|
||||||
|
"--install_time_format")
|
||||||
|
COMPREPLY=(
|
||||||
|
"12h"
|
||||||
|
"24h"
|
||||||
|
)
|
||||||
|
;;
|
||||||
|
|
||||||
|
"--underline_char")
|
||||||
|
COMPREPLY=(
|
||||||
|
"_"
|
||||||
|
"-"
|
||||||
|
"."
|
||||||
|
"⎯"
|
||||||
|
"―"
|
||||||
|
)
|
||||||
|
;;
|
||||||
|
|
||||||
|
"--block_width"|\
|
||||||
|
"--block_height"|\
|
||||||
|
"--bar_length")
|
||||||
|
COMPREPLY=(
|
||||||
|
{1..9}
|
||||||
|
)
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue