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 clipboard manipulation, new version to select relevant script | |
| # line using the choice extension id: parameters. | |
| # To use, copy the text in question and type ":case". | |
| - trigger: :case | |
| label: Modify and paste copied text | |
| replace: '{{Output}}' | |
| vars: | |
| - name: Clipb |
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 check-boxes | |
| matches: | |
| - trigger: :test | |
| replace: "{{form1.flag}}" | |
| vars: | |
| - name: form1 | |
| type: form | |
| params: | |
| layout: "Option A: [[flag]]" | |
| fields: |
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 Html and Markdown examples, including the injection of images: | |
| # Define a variable containing the location of the home directory | |
| global_vars: | |
| - name: home | |
| type: script | |
| params: | |
| args: | |
| - python | |
| - -c | |
| - print(__import__('os').path.expanduser('~')) |
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
| # Capitalises first letter after sentence-ending punctuation, skipping exceptions | |
| - regex: (?P<before>\b[\w.]+[.?!])\s(?P<firstchar>[a-z])(?P<therest>\w*\W) | |
| replace: "{{before}} {{capital}}{{therest}}" | |
| vars: | |
| - name: capital | |
| type: script | |
| params: | |
| args: | |
| - python | |
| - -c |
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 superscript suffixes of ordinal numbers with some checking for validity | |
| matches: | |
| - regex: (?P<number>\s[1]|[0,2-9]1)st | |
| replace: "{{number}}ˢᵗ" | |
| - regex: (?P<number>\s[2]|[0,2-9]2)nd | |
| replace: "{{number}}ⁿᵈ" | |
| - regex: (?P<number>\s[3]|[0,2-9]3)rd | |
| replace: "{{number}}ʳᵈ" | |
| - regex: (?P<number>\s[0,4-9]|[1][\d]|[0,2-9][0,4-9])th | |
| replace: "{{number}}ᵗʰ" |
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
| # corrects double-capitals typoed at beginnings of words | |
| - regex: (?P<chars>\b[[:upper:]]{2,}[[:lower:]]{2,})(?P<end>\W) | |
| replace: "{{output}}{{end}}" | |
| vars: | |
| - name: output | |
| type: script | |
| params: | |
| args: | |
| - python | |
| - -c |
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 2.2.1 | |
| Federico Terzi | |
| A Privacy-first, Cross-platform Text Expander | |
| USAGE: | |
| espanso [FLAGS] [SUBCOMMAND] | |
| FLAGS: | |
| -h, --help Prints help information | |
| -v Sets the level of verbosity |
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
| #!/usr/bin/env python3 | |
| # A script to parse `espanso --help` recursively throughout all its levels. | |
| import subprocess | |
| import sys | |
| def parse_help(command): | |
| try: | |
| help_text = subprocess.check_output(command + ['--help'], stderr=subprocess.STDOUT, text=True) | |
| except subprocess.CalledProcessError as e: |
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
| # ASCII character triggers | |
| # https://donsnotes.com/tech/charsets/ascii.html | |
| matches: | |
| - trigger: "\x05" # <ctrl-e> | |
| replace: testing |
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
| # Trigger to read input from a file | |
| matches: | |
| - trigger: :test | |
| replace: "{{output}}" | |
| vars: | |
| - name: output | |
| type: shell | |
| params: | |
| # cmd: echo $(</home/$USER/temp/br.txt) # Strips out newlines | |
| cmd: cat /home/$USER/temp/br.txt |