general: Started working on completion.

This commit is contained in:
Dylan Araps 2018-05-30 09:02:49 +10:00
parent c0708d86c2
commit 0e73d7c9ae

View file

@ -3,9 +3,10 @@
# Shell completion for neofetch.
_neofetch_completions() {
local flags cur prev usage
local flags cur prev usage config
usage="$(neofetch --help)"
config="$(neofetch --print_config)"
# User input.
cur="${COMP_WORDS[COMP_CWORD]}"
@ -17,7 +18,6 @@ _neofetch_completions() {
# Complete partial matches.
IFS=$'\n' read -d "" -ra COMPREPLY < <(compgen -W "${flags[*]}" -- "$cur")
case "$prev" in
"--disable")
conf="${HOME}/.config/neofetch/config.conf"
@ -53,7 +53,135 @@ _neofetch_completions() {
"--color_blocks"|\
"--bar_border"|\
"--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
}