Skip to content

Instantly share code, notes, and snippets.

@e23z
Created July 25, 2017 14:56
Show Gist options
  • Save e23z/6e82676e9915155b1cd7e08d95ed1db9 to your computer and use it in GitHub Desktop.
Save e23z/6e82676e9915155b1cd7e08d95ed1db9 to your computer and use it in GitHub Desktop.
[Focus Monitor] A python script to monitor and display which app is capturing the focus of your mac screen. #utils #scripts #macos
#!/usr/bin/python
from AppKit import NSWorkspace
import time
t = range(1,100)
for i in t:
time.sleep(3)
activeAppName = NSWorkspace.sharedWorkspace().activeApplication()['NSApplicationName']
print(activeAppName)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment