0f5e42dce6
Simple double-click launchers for opening terminal environments: Files: - TerminalLauncher.vbs: VBScript launcher (no dependencies) - RECOMMENDED - TerminalLauncher.py: Python GUI with three buttons - TerminalLauncher.bat: Batch wrapper for Python version - TERMINAL_LAUNCHER_SETUP.md: Complete setup and usage guide Features: ✓ Double-click to open ✓ VBScript version requires no external dependencies ✓ Python version provides prettier GUI with buttons ✓ Three terminal options: WSL (default), PowerShell, Ubuntu (WSL) ✓ Works on Windows 7 and later Usage: 1. Copy .vbs or .bat/.py to Windows Desktop 2. Double-click 3. Select terminal 4. Opens immediately Ready for production use.
86 lines
2.4 KiB
Python
86 lines
2.4 KiB
Python
#!/usr/bin/env python3
|
|
"""
|
|
Terminal Launcher - Simple GUI for opening WSL, PowerShell, Ubuntu
|
|
Double-click to run on Windows
|
|
"""
|
|
|
|
import tkinter as tk
|
|
from tkinter import messagebox
|
|
import subprocess
|
|
import sys
|
|
import os
|
|
|
|
class TerminalLauncher:
|
|
def __init__(self, root):
|
|
self.root = root
|
|
self.root.title("Terminal Launcher")
|
|
self.root.geometry("350x220")
|
|
self.root.resizable(False, False)
|
|
|
|
# Center window on screen
|
|
self.root.update_idletasks()
|
|
x = (self.root.winfo_screenwidth() // 2) - (self.root.winfo_width() // 2)
|
|
y = (self.root.winfo_screenheight() // 2) - (self.root.winfo_height() // 2)
|
|
self.root.geometry(f"+{x}+{y}")
|
|
|
|
# Title
|
|
title = tk.Label(root, text="Terminal Launcher", font=("Segoe UI", 16, "bold"))
|
|
title.pack(pady=20)
|
|
|
|
# Buttons
|
|
self.btn_wsl = tk.Button(
|
|
root,
|
|
text="🖥️ WSL (Default)",
|
|
width=30,
|
|
height=2,
|
|
font=("Segoe UI", 11),
|
|
command=self.launch_wsl
|
|
)
|
|
self.btn_wsl.pack(pady=8)
|
|
|
|
self.btn_powershell = tk.Button(
|
|
root,
|
|
text="⚡ PowerShell",
|
|
width=30,
|
|
height=2,
|
|
font=("Segoe UI", 11),
|
|
command=self.launch_powershell
|
|
)
|
|
self.btn_powershell.pack(pady=8)
|
|
|
|
self.btn_ubuntu = tk.Button(
|
|
root,
|
|
text="🐧 Ubuntu (WSL)",
|
|
width=30,
|
|
height=2,
|
|
font=("Segoe UI", 11),
|
|
command=self.launch_ubuntu
|
|
)
|
|
self.btn_ubuntu.pack(pady=8)
|
|
|
|
def launch_wsl(self):
|
|
try:
|
|
subprocess.Popen("wsl", shell=True)
|
|
self.root.quit()
|
|
except Exception as e:
|
|
messagebox.showerror("Error", f"Failed to launch WSL:\n{e}")
|
|
|
|
def launch_powershell(self):
|
|
try:
|
|
subprocess.Popen("powershell", shell=True)
|
|
self.root.quit()
|
|
except Exception as e:
|
|
messagebox.showerror("Error", f"Failed to launch PowerShell:\n{e}")
|
|
|
|
def launch_ubuntu(self):
|
|
try:
|
|
subprocess.Popen("wsl -d Ubuntu", shell=True)
|
|
self.root.quit()
|
|
except Exception as e:
|
|
messagebox.showerror("Error", f"Failed to launch Ubuntu:\n{e}")
|
|
|
|
if __name__ == "__main__":
|
|
root = tk.Tk()
|
|
app = TerminalLauncher(root)
|
|
root.mainloop()
|