-
Notifications
You must be signed in to change notification settings - Fork 0
/
fanzero
executable file
·16 lines (15 loc) · 1.02 KB
/
fanzero
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
cchar() {
char=$(curl -s "https://rezero.fandom.com/wiki/Category:Characters"|
grep -B6 'class="category-page__member-thumbnail "'|
sed -nE 's_.*href="([^"]*)".*_\1_p; s_.*data-src="([^"]*)".*_\1_p; s_.*alt="([^"]*)".*_\1_p'|
sed -e 'N;N;s/\n/\t/g' -e 's_/width/[[:digit:]]\{1,3\}_/width/800_g' \
-e 's_/height/[[:digit:]]\{1,3\}_/height/600_g'|
fzf --reverse --with-nth 3.. --cycle --preview="kitty +kitten icat --clear --transfer-mode file; \
kitty +kitten icat --place "256x17@10x10" --scale-up --transfer-mode file {2}"|cut -f1)
[ -z "$char" ] && exit 1 || images=$(curl -sL "https://you-zitsu.fandom.com"$char|
sed -nE 's_.*src="([^"]*)".*class="pi-image-thumbnail".*alt="([^"]*)".*_\1\t\2_p')
[ $(printf "%s" "$images"|wc -l) -lt 2 ] && kitty +kitten icat $(printf "%s" "$images"|cut -f1) ||
printf "%s" "$images"|fzf --with-nth 2.. --cycle --preview="kitty +kitten icat --clear --transfer-mode file; \
kitty +kitten icat --place "50x50@0x0" --scale-up --transfer-mode file {1}" > /dev/null
}
cchar