Skip to main content

a commandline utility to list and filter macOS process and window names

Project description

macos-lswin

lswin: a commandline utility to list and filter macOS process and window names.

master-ci master-codecov

Background

This utility provides filtering for windows based on parent process name, window name, and whether or not the process is on the screen.

A similar project, mac_list_windows_pids, revealed how straightforward the necessary Quartz core graphics lookups are; so, I reviewed Apple's developer documentation for CGWindowListCopyWindowInfo and set out to add primitive UNIX shell style wildcard filtering for process and window names with a simple command line interface.

Supported Platforms

This utility has been tested on macOS Catalina 10.15.

Usage

Development Environment

Initialize a development environment by executing tox; the lswin utility will be installed in the .tox Python virtual environment binary path.

Examples

List all windows with process names or window names beginning with "term":

$ lswin -a -f "term*"
   PID     WID  Process: Window                                  X      Y
------  ------  -------------------------------------------  -----  -----
  4953    4805  Terminal: <4805>                                 0      0
  4953    4806  Terminal: <4806>                                 0      0
  4953    4813  Terminal: Focus Proxy                          100    100
  4953    7208  Terminal: <7208>                               628     95
  4953    7268  Terminal: Colors                                 0    612
  4953    7269  Terminal: <7269>                               951    433
  4953    8639  Terminal: <8639>                             -1920      0
  4953    8657  Terminal: <8657>                                 0      0
  4953   13111  Terminal: <13111>                              318     68
  4953   13984  Terminal: <13984>                               80      0
  4953   14588  Terminal: Terminal — -bash — 129×22            395    201
  4953   14890  Terminal: Terminal — lswin.py -a -f term...    395    201

List onscreen windows with process names or window names beginning with "term":

$ lswin -f "term*"
   PID     WID  Process: Window                                  X      Y
------  ------  -------------------------------------------  -----  -----
  4953   14588  Terminal: Terminal — -bash — 129×25            173    496
  4953   14890  Terminal: Terminal — lswin.py -f term* —...    395    201

Project details


Release history Release notifications | RSS feed

This version

0.2

Download files

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

Source Distribution

macos-lswin-0.2.tar.gz (4.4 kB view hashes)

Uploaded Source

Built Distribution

macos_lswin-0.2-py3-none-any.whl (5.3 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page