Compare commits

...

16 commits
master ... comp

Author SHA1 Message Date
Dylan Araps
80b089b8d9 merge: fix conflicts 2018-06-05 10:58:41 +10:00
Dylan Araps
552b0dd6bc revert: makefile changes 2018-06-05 10:56:13 +10:00
Dylan Araps
ea7e8531e9 Merge branch 'comp' of github.com:dylanaraps/neofetch into comp 2018-06-05 06:28:55 +10:00
Dylan Araps
27346df5e3 general: Update completion 2018-06-05 06:25:29 +10:00
Dylan Araps
23db006fb9 Merge branch 'master' into comp 2018-06-05 06:18:45 +10:00
Dylan Araps
8dd186d06b
Merge pull request #1013 from mstraube/comp
completion: add gmusicbrowser
2018-06-01 21:43:51 +00:00
Michael Straube
7dcf21009a completion: add gmusicbrowser 2018-06-01 14:19:58 +02:00
Dylan Araps
455dfa1b73 completion: Install with Makefile 2018-05-30 21:31:13 +10:00
Dylan Araps
530928186f completion: Finish args 2018-05-30 20:55:19 +10:00
Dylan Araps
f8b5e3bb32 completion: Finish args 2018-05-30 20:45:10 +10:00
Dylan Araps
fb5d20a9c4 completion: Finish args 2018-05-30 20:40:21 +10:00
Dylan Araps
39333ad0cb completion: Finish args 2018-05-30 20:31:22 +10:00
Dylan Araps
a1bf937fd8 completion: Finish args 2018-05-30 14:28:18 +10:00
Dylan Araps
0e73d7c9ae general: Started working on completion. 2018-05-30 09:02:49 +10:00
Dylan Araps
c0708d86c2 general: Started working on completion. 2018-05-30 08:37:54 +10:00
Dylan Araps
4afaff4223 general: Started working on completion. 2018-05-30 08:31:01 +10:00
2 changed files with 438 additions and 1 deletions

View file

