#!/usr/bin/env python3
import os,sys,time,json
root=os.environ['PROOF_DESKTOP_ROOT']
profile=root+'/profiles/'+str(time.time_ns())
os.makedirs(profile+'/User')
with open(profile+'/User/settings.json','w') as f: json.dump({'editor.cursorBlinking':'solid','workbench.startupEditor':'none','breadcrumbs.enabled':False,'window.title':'${activeEditorShort} — Proof editor','workbench.colorTheme':'Default Light Modern','editor.fontSize':20,'window.zoomLevel':1},f)
with open(profile+'/argv.json','w') as f: json.dump(sys.argv[1:],f)
os.execv(root+'/VSCode-linux-x64/bin/code',[root+'/VSCode-linux-x64/bin/code','--no-sandbox','--disable-gpu','--disable-workspace-trust','--skip-welcome','--skip-release-notes','--new-window','--user-data-dir',profile,'--extensions-dir',root+'/extensions',*sys.argv[1:]])
