Skip to content

Window

Summary

Matches while a window with the given title exists or does not exist. Availability depends on the platform.

Example

rules:
  # Match while a window title contains "Mozilla Firefox" (case-sensitive)
  - name: "Firefox window is open"
    conditions:
      window:
        title: "Mozilla Firefox"
        exists: true
        match:
          type: contains
    actions:
      - run: "echo Firefox window is open"

Options

Option Default Description
title required Title of the window to check.
exists required Whether the window is expected to exist (true) or not (false).
match exact, case-sensitive How the title is matched, see Match Types.

Details

Only windows with a non-empty title are checked. Minimized windows are included.

Platform Requirement
Windows PowerRules has to run in the session of the logged-in user, not as a service. Windows on other virtual desktops and suspended UWP apps are skipped.
Linux An X11 session with a window manager which provides a window list. Wayland is not supported.
macOS The screen recording permission is required.

If a requirement is not met, window conditions cannot be evaluated and the evaluation stops.

  • Policy Evaluation


    Continuous evaluation and --dry-run.

  • Actions


    Run commands when a rule matches.

  • Trust


    Detect modifications of policies and scripts.