This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # The following snippet produces a choice Form and then uses | |
| # a shell script to swap its input for different values. | |
| # It's an alternative to label: & id: use, that | |
| # enables the use of the choice: drop-down facility | |
| - trigger: :test | |
| replace: "{{output}}" | |
| vars: | |
| - name: form1 | |
| type: form |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Release schema for VSCode/VSCodium/Vim | |
| # yaml-language-server: $schema=https://raw.githubusercontent.com/espanso/espanso/dev/schemas/match.schema.json | |
| matches: | |
| # Trigger to add corrected spellings to my_spellings.yml | |
| # Copy the incorrect and correct words, separated by a space, and type ":spell" | |
| - trigger: :spell | |
| replace: "{{Output}}" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Export smallest unique contractions of a list of words for Espanso | |
| from collections import defaultdict | |
| def shortest_unique_component(word, words_count): | |
| if words_count is None: | |
| return None | |
| for i in range(len(word)): | |
| contraction = word[:i+1] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Espanso draft form and output for Bswizzles | |
| - trigger: /mse | |
| replace: > | |
| Client presented as age {{form1.age}} and was {{form1.alert}}. | |
| Client was {{form1.calm}} and {{form1.attended}} to the interview. | |
| Client was dressed in {{form1.clothing}} clothing appropriate for the | |
| setting with {{form1.hygiene}} as though {{form1.not1}} regularly | |
| attending to ADLs. | |
| Eye contact was {{form1.wnl}}. Speech was {{form1.rtv}}. | |
| Client reported mood as {{form1.mood}}. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # A case-insensitive trigger expansion with word: true functionality. | |
| # Triggered by "example ????", "EXAMPLE ?????", "exaMPLe ????" etc.: | |
| - regex: (?i)\bexample(?P<w>\W) | |
| replace: Something{{w}} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ## Script to convert Markdown to Plain text, using an Espanso trigger: | |
| #!/usr/bin/env pwsh | |
| param ( | |
| [string]$markdownText | |
| ) | |
| # Function to convert Markdown to plain text | |
| function Convert-MarkdownToText { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # espanso configuration file | |
| # yaml-language-server: $schema=https://raw.githubusercontent.com/espanso/espanso/dev/schemas/config.schema.json | |
| # For a complete introduction, visit the official docs at: https://espanso.org/docs/ | |
| # You can use this file to define the global configuration options for espanso. | |
| # These are the parameters that will be used by default on every application, | |
| # but you can also override them on a per-application basis. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Espanso trigger to be used in conjunction with the script test_pynput.py | |
| # Uses the Python pynput library to inject text, instead of Espanso. Enables the | |
| # addition of pauses (sleep) and <Tab> etc. keys and can include Espanso {{variables}} | |
| # See https://pynput.readthedocs.io/en/latest/keyboard.html#controlling-the-keyboard | |
| # Supports type, tap, press, release, and sleep | |
| # Whilst you can add to the replace:, anything there will be injected AFTER the script's | |
| # output | |
| - trigger: :delay | |
| replace: '{{output}}' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Espanso doesn't support replacements which include delays | |
| # A solution is to ignore Espanso's own replace and use another tool to inject characters | |
| # Similar methods are available for Windows PowerShell using e.g.: | |
| # (New-Object -ComObject wscript.shell).SendKeys | |
| # Snippet to inject text using xdotool | |
| - trigger: ":xd" | |
| replace: "{{output}}" | |
| vars: | |
| - name: output |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # A slightly more efficient version of espanso_move.sh which utilises xwininfo. | |
| # Espanso doesn't facilitate repositioning of its Search or Choice etc. windows. | |
| # If the following script is running in the background, it will await the opening | |
| # of the window, and move it to the top left of the screen. | |
| # Adjust the middle two coordinates (,0,0,) for a different position, and reduce | |
| # the lower sleep value (included to reduce CPU load) if it's too slow |