kali-treecd: fix no color if launched from the menu & minor tweaks
Daniel Ruiz de AlegrÃa
2 years ago
15 | 15 | |
16 | 16 | |
17 | 17 | ## Package description ~ $ awk -F ': ' '/^Description: / {print $2}' ./example/debian/control |
18 | [ ! -z "${package}" ] \ | |
18 | [ -n "${package}" ] \ | |
19 | 19 | && description="$( dpkg-query -f'${binary:Synopsis}\n' -W ${package} 2>/dev/null )" |
20 | 20 | |
21 | 21 | |
22 | 22 | ## Feedback - banner |
23 | [ ! -z "${description}" ] \ | |
24 | && echo "> ${package} ~ ${description}" | |
25 | ||
23 | [ -n "${description}" ] \ | |
24 | && printf "\n> \033[1;4m${package}\e[0m ~ \033[3m${description}\e[0m\n\n" | |
26 | 25 | |
27 | 26 | ## Move to location |
28 | 27 | cd "${location}" |
34 | 33 | [ "${folders}" = "true" ] \ |
35 | 34 | && folder="-d" \ |
36 | 35 | || folder="" |
36 | ||
37 | # Add colors for tree | |
38 | if [ -x /usr/bin/dircolors ]; then | |
39 | test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)" | |
40 | fi | |
37 | 41 | |
38 | 42 | ## Using tree - display output |
39 | 43 | tree ${folder} -L ${depth} --noreport "${location}" |