~zethra/sasha-fetch

35e5797914506d4cdc355614e0e60883c16aac22 — Sashanoraa 6 months ago c8304cd
Add more data and colors

Signed-off-by: Sashanoraa <ben@benaaron.dev>
2 files changed, 16 insertions(+), 6 deletions(-)

A .gitignore
M generate.py -rw-r--r-- => -rwxr-xr-x
A .gitignore => .gitignore +1 -0
@@ 0,0 1,1 @@
output

M generate.py => generate.py +15 -6
@@ 1,3 1,5 @@
#!/usr/bin/env python3

import sys
import math
import random


@@ 77,24 79,31 @@ f = open('profile')
message = '''
Sashanoraa
----------
Pronouns: any
OS: Manjaro
Pronouns:   any
Gender:     Non-binary / Gender Queer
Matrix:     @zethra:matrix.org
Email:      ben@benaaron.dev
Mastodon:   @zethra@fosstodon.org
Website:    sashanoraa.gay
Protonmail: sashanoraa@protonmail.com
'''.splitlines()

img = f.read().splitlines()

cat = LolCat()
titles = LolCat()
data = LolCat()
data.os = ((titles.os - 10 + 7) % 15) + 10

print('seed', cat.os)
print('seed', titles.os)

output = open(sys.argv[1], 'w')

for (i, m) in zip(img, message):
    if ':' in m:
        parts = m.split(':')
        output.write(f'{i} {cat.apply_color(parts[0])}: \x1b[m{parts[1]}\n')
        output.write(f'{i} {titles.apply_color(parts[0])}: {data.apply_color(":".join(parts[1:]))}\n')
    else:
        output.write(f'{i} {cat.apply_color(m)}\n')
        output.write(f'{i} {titles.apply_color(m)}\n')

for i in img[len(message):]:
    output.write(i + '\n')