From 8662a19a517d527360c62055d6f842867c513561 Mon Sep 17 00:00:00 2001 From: cbh123 Date: Wed, 27 Mar 2024 19:57:15 -0700 Subject: [PATCH] simple gui --- gui.py | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 gui.py diff --git a/gui.py b/gui.py new file mode 100644 index 0000000..9882e39 --- /dev/null +++ b/gui.py @@ -0,0 +1,31 @@ +import tkinter as tk +import subprocess + +NARRATOR_DIR = "/Users/charlieholtz/workspace/dev/narrator" + + +def run_command1(): + applescript_command = f""" + tell application "Terminal" + do script "cd {NARRATOR_DIR} && source .env && source venv/bin/activate && python3 capture.py" + activate + end tell + + tell application "Terminal" + do script "cd {NARRATOR_DIR} && source .env && source venv/bin/activate && python3 narrator.py" + activate + end tell + """ + subprocess.run(["osascript", "-e", applescript_command]) + + +# Create the main window +window = tk.Tk() +window.title("AI Narrator") + +# Create buttons for each command +button1 = tk.Button(window, text="Start", command=run_command1) +button1.pack(pady=10) + +# Start the GUI event loop +window.mainloop()