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 temperature C/°F conversion | |
# From conversation at: https://discord.com/channels/884163483409731584/1013914627886817372/1253000300730515508 | |
# Usage: ::10C → 10C / 50.00°F, or ::10F → 10°F / -12.22C | |
matches: | |
- regex: ::(?P<value>\d+(?:\.\d+)?)(?P<unit>[CF]) | |
replace: "{{output}}" | |
vars: | |
- name: output | |
type: script | |
params: |
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 autocomplete brackets etc. at the end of a string, on typing double-space. | |
# It will fall over if there's a single-quote within the string, however. | |
matches: | |
- regex: '(?P<delim>[\[\(\{<"])(?P<string>.+) ' | |
replace: "{{output}}" | |
vars: | |
- name: output | |
type: script | |
params: | |
args: |
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
matches: | |
- trigger: :test | |
replace: "{{output}}" | |
vars: | |
- name: select | |
type: choice | |
params: | |
values: | |
- label: One | |
id: | |
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 |
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
#!/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
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
# 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 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
# 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 |
OlderNewer