Advertisement
smeech

Delays in replacements, generic

Aug 23rd, 2024 (edited)
125
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
YAML 1.37 KB | None | 0 0
  1. # Espanso trigger to be used in conjunction with the script test_pynput.py
  2. # https://pastebin.com/KKX8GPzD
  3. # Uses the Python pynput library to inject text, instead of Espanso. Enables the
  4. # addition of pauses (sleep) and <Tab> etc. keys and can include Espanso {{variables}}
  5. # See https://pynput.readthedocs.io/en/latest/keyboard.html#controlling-the-keyboard
  6. # Supports type, tap, press, release, and sleep
  7. # Whilst you can add to the replace:, anything there will be injected AFTER the script's
  8. # output
  9.  
  10.   - trigger: :delay
  11.     replace: '{{output}}'
  12.     vars:
  13.       - name: trig
  14.         type: echo
  15.         params:
  16.           echo: :delay # This must match the trigger text
  17.       - name: input
  18.         type: echo
  19.         params:
  20.           echo: |      # Amend the contents below to suit, adding variables etc.
  21.             type Hello, World!
  22.             tap enter
  23.             type Pausing for one second
  24.             tap enter
  25.             sleep 1    
  26.             type How are you?
  27.             tap space
  28.             press shift
  29.             type I am a bot
  30.             release shift
  31.             tap enter
  32.             type The trigger was {{trig}}
  33.             tap enter
  34.       - name: output
  35.         type: script
  36.         params:
  37.           args:
  38.            - python
  39.             - '%CONFIG%/scripts/test_pynput.py'
  40.             - '{{trig}}'
  41.             - '{{input}}'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement