Skip to main content

Snap windows to their configured positions

Project description

window-snap

Installation:

pipx install window_snap

Configuring

By default, the program looks at %userprofile%\.config\window-snap\config.yaml.

The folder to look in for config.yaml is configurable with the WINDOW_SNAP_CONFIG_DIR environment variable.

Current Feature Set

This module currently supports the following:

  • YAML-driven window layout management using a windows mapping in config.yaml.
  • Window matching by title (default) or executable name (find_by_exe).
  • Moving windows to a target monitor (monitor index in config is 1-based).
    • Leftmost monitor is 1, numbered increasing moving to the right
    • absolute pixel values (integer [0,monitor-width]), or
    • fractional values (0-1] relative to monitor work area.
  • Maximize handling via maximized: true.
  • Temporary on-top handling via on_top: true.
  • Partial updates where unspecified values keep the window's current position/size.
  • Multi-monitor awareness with monitor detection from window geometry.
  • Safe handling when windows are missing or configuration entries are invalid (logs and continues).

Example config snippet:

windows:
  chrome.exe:
    find_by_exe: true
    on_top: true
    monitor: 2
    left: 0
    top: 0
    width: 0.5
    height: 1

on_top only puts the window on top at the moment during processing.

Command-line features:

  • window-snap applies the configured layout from the default config path.

  • Snapping is skipped when running inside a Windows Remote Desktop session.

    window-snap --force applies the configured layout even during a Remote Desktop session.

  • window-snap --store-current captures current top-level window positions and writes:

    • _config_version
    • windows (captured destinations)
    • available_exe_names (title -> executable mapping)
  • -v/--verbose increases logging verbosity.

Project details


Download files

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

Source Distribution

window_snap-0.3.0.tar.gz (9.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

window_snap-0.3.0-py3-none-any.whl (11.1 kB view details)

Uploaded Python 3

File details

Details for the file window_snap-0.3.0.tar.gz.

File metadata

  • Download URL: window_snap-0.3.0.tar.gz
  • Upload date:
  • Size: 9.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for window_snap-0.3.0.tar.gz
Algorithm Hash digest
SHA256 a1c79b37e11bcbe10712c032571f2ff83e8b0e9b75454b5abb3ce8fde2553374
MD5 1a151a63c4b2cba5e466719860aabe2b
BLAKE2b-256 ee828c60153b4812101db232ca542f4f2410378d484ff3ee161ac30a1f441e05

See more details on using hashes here.

Provenance

The following attestation bundles were made for window_snap-0.3.0.tar.gz:

Publisher: release.yml on mshafer1/py_window_snap

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file window_snap-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: window_snap-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 11.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for window_snap-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b448b35e8e466fef784923ad098484430f592143643aa9b964f1716df214e596
MD5 c10f587041ed5c1c8905cbc7929e693e
BLAKE2b-256 a06c7a73f8032f70cd0a6502d1b7ddbb54afefc91b39305234068b817d8e087a

See more details on using hashes here.

Provenance

The following attestation bundles were made for window_snap-0.3.0-py3-none-any.whl:

Publisher: release.yml on mshafer1/py_window_snap

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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