forked from turquoise-hexagon/catgirl.sh
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain
23 lines (20 loc) · 1.22 KB
/
main
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# variables
name="Nora's site"
github=/~https://github.com/0x3444ac53
instagram=https://www.instagram.com/discounted_dyke
#colors
#colorscheme=$(shuf -n 1 <(find ~/repos/base16-schemes))
colorscheme=~/repos/base16-schemes/catppuccin-latte.yaml
source <(python3 -c "import yaml;[print(f\"{i[0]}={i[1]}\") for i in map(lambda x: (x[0], f\"\'#{x[1]}\'\" if x[0][0] == 'b' else f\"\'{x[1]}\'\"), yaml.load(open('$colorscheme')).items())]")
# functions
atag() { printf '%s' "<a class=\"$1\" href=\"$2\">$3</a>$4"; }
page() { atag pages "$@"; }
list() { printf '%s' "<li>$*</li>"; }
margin() { printf '%s' "margin: $1ch $2ch $3ch $4ch"; }
link() { list "+ <a class=\"$1\" href=\"$2\">$3</a>$4"; }
headerlink() { printf '%s' "<link rel=\"$1\" type=\"$2\" href=\"$3\">"; }
img() { printf '%s' "<img src=\"$1\" alt=\"$2\" width=\"$3\" height=\"$4\">"; }
# bad functions
extract() {
yt-dlp --skip-download --print-json --no-warnings "$1" | jq -r '[.title, .webpage_url, .channel, .channel_url] | .[]' | python3 -c "import sys; print('\$(list ⋆ ' + ' by '.join(map(lambda x: '\$(atag video \\\"{}\\\" \\\"{}\\\")'.format(x[1].replace('\"', '\\\\\"'), x[0].replace('\"', '\\\\\"')), list(zip(b := iter(sys.stdin.read().split('\n')), b)))) + ')')";
}