-
Notifications
You must be signed in to change notification settings - Fork 0
/
generate
executable file
·36 lines (26 loc) · 910 Bytes
/
generate
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
#!/usr/bin/env python3
import argparse
from typing import Any
import yaml
from lib.config import config_schema
from lib.data import Scheme
from lib.schemes.custom import gen_custom
from lib.schemes.kitty import gen_kitty
from lib.schemes.text_mate import gen_tm
from lib.schemes.vim import gen_vim
def main(config: dict[str, Any]):
scheme = Scheme(config.get('colors', {}), config.get('highlights', []))
gen_vim(config['vim'], scheme)
if 'text-mate' in config:
gen_tm(config['text-mate'], scheme)
if 'custom' in config:
for custom in config['custom']:
gen_custom(custom, scheme)
gen_kitty(config['kitty'], scheme)
if __name__ == '__main__':
parser = argparse.ArgumentParser()
parser.add_argument('file')
args = parser.parse_args()
with open(args.file, 'r') as fp:
config = config_schema(yaml.safe_load(fp))
main(config)