25 lines
590 B
Python
25 lines
590 B
Python
#!/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)
|