Uses NSWindow + PulseBorderView with Core Animation-style pulse. Fixed NSRect handling from plan: uses NSInsetRect instead of non-existent .insetBy method on pyobjc tuples. Made-with: Cursor
33 lines
777 B
Python
33 lines
777 B
Python
"""Manual test: shows a pulsing border around Cursor for 10 seconds."""
|
|
import sys
|
|
import time
|
|
|
|
from Cocoa import NSApplication, NSRunLoop, NSDate
|
|
|
|
from cursor_flasher.config import Config
|
|
from cursor_flasher.overlay import OverlayWindow
|
|
from cursor_flasher.detector import CursorDetector
|
|
|
|
app = NSApplication.sharedApplication()
|
|
|
|
config = Config()
|
|
overlay = OverlayWindow(config)
|
|
detector = CursorDetector()
|
|
|
|
pid = detector._find_cursor_pid()
|
|
if pid is None:
|
|
print("Cursor not running")
|
|
sys.exit(1)
|
|
|
|
print(f"Showing overlay for PID {pid} for 10 seconds...")
|
|
overlay.show(pid)
|
|
|
|
end_time = time.time() + 10
|
|
while time.time() < end_time:
|
|
NSRunLoop.currentRunLoop().runUntilDate_(
|
|
NSDate.dateWithTimeIntervalSinceNow_(0.1)
|
|
)
|
|
|
|
overlay.hide()
|
|
print("Done.")
|