| import tkinter as tk |
| from pystray import Icon, Menu, MenuItem |
| from PIL import Image, ImageDraw |
| import threading |
| import pyautogui |
| import sys |
| import time |
|
|
| |
| def jarvis_brain(): |
| """Aici rulează procesele de fundal ale lui Jarvis""" |
| print("J.A.R.V.I.S. este activat și monitorizează sistemul.") |
| |
| |
| |
| while True: |
| |
| time.sleep(1) |
|
|
| def on_quit(icon, item): |
| """Închide complet aplicația din System Tray""" |
| icon.stop() |
| sys.exit() |
|
|
| def minimize_to_tray(window): |
| """Ascunde fereastra și creează iconița de lângă ceas""" |
| window.withdraw() |
| |
| |
| width, height = 64, 64 |
| image = Image.new('RGB', (width, height), color=(0, 0, 0)) |
| dc = ImageDraw.Draw(image) |
| dc.ellipse((10, 10, 54, 54), fill=(0, 255, 255)) |
| |
| |
| threading.Thread(target=jarvis_brain, daemon=True).start() |
|
|
| |
| menu = Menu( |
| MenuItem("J.A.R.V.I.S. Online", lambda: None, enabled=False), |
| MenuItem("Închide Sistemul", on_quit) |
| ) |
| |
| icon = Icon("Jarvis", image, "J.A.R.V.I.S.", menu) |
| icon.run() |
|
|
| |
| def create_gui(): |
| root = tk.Tk() |
| root.title("S.H.I.E.L.D. OS - J.A.R.V.I.S. Boot") |
| root.geometry("400x250") |
| root.configure(bg="#0a0a0a") |
|
|
| |
| label = tk.Label( |
| root, |
| text="WELCOME BACK, SIR.\n\nSistemul este gata de inițializare.", |
| fg="#00ffff", bg="#0a0a0a", font=("Courier", 12, "bold"), |
| pady=30 |
| ) |
| label.pack() |
|
|
| btn_start = tk.Button( |
| root, |
| text="ACTIVEAZĂ J.A.R.V.I.S.", |
| command=lambda: minimize_to_tray(root), |
| bg="#00ffff", fg="black", |
| font=("Arial", 10, "bold"), |
| width=25, height=2, |
| relief="flat" |
| ) |
| btn_start.pack(pady=10) |
|
|
| root.mainloop() |
|
|
| if __name__ == "__main__": |
| create_gui() |