The command line syntax for Inkscape changed quite a bit for the 1.0 release, see https://wiki.inkscape.org/wiki/index.php/Release_notes/1.0#Command_Line. Think it's reasonable to expect Inkscape 1.0 or later be installed if you want to generate the icons with the script. It's easy to get via the website, if the distribution doesn't provide new enough packages. Only few people would use the script anyway. I also had to change the path for command line access on macOS which apparently changed (https://stackoverflow.com/a/60068607). Although I didn't find a mention of this change in the Inkscape release notes.
26 lines
627 B
Python
Executable File
26 lines
627 B
Python
Executable File
#!/usr/bin/env python3
|
|
|
|
# This script updates icons from the SVG file
|
|
import os
|
|
import subprocess
|
|
import sys
|
|
|
|
BASEDIR = os.path.abspath(os.path.dirname(__file__))
|
|
|
|
inkscape_path = 'inkscape'
|
|
|
|
if sys.platform == 'darwin':
|
|
inkscape_app_path = '/Applications/Inkscape.app/Contents/MacOS/inkscape'
|
|
if os.path.exists(inkscape_app_path):
|
|
inkscape_path = inkscape_app_path
|
|
|
|
cmd = (
|
|
inkscape_path,
|
|
os.path.join(BASEDIR, "prvicons.svg"),
|
|
"--export-width=1792",
|
|
"--export-height=256",
|
|
"--export-type=png",
|
|
"--export-filename=" + os.path.join(BASEDIR, "prvicons.png"),
|
|
)
|
|
subprocess.check_call(cmd)
|