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
| # 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
| # 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
| # Espanso trigger to output time and date in another timezone | |
| # Requires Python and its pytz library | |
| matches: | |
| - trigger: :tzdate | |
| replace: '{{output}}' | |
| vars: | |
| - name: zones | |
| 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
| # yaml-language-server: https://github.com/espanso/espanso/blob/dev/schemas/match.schema.json | |
| # OASIS-IS ChatGPT framework Form. OASIS-IS stands for : O-bjective, A-rchtype, -S-etting, I-llustrations, S-tyle, - , I-nterpretation, S-pecification. | |
| # After those steps are Evalute - How good was the response, give your chatbot feedback, and then Banter - Continue the conversation. | |
| # Paid ChatGPT users can use the current list of models avaialble while unpaid can use the default model. | |
| # The frameworks spreadsheet can be found here: http://3dmkf.com/pace-oasis | |
| # This first one, is meant to generate a prompt. Run :oasis from a URL in a web browser, fill out the form and submit it, then press enter. It wiss pass the prompt to ChatGPT. | |
| global_vars: |
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 snippets to return offset date from today | |
| # It was pointed out that my v1 didn't allow for different length months and years. | |
| # Thanks to @StewCam on Discord https://discord.com/channels/884163483409731584/1013914627886817372/1251704970080944189 | |
| # Here are five updated versions which do. | |
| # Pick one and type e.g.: +2w, -3m etc. | |
| # Bash version for Linux. For macOS Bash or Zsh see the discussion below | |
| - regex: (?P<Offset>[+-]\d+)(?P<Unit>[dwmy]) | |
| replace: "{{Output}}" | |
| label: Bash Offset date |
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
| # Set an Espanso global variable for the system "HOME" directory, regardless of OS | |
| # to avoid the need to use `filter_os:`, as Espanso can only use ONE app-specific | |
| # configuration at a time. | |
| # Requires Python | |
| 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
| matches: | |
| - trigger: :testclip | |
| replace: something | |
| force_mode: clipboard | |
| # If this one works, you'll probably need an app-specific configuration | |
| # for the filter_class:, _exec: or _title: (in that order of preference) | |
| # specifying "backend: clipboard" | |
| - trigger: :testinject |
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
| # Python script to add Espanso trigger:/replace: pairs | |
| # Usage: python espanso_add.py <trigger> <replace> [filename] | |
| import subprocess | |
| import sys | |
| import os | |
| def append_to_file(trigger, replace, filename): | |
| # Set default filename if not provided | |
| if not filename: |
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
| # From https://github.com/espanso/espanso/discussions/1908 | |
| matches: | |
| - trigger: :test | |
| replace: "{{output}}" | |
| vars: | |
| - name: output | |
| type: script | |
| params: | |
| args: | |
| - python |