Remove hard-coded assets location

parent 3f82a073
......@@ -37,11 +37,10 @@ install_theme () {
}
render_theme () {
python3 render_assets.py "$1"
create_folders "$2"
python3 render_assets.py "$1" "$2/assets"
build_sass gtk318/gtk.scss "$2/gtk-3.18/gtk.css"
build_sass gtk320/gtk.scss "$2/gtk-3.20/gtk.css"
mv assets "$2/"
cp -R gtk2/* "$2/gtk-2.0/"
install_theme "$2" "$3"
}
......
......@@ -157,7 +157,7 @@ class Assets(object):
if filename == 'png':
self.surface = cairo.ImageSurface(cairo.FORMAT_ARGB32, scl*width, scl*height)
else:
self.surface = cairo.SVGSurface('assets/' + filename, scl*width, scl*height)
self.surface = cairo.SVGSurface(os.path.join(assets_path, filename), scl*width, scl*height)
cr = self.cr = cairo.Context(self.surface)
if rotation != 0:
cr.translate(scl*width/2,scl*height/2)
......@@ -328,7 +328,7 @@ class Assets(object):
self.cr.stroke()
def save(self, filename):
self.surface.write_to_png('assets/' + filename)
self.surface.write_to_png(os.path.join(assets_path, filename))
def check_items(color1,color2,state,alpha=1.0):
......@@ -654,12 +654,17 @@ def mix(color, mix_color, amount):
return (r,g,b)
#___________________________________________________________________________________
if len(sys.argv) == 2:
if len(sys.argv) >= 2:
filename = sys.argv[1]
else:
filename = '/usr/share/color-schemes/Breeze.colors'
make_sure_path_exists('assets')
if len(sys.argv) >= 3:
assets_path = sys.argv[2]
else:
assets_path = 'assets'
make_sure_path_exists(assets_path)
_colors = ReadKdeGlobals().read_globals(filename)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment