You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

25 lines
590 B

#!/usr/bin/python3
import base64
def copy(string):
import subprocess
subprocess.run(["xclip", "-selection", "c"], input=string, encoding='utf8')
with open("main.js", 'r') as fp:
script = fp.read()
with open("main.xslt", "r") as fp:
xslt = fp.read()
with open("hamburger.png", "rb") as fp:
img = fp.read()
with open("main.css", "r") as fp:
css = fp.read()
script = script.replace("XSLFILE", "`{}`".format(xslt))
script = script.replace("CSS", "`{}`".format(css))
script = script.replace("HAMBURGER", base64.b64encode(img).decode('ascii'))
copy(script)