2019-09-05 02:28:30 +00:00
|
|
|
#!/usr/bin/env python3
|
2022-02-10 22:07:11 +00:00
|
|
|
# SPDX-License-Identifier: GPL-2.0-or-later
|
2021-08-04 01:43:56 +00:00
|
|
|
|
2019-09-05 02:28:30 +00:00
|
|
|
# This script updates icons from the SVG file
|
|
|
|
import os
|
|
|
|
import subprocess
|
|
|
|
import sys
|
|
|
|
|
|
|
|
BASEDIR = os.path.abspath(os.path.dirname(__file__))
|
|
|
|
|
2021-08-04 01:31:28 +00:00
|
|
|
inkscape_bin = os.environ.get("INKSCAPE_BIN", "inkscape")
|
2019-09-05 02:28:30 +00:00
|
|
|
|
|
|
|
if sys.platform == 'darwin':
|
2021-01-08 13:58:29 +00:00
|
|
|
inkscape_app_path = '/Applications/Inkscape.app/Contents/MacOS/inkscape'
|
2019-09-05 02:28:30 +00:00
|
|
|
if os.path.exists(inkscape_app_path):
|
2021-08-04 01:31:28 +00:00
|
|
|
inkscape_bin = inkscape_app_path
|
2019-09-05 02:28:30 +00:00
|
|
|
|
|
|
|
cmd = (
|
2021-08-04 01:31:28 +00:00
|
|
|
inkscape_bin,
|
2019-09-05 02:28:30 +00:00
|
|
|
os.path.join(BASEDIR, "prvicons.svg"),
|
2019-10-29 17:54:58 +00:00
|
|
|
"--export-width=1792",
|
2019-09-05 02:28:30 +00:00
|
|
|
"--export-height=256",
|
2021-01-08 13:58:29 +00:00
|
|
|
"--export-type=png",
|
|
|
|
"--export-filename=" + os.path.join(BASEDIR, "prvicons.png"),
|
2019-09-05 02:28:30 +00:00
|
|
|
)
|
|
|
|
subprocess.check_call(cmd)
|