RUN-OR-RAISE(1)

NAME
run-or-raise - utility for launching applications or focusing their windows

SYNOPSIS
run-or-raise CONDITION PROGRAM [ARGS...]

DESCRIPTION
run-or-raise is a utility for launching applications or focusing their windows. When invoked, run-or-raise matches existing windows against CONDITION. If a matching window is found, it is focused. If none of the windows fulfill the criteria, run-or-raise executes PROGRAM passing any ARGS to it as arguments.

CONDITIONS
Conditions select windows based on their properties. Conditions support two comparison operators: = for exact equality comparison with a string literal and ~ work comparing with a regular expression. Comparisons can be combined using logical operators: && for logical AND, || for logical OR, and ! for logical NOT. Operators in matching expressions are left-associative and ! (not) binds stronger than && (and) which, in turn, binds stronger than || (or). Possible properties are class, name, and role. Additionally, parentheses can be used to alter evaluation order. Strings and regular expressions are written inside double quotes. If multiple windows match the criteria, the first matching window is selected. Bellow are some examples of how conditions can be used to select windows in various ways:
    # Launch or focus emacs
    run-or-raise 'class = "Emacs"' emacs
    # You can also use regular expressions for matching
    # Match windows with title ending with the string "Firefox"
    run-or-raise 'name ~ ".*Firefox$"' firefox
    # You can combine multiple comparisons with logical operators.
    # Match windows with the role browser that do not have the class Chromium.
    run-or-raise 'role = "browser" && ! class = "Chromium"' firefox

AUTHORS
Samuel Laurén <samuel.lauren@iki.fi>