blob: 9360898a2dbe1b4d04e43821a972b431c5a80d39 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
|
function test_tput {
local tmp
[[ -x "$(which tput)" ]] || return 1
tmp=$(tput setf 0)
}
if test_tput; then
GRAY=$(tput setf 8)
BLACK=$(tput setf 0)
RED=$(tput setf 4)
HIRED=$(tput setf 9)
GREEN=$(tput setf 2)
HIGREEN=$(tput setf 10)
YELLOW=$(tput setf 6)
HIYELLOW=$(tput setf 11)
BLUE=$(tput setf 1)
HIBLUE=$(tput setf 12)
MAGENTA=$(tput setf 5)
HIMAGENTA=$(tput setf 13)
CYAN=$(tput setf 3)
HICYAN=$(tput setf 14)
WHITE=$(tput setf 7)
HIWHITE=$(tput setf 15)
BOLD=$(tput bold)
NORM=$(tput sgr0)
else
GRAY=$(printf "\033[0;30m")
BLACK=$(printf "\033[1;30m")
RED=$(printf "\033[0;31m")
HIRED=$(printf "\033[1;31m")
GREEN=$(printf "\033[0;32m")
HIGREEN=$(printf "\033[1;32m")
YELLOW=$(printf "\033[0;33m")
HIYELLOW=$(printf "\033[1;33m")
BLUE=$(printf "\033[0;34m")
HIBLUE=$(printf "\033[1;34m")
MAGENTA=$(printf "\033[0;35m")
HIMAGENTA=$(printf "\033[1;35m")
CYAN=$(printf "\033[0;36m")
HICYAN=$(printf "\033[1;36m")
WHITE=$(printf "\033[0;37m")
HIWHITE=$(printf "\033[1;37m")
BOLD=$(printf "\033[0;39m")
NORM=$(printf "\033[0m")
fi
|