Skip to main content

Ever wanted to get some details about the foreground app, such as which is it, which URL is currently opened, etc? This project is for you.

Demo via sleep 3; ./demo.py.

Examples:

$ ./demo.py
{'appName': 'Terminal',
 'idleTime': 0.274327906,
 'url': 'file:///Users/az/Programmierung/foreground_app_info',
 'windowTitle': './demo.py  /Users/az/Programmierung/foreground_app_info \xe2\x80\x94 osascript \xe2\x80\x94 80\xc3\x9724'}

$ sleep 3; ./demo.py
{'appName': 'Chrome',
 'idleTime': 1.440957492,
 'url': 'https://news.ycombinator.com/',
 'windowTitle': 'Hacker News'}

$ sleep 3; ./demo.py
{'appName': 'Finder',
 'idleTime': 2.213467371,
 'url': 'file:///Users/az/Documents/',
 'windowTitle': 'Documents'}

$ sleep 3; ./demo.py
{'appName': 'TextEdit',
 'idleTime': 1.435908488,
 'url': 'file:///Users/az/Documents/todo-musicplayer.txt',
 'windowTitle': 'todo-musicplayer.txt'}

This project is registered on Pypi. You can install it via:

$ pip install foreground_app_info

Simple demo code:

from foreground_app_info import get_app_info
from pprint import pprint

pprint(get_app_info())

This is currently used by TimeCapture.

Metadata

Release files for foreground_app_info 1.20150502.140923

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for foreground_app_info 1.20150502.140923
File Size Uploaded
foreground_app_info-1.20150502.140923.tar.gz 4.8 kB Details

Release files / foreground_app_info-1.20150502.140923.tar.gz

Download URL foreground_app_info-1.20150502.140923.tar.gz
Size 4.8 kB
Tags Source
SHA-256 checksum
How to use checksums
c49ac3a4dfa9b582d1b1e982e32af2968483d19b5c7f5cfba6fef9291f1966e5
BLAKE2b-256 checksum
How to use checksums
71cb935ab677cb41b4660d5300b19e5ed4df51ea57c62508215c94c66b69a1a6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page