Minor fixes

This commit is contained in:
Sergei Eremenko 2018-09-09 11:32:25 +03:00
parent df7208c2bc
commit f124772180
3 changed files with 7 additions and 9 deletions

View file

@ -5,9 +5,9 @@
# @link: https://github.com/PapirusDevelopmentTeam/papirus-folders
_get_colors() {
local -a valid_colors=(black blue bluegrey brown cyan green grey
local -a colors=(black blue bluegrey brown cyan green grey
magenta orange pink purple red teal violet yellow)
_wanted colors exlp 'color' compadd -- "${valid_colors[@]}"
_wanted colors exlp 'color' compadd -- "${colors[@]}"
return 0
}

View file

@ -32,7 +32,7 @@ __get_themes() {
_papirus_folders() {
local cur prev
local -a valid_colors=(black blue bluegrey brown cyan green grey
local -a colors=(black blue bluegrey brown cyan green grey
magenta orange pink purple red teal violet yellow)
local -a opts=(
-h --help
@ -50,7 +50,7 @@ _papirus_folders() {
case "$prev" in
-C|--color)
COMPREPLY=( $(compgen -W "${valid_colors[*]}" -- "${cur}") )
COMPREPLY=( $(compgen -W "${colors[*]}" -- "${cur}") )
return
;;
-t|--theme)

View file

@ -144,8 +144,7 @@ get_theme_dir() {
# Get data directories from XDG_DATA_DIRS variable and
# convert colon-separated list into bash array
IFS=: read -ra data_dirs <<< \
"${XDG_DATA_DIRS:-/usr/local/share:/usr/share}"
IFS=: read -ra data_dirs <<< "${XDG_DATA_DIRS:-/usr/local/share:/usr/share}"
for data_dir in "${data_dirs[@]}"; do
[ -d "$data_dir/icons" ] || continue
@ -155,6 +154,7 @@ get_theme_dir() {
for icons_dir in "${icons_dirs[@]}"; do
[ -f "$icons_dir/$THEME_NAME/index.theme" ] || continue
printf '%s' "$icons_dir/$THEME_NAME"
verbose "'$THEME_NAME' is found in '$icons_dir'."
return 0
done
@ -398,7 +398,7 @@ parse_args() {
done
# Reset the positional parameters to the short options
eval set -- "${args[@]}"
set -- "${args[@]}"
while getopts ":C:DRlt:uvVh" opt; do
case "$opt" in
@ -460,8 +460,6 @@ main() {
THEME_DIR="$(get_theme_dir)" \
|| fatal "fail to find '$THEME_NAME' icon theme."
verbose "'$THEME_NAME' is found in '${THEME_DIR%/*}'."
case "$OPERATION" in
change-color) do_change_color ;;
revert-default) do_revert_default ;;