mirror of
https://github.com/ful1e5/Bibata_Cursor.git
synced 2025-05-18 17:25:10 -04:00
📦 build only x11 option added
This commit is contained in:
parent
8dea8c690f
commit
530670d3ed
2 changed files with 49 additions and 19 deletions
47
build.py
47
build.py
|
@ -1,23 +1,50 @@
|
|||
#!/usr/bin/env python
|
||||
|
||||
import argparse
|
||||
import json
|
||||
import log
|
||||
from clickgen import build_cursor_theme
|
||||
from clickgen import build_cursor_theme, build_x11_cursor_theme
|
||||
|
||||
from config import configs, sizes, delay, temp_folder
|
||||
from config import version, configs, sizes, delay, temp_folder
|
||||
from helper import init_build, pack_it
|
||||
|
||||
|
||||
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()
|
||||
|
||||
|
||||
def build(config) -> None:
|
||||
|
||||
build_cursor_theme(
|
||||
config['name'],
|
||||
image_dir=config['bitmaps_dir'],
|
||||
cursor_sizes=sizes,
|
||||
out_path=config['temp_folder'],
|
||||
hotspots=hotspots,
|
||||
archive=False,
|
||||
delay=delay)
|
||||
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)
|
||||
|
||||
pack_it(config)
|
||||
|
||||
|
|
21
helper.py
21
helper.py
|
@ -48,15 +48,18 @@ def pack_it(config) -> None:
|
|||
"""
|
||||
Create Crisp 📦 Packages for Windows & X11 Cursor Theme.
|
||||
"""
|
||||
try:
|
||||
x11_out_dir = path.join(out_dir, config['x11_out'])
|
||||
win_out_dir = path.join(out_dir, config['win_out'])
|
||||
|
||||
x11_out_dir = path.join(out_dir, config['x11_out'])
|
||||
win_out_dir = path.join(out_dir, config['win_out'])
|
||||
# Rename directory
|
||||
shutil.move(path.join(config['temp_folder'],
|
||||
config['name'], "x11"), x11_out_dir)
|
||||
|
||||
# Rename directory
|
||||
shutil.move(path.join(config['temp_folder'],
|
||||
config['name'], "x11"), x11_out_dir)
|
||||
shutil.move(path.join(config['temp_folder'],
|
||||
config['name'], "win"), win_out_dir)
|
||||
shutil.move(path.join(config['temp_folder'],
|
||||
config['name'], "win"), win_out_dir)
|
||||
|
||||
# create install.inf file in Windows Theme
|
||||
window_bundle(win_out_dir)
|
||||
# create install.inf file in Windows Theme
|
||||
window_bundle(win_out_dir)
|
||||
except:
|
||||
pass
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue