Bibata_Cursor/build.py

63 lines
1.6 KiB
Python
Raw Normal View History

2020-08-25 03:13:38 -04:00
#!/usr/bin/env python
2020-10-07 06:05:51 -04:00
import argparse
2020-08-23 09:02:58 -04:00
import json
2020-08-25 00:30:03 -04:00
import log
2020-10-07 06:05:51 -04:00
from clickgen import build_cursor_theme, build_x11_cursor_theme
2020-08-23 09:02:58 -04:00
2020-10-07 06:05:51 -04:00
from config import version, configs, sizes, delay, temp_folder
2020-08-23 09:02:58 -04:00
from helper import init_build, pack_it
2020-10-07 06:05:51 -04:00
def cmd_parse():
"""Parse command line arguments"""
parser = argparse.ArgumentParser(
description="Bibata cursors builder %s" % version)
parser.add_argument("-x", "--x11", action="store_true", default=False,
help=("Create X11 cursors using bitmaps"
" (default: %(default)s)"))
return parser.parse_args()
2020-08-23 09:02:58 -04:00
def build(config) -> None:
2020-10-07 06:05:51 -04:00
args = cmd_parse()
if (args.x11):
# build x11 cursors packages only
build_x11_cursor_theme(
config['name'],
image_dir=config['bitmaps_dir'],
cursor_sizes=sizes,
out_path=config['temp_folder'],
hotspots=hotspots,
archive=False,
delay=delay)
else:
# build windows & x11 cursors packages
build_cursor_theme(
config['name'],
image_dir=config['bitmaps_dir'],
cursor_sizes=sizes,
out_path=config['temp_folder'],
hotspots=hotspots,
archive=False,
delay=delay)
2020-08-23 09:02:58 -04:00
pack_it(config)
if __name__ == "__main__":
2020-08-23 09:56:45 -04:00
init_build()
2020-08-23 09:02:58 -04:00
# read hotspots file
with open('./hotspots.json', 'r') as hotspot_file:
hotspots = json.loads(hotspot_file.read())
# building themes
for config in configs:
2020-08-23 09:56:45 -04:00
print('🌈 Building %s Theme ...' % config['name'])
2020-08-23 09:02:58 -04:00
build(config)