Skip to main content

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

Metadata

Release files for macos-lswin 0.2

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

Source distribution (sdist)

Source distribution for macos-lswin 0.2
File Size Uploaded
macos-lswin-0.2.tar.gz 4.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for macos-lswin 0.2
File Interpreter ABI Platform
macos_lswin-0.2-py3-none-any.whl Python 3 none any Details

Total release size: 9.7 kB

Release files / macos-lswin-0.2.tar.gz

Download URL macos-lswin-0.2.tar.gz
Size 4.4 kB
Tags Source
SHA-256 checksum
How to use checksums
d9dbba09b690991eae8a1b40f2523ba17dfd711fd893dc8b642d7fe50532bd4f
BLAKE2b-256 checksum
How to use checksums
ce24bcf5ded678ad9185c107c3d12e9210d4c0bfa3320a5a41a45f8890fc4e5a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.6.0 requests-toolbelt/0.9.1 tqdm/4.38.0 CPython/3.8.0

Release files / macos_lswin-0.2-py3-none-any.whl

Download URL macos_lswin-0.2-py3-none-any.whl
Size 5.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ad0db12fc55f9b9ccab4e413823158be69673031ecd013424f7e98db9c4e8d94
BLAKE2b-256 checksum
How to use checksums
bb3d9f93503e843b6813b582eb23850632fda1ed42194b09c59601a41df75d31
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.6.0 requests-toolbelt/0.9.1 tqdm/4.38.0 CPython/3.8.0

Release history Release notifications | RSS feed

This release

0.2 This release

2 release files

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