summarylogtreecommitdiffstats
path: root/enano
blob: 25351fb3c7586471bbb79afe10b1e2b5b7d14254 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#!/usr/bin/python3

import subprocess
import os
import sys

try:
    filename = sys.argv[1].replace(".gpg", "")
except IndexError:
    print("No File Specified")
    sys.exit()

os.system(f"mkfifo '{filename}'")
x = subprocess.Popen(["xfce4-terminal", "-x", "nano", filename])

if os.path.exists(filename + ".gpg"):
    os.system(f"gpg -d {filename}.gpg > {filename}")
else:
    pipe = open(filename, "w")
    pipe.write("// new document")
    pipe.close()
    del pipe

os.system(f"gpg --sign '{filename}'")
os.system(f"rm '{filename}'")
x.terminate()