ReplaceTextAction

Inherits

Action

Replaces text in the currently focused text field.

Note

This action is currently only supported in the compositor plugin implementations and will only work in programs that support the Text Input Wayland protocol.

Configuration

Properties

Property

Type

replace_text

TextSubstitutionRule

TextSubstitutionRule

Property

Type

Description

regex

regex

Regular expression executed on text before the cursor, on the same line.

On a successful match, the match_0, match_1, …, match_4 variables are set to groups captured by the expression, where group 0 is the entire text, and the text is replaced with the value specified in the replace property.

replace

string

Text to replace the match with. Accepts dynamic values, evaluated asynchronously.

Examples

replace_text:
  # :calc{2+2} -> 4
  - regex: :calc{(.*)}
    replace:
      command: printf "$(qalc -t "$match_1")"

   # :email -> example@example.com
  - regex: :email
    replace: example@example.com