-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathwicon
executable file
·52 lines (29 loc) · 1.18 KB
/
wicon
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
45
46
47
48
49
50
51
HOST=$1
mkdir -p .w/Favicons
cd .w/Favicons
#ls -l $HOST/favicon.ico
#../../Graphics/imcat/imcat $HOST*_* 2>/dev/null
[[ -f $HOST.ANSI && ! -s $HOST.ANSI ]] && exit 1
[[ -f $HOST.ANSI ]] && cat $HOST.ANSI && exit 0
# use original site
#[[ ! -f $HOST.ico ]] && wget -q -O $HOST.ico $HOST/favicon.ico
# use DuckDuckGo???
[[ ! -f $HOST.ico ]] && wget -q -O $HOST.ico https://icons.duckduckgo.com/ip3/$HOST.ico
#icotool -l $HOST.ico 2>/dev/null
# get icon files
#icotool -x $HOST.ico 2>/dev/null
#ls $HOST*_*
# only show 16x16 sizes
#ICO16=$HOST*_*16x16x*
# enable for all sizes resized
#ICO16=$HOST*_*
#ICO16=`ls -1 $ICO16|tail -1`
#../chafa/tools/chafa/chafa -d 0 --size 8x8 $ICO16 2>/dev/null
#../chafa/tools/chafa/chafa -d 0 --size 8x8$ ICO16 --invert 2>/dev/null
# -- seems "best" 2>/dev/null
#../../../chafa/tools/chafa/chafa --colors 16 -d 0.01 --size 8x8 $ICO16 2>/dev/null > $HOST.ANSI
# -- more easy, can read all foramts
timg -bwhite --color8 --loops=1 --frames=1 -t1 -g8x8 $HOST.ico 2>/dev/null | tee $HOST.ANSI
[[ -s $HOST.ANSI ]] && exit 0
#../chafa/tools/chafa/chafa -d 0 --colors 16 --size 8x8 $ICO16 --invert 2>/dev/null | tee $HOST.ANSI
# cannot restrict size