mirror of
https://github.com/PapirusDevelopmentTeam/papirus-folders.git
synced 2024-09-18 18:48:47 -04:00
Make color completion a bit smarter and a bit slower
This commit is contained in:
parent
cce23c2918
commit
9c422d9d49
2 changed files with 15 additions and 8 deletions
|
@ -5,10 +5,12 @@
|
|||
# @link: https://github.com/PapirusDevelopmentTeam/papirus-folders
|
||||
|
||||
_get_colors() {
|
||||
local -a colors=(black blue bluegrey breeze brown carmine cyan
|
||||
darkcyan deeporange green grey indigo magenta nordic orange
|
||||
palebrown paleorange pink purple red teal violet white yaru
|
||||
yellow)
|
||||
if ! command -v papirus-folders >/dev/null; then
|
||||
_message "unable to find papirus-folders script"
|
||||
return 1
|
||||
fi
|
||||
|
||||
local -a colors=( $(papirus-folders -l | tr -d '>\n') )
|
||||
_wanted colors exlp 'color' compadd -- "${colors[@]}"
|
||||
return 0
|
||||
}
|
||||
|
|
|
@ -4,6 +4,14 @@
|
|||
# @license: MIT license (MIT)
|
||||
# @link: https://github.com/PapirusDevelopmentTeam/papirus-folders
|
||||
|
||||
__get_colors() {
|
||||
if ! command -v papirus-folders >/dev/null; then
|
||||
return 1
|
||||
fi
|
||||
|
||||
papirus-folders -l | tr -d '>\n'
|
||||
}
|
||||
|
||||
__get_themes() {
|
||||
local data_dir icons_dir icon_theme
|
||||
local -a data_dirs=()
|
||||
|
@ -32,10 +40,7 @@ __get_themes() {
|
|||
|
||||
_papirus_folders() {
|
||||
local cur prev
|
||||
local -a colors=(black blue bluegrey breeze brown carmine cyan
|
||||
darkcyan deeporange green grey indigo magenta nordic orange
|
||||
palebrown paleorange pink purple red teal violet white yaru
|
||||
yellow)
|
||||
local -a colors=( $(__get_colors) )
|
||||
local -a opts=(
|
||||
-h --help
|
||||
-V --version
|
||||
|
|
Loading…
Reference in a new issue