-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvisual_flash.py
More file actions
55 lines (45 loc) · 1.91 KB
/
Copy pathvisual_flash.py
File metadata and controls
55 lines (45 loc) · 1.91 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
# ----------------------------------------------------------------------------
# ThirdEye AI Vision Suite - Proprietary and Confidential
# Copyright (c) 2026 Devon Chase. All rights reserved.
# ----------------------------------------------------------------------------
"""
Simulates a visual flash (Argument: 'color=red' or 'color=white')
"""
import customtkinter as ctk
import time
def run(context, args):
flash = None
try:
color = "white"
if "red" in args: color = "#FF0000"
# Create Toplevel Window
flash = ctk.CTkToplevel()
# FIX 1: Use manual geometry instead of native fullscreen.
# This prevents macOS from creating a new "Space" (the sliding animation).
screen_width = flash.winfo_screenwidth()
screen_height = flash.winfo_screenheight()
flash.geometry(f"{screen_width}x{screen_height}+0+0")
# Remove title bar and borders
flash.overrideredirect(True)
# Visual properties
flash.configure(fg_color=color)
flash.attributes("-alpha", 0.4) # Transparency
flash.attributes("-topmost", True)
# FIX 2: Force the window to render immediately (required if running in a thread)
flash.update()
# Hold the flash
time.sleep(0.1)
except Exception as e:
print(f"[SCRIPT] Flash Error: {e}")
finally:
# FIX 3: Robust Cleanup
# Using 'finally' ensures this runs even if an error occurred above.
if flash:
try:
flash.destroy()
# FIX 4: Force update again to process the destroy event immediately
# This prevents ghost windows from getting stuck on screen.
flash.update()
except Exception as e:
print(f"[SCRIPT] Cleanup Error: {e}")
print(f"[SCRIPT] VISUAL FLASH ACTIVATED: {color}")