Skip to main content
This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (pypi.python.org).
Help us improve Python packaging - Donate today!

Get details about the application and opened URL which is in foreground

Project Description

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.

Release History

Release History

This version
History Node

1.20150502.141250

History Node

1.20150502.140946

History Node

1.20150502.140923

History Node

1.20150502.140902

History Node

1.20150502.140841

History Node

1.20150502.140705

History Node

1.20150502.140134

History Node

1.20150501.162721

History Node

1.20150501.162136

History Node

1.20150501.160214

Download Files

Download Files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
foreground_app_info-1.20150502.141250.tar.gz (5.6 kB) Copy SHA256 Checksum SHA256 Source May 2, 2015

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting