import tkinter as tk import subprocess # Dictionary of applications: key is the button text, value is the command to execute applications = { "Terminal": ['qterminal'], "rqt": ["rqt"], "rviz2": ["rviz2"], "Gazebo": "gz sim -v4 -g".split(), "Gazebo Standalone": "gz sim -v4".split(), "glxgears (GPU test)": ["glxgears"], # Add more applications here if needed } # Function to launch an application def launch_app(command): try: subprocess.Popen(command) except FileNotFoundError: print(f"{command[0]} not found. Make sure it's installed and accessible in the PATH.") # Create the main application window root = tk.Tk() root.title("Spiri SDK Launcher") label = tk.Label(root, text="Spiri Robotics SDK", font=("Arial", 14)) label.pack(pady=10) # Create and place buttons dynamically based on the dictionary for app_name, command in applications.items(): button = tk.Button(root, text=app_name, command=lambda cmd=command: launch_app(cmd), width=20, height=2) button.pack() # Run the Tkinter main loop root.mainloop()