@ -0,0 +1,437 @@
#!/usr/bin/env bash
#
# Shell completion for neofetch.
shopt -s nullglob
_neofetch_completions() {
local cur prev usage
cur="${COMP_WORDS[COMP_CWORD]}"
prev="${COMP_WORDS[COMP_CWORD-1]}"
if [[ "$cur" == -* ]]; then
usage="$(neofetch -h | awk '/^ --/{printf $1" "}')"
IFS=$'\n' read -d "" -ra COMPREPLY \
< <(compgen -W "$usage" -- "$cur")
else
case "$prev" in
"--disable")
conf="${HOME}/.config/neofetch/config.conf"
[[ -f "$conf" ]] &&
IFS=$'\n' read -d "" -ra values \
< <(awk '/ info /&&!a[$0]++{print $NF}' "$conf")
;;
"--backend")
values=(
"ascii"
"caca"
"iterm2"
"jp2a"
"kitty"
"pixterm"
"sixel"
"termpix"
"tycat"
"w3m"
"off"
)
;;
"--os_arch"|\
"--speed_shorthand"|\
"--cpu_brand"|\
"--cpu_speed"|\
"--kernel_shorthand"|\
"--refresh_rate"|\
"--gpu_brand"|\
"--gtk_shorthand"|\
"--gtk2"|\
"--gtk3"|\
"--shell_path"|\
"--shell_version"|\
"--song_shorthand"|\
"--underline"|\
"--bold"|\
"--color_blocks"|\
"--bar_border"|\
"--ascii_bold")
values=(
"on"
"off"
)
;;
"--uptime_shorthand"|\
"--package_managers"|\
"--distro_shorthand")
values=(
"on"
"tiny"
"off"
)
;;
"--speed_type")
values=(
"current"
"min"
"max"
"bios"
"scaling_current"
"scaling_min"
"scaling_max"
)
;;
"--cpu_cores")
values=(
"logical"
"physical"
"off"
)
;;
"--cpu_temp")
values=(
"C"
"F"
"off"
)
;;
"--gpu_type")
values=(
"all"
"dedicated"
"integrated"
)
;;
"--disk_show")
values=(
"/dev/sd"*
"/"
)
;;
"--disk_subtitle")
values=(
"name"
"mount"
"dir"
)
;;
"--ip_host")
values=(
"http://ident.me"
)
;;
"--song_format")
values=(
"\"%artist% - %album% - %title%\""
"\"%artist - %title\""
)
;;
"--music_player")
values=(
"amarok"
"audacious"
"banshee"
"bluemindo"
"clementine"
"cmus"
"deadbeef"
"deepin-music"
"elisa"
"exaile"
"gmusicbrowser"
"gnome-music"
"gmusicbrowser"
"Google Play"
"guayadeque"
"iTunes"
"juk"
"lollypop"
"mocp"
"mopidy"
"mpd"
"pogo"
"pragha"
"qmmp"
"quodlibet"
"rhythmbox"
"sayonara"
"spotify"
"Spotify"
"tomahawk"
"vlc"
"xmms2d"
"yarock"
)
;;
"--install_time_format")
values=(
"12h"
"24h"
)
;;
"--underline_char")
values=(
"_"
"-"
"."
"⎯"
"―"
)
;;
"--block_width"|\
"--block_height"|\
"--bar_length")
values=(
{1..9}
)
;;
"--cpu_display"|\
"--memory_display"|\
"--battery_display"|\
"--disk_display")
values=(
"bar"
"infobar"
"barinfo"
"off"
)
;;
"--source"|\
"--ascii"|\
"--caca"|\
"--iterm2"|\
"--jp2a"|\
"--kitty"|\
"--pixterm"|\
"--sixel"|\
"--termpix"|\
"--tycat"|\
"--w3m")
values=(
"auto"
"ascii"
"wallpaper"
"/path/to/img.jpg"
"/path/to/images"
"/path/to/ascii_file"
)
;;
"--ascii_distro")
values=(
"aix"
"alpine"
"alpine_small"
"amazon"
"anarchy"
"android"
"antergos"
"antix"
"aosc"
"apricity"
"arch"
"arch_old"
"arch_small"
"archbox"
"archlabs"
"archmerge"
"arcolinux"
"artix"
"arya"
"bitrig"
"blag"
"blankon"
"bsd"
"bunsenlabs"
"calculate"
"centos"
"chakra"
"chaletos"
"chapeau"
"chrom"
"clover"
"condres"
"crux"
"crux_small"
"darwin"
"debian"
"debian_small"
"deepin"
"desaos"
"devuan"
"dracos"
"dragonfly"
"dragonfly_old"
"dragonfly_small"
"elementary"
"endless"
"exherbo"
"fedora"
"freebsd"
"freebsd_small"
"freemint"
"frugalware"
"funtoo"
"galliumos"
"gentoo"
"gentoo_small"
"gnewsense"
"gnu"
"gobolinux"
"grombyang"
"guixsd"
"haiku"
"hyperbola"
"irix"
"kali"
"kaos"
"kde"
"kibojoe"
"kogaion"
"korora"
"kslinux"
"kubuntu"
"lede"
"linux lite"
"linux mint"
"linux"
"lmde"
"lubuntu"
"lunar"
"mac"
"mageia"
"magpieos"
"manjaro"
"maui"
"mer"
"minix"
"mx"
"netbsd"
"netrunner"
"nitrux"
"nixos"
"nixos_small"
"nurunner"
"nutyx"
"obrevenge"
"open source media center"
"openbsd"
"openbsd_small"
"openindiana"
"openmandriva"
"opensuse"
"openwrt"
"oracle"
"pacbsd"
"parabola"
"pardus"
"parrot"
"parsix"
"pcbsd"
"pclinuxos"
"peppermint"
"porteus"
"postmarketos"
"puppy"
"pureos"
"qubes"
"raspbian"
"red star"
"redcore"
"redcore"
"redhat"
"regata"
"rosa"
"sabayon"
"sabotage"
"sailfishos"
"salentos"
"scientific"
"sharklinux"
"siduction"
"slackware"
"slitaz"
"smartos"
"solus"
"sparky"
"steamos"
"sunos"
"swagarch"
"tails"
"trisquel"
"ubuntu"
"ubuntu_old"
"void"
"void_small"
"windows 10"
"windows"
"xferience"
"xubuntu"
"zorin"
)
;;
"--size")
values=(
"00px"
"00%"
"auto"
"none"
)
;;
"--crop_mode")
values=(
"normal"
"fit"
"fill"
)
;;
"--crop_offset")
values=(
"northwest"
"north"
"northeast"
"west"
"center"
"east"
"southwest"
"south"
"southeast"
)
;;
"--config")
values=(
"none"
"/path/to/config"
)
;;
esac
IFS=$'\n' read -d "" -ra COMPREPLY \
< <(compgen -W "${values[*]}" -- "$cur")
fi
}
complete -F _neofetch_completions neofetch

View file

@ -4569,7 +4569,7 @@ get_args() {
"-v") verbose="on" ;;
"--print_config") printf '%s\n' "$config"; exit ;;
"-vv") set -x; verbose="on" ;;
"--help") usage ;;
"-h"|"--help") usage ;;
"--version")
printf '%s\n' "Neofetch $version"
exit 1