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
Measuring average interpreter startup time over 10 runs... | |
PowerShell (pwsh) : 0.3438 seconds (avg) | |
Ruby : 0.0778 seconds (avg) | |
Node.js : 0.0910 seconds (avg) | |
Bash : 0.0015 seconds (avg) | |
sh : 0.0009 seconds (avg) | |
Python3 : 0.0255 seconds (avg) | |
Perl : 0.0021 seconds (avg) |
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
- regex: :(?P<before>\d+)/(?P<after>\d+)(?P<end>\s) | |
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
# Via https://chatgpt.com/share/6852dd0d-dcd4-8012-849f-623787d8408a | |
# In response to https://github.com/espanso/espanso/issues/2360 | |
- trigger: ":checklist" | |
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
- regex: :(?P<amount>\d+(?:\.\d+)?)(?P<src>\w{3})/(?P<dst>\w{3}) | |
replace: "{{output}}" | |
vars: | |
- name: output | |
type: shell | |
params: | |
cmd: | | |
dst_uc=$(echo "{{dst}}" | tr '[:lower:]' '[:upper:]') | |
rate=$(curl -s "https://open.er-api.com/v6/latest/{{src}}" | jq -r ".rates.$dst_uc") | |
if [ "$rate" = "null" ] || [ -z "$rate" ]; then |
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: :date | |
replace: "{{Output.Date}}" | |
vars: | |
- {name: Day, type: date, params: {format: '%d'}} | |
- {name: Month, type: date, params: {format: '%m'}} | |
- {name: Year2, type: date, params: {format: '%y'}} | |
- {name: Year4, type: date, params: {format: '%Y'}} | |
- {name: Another, type: date, params: {format: '%A, %B %d, %Y'}} | |
- name: Output | |
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
#!/bin/bash | |
# Requires tmux and access to two Pi via ssh keys | |
# chmod +x tmux-pi to make executable | |
SESSION=$USER | |
tmux new-session -d -s $SESSION | |
# Setup a window for monitoring pi & dietpi |
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
# Capture and process clipboard content, preserving quote characters contained, | |
# by using the Here-Document method. | |
- trigger: ":dwq" | |
replace: "{{MyShell}}" | |
vars: | |
- name: Clipb | |
type: clipboard | |
- name: MyShell | |
type: shell |
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 | |
# Check if a search word is provided | |
if [[ -z "$1" ]]; then | |
echo "Usage: $0 <word>" | |
exit 1 | |
fi | |
SEARCH_WORD="$1" | |
CONFIG_DIR="$HOME/.config/espanso/match" |
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 Python script to invoke `espanso match exec -t <trigger>`, which gets around | |
# Espanso trying to delete the trigger characters (which don't exist when called | |
# in this manner) by injecting the characters first. | |
# An alternative to using: `xdotool sleep 0.2 type <trigger>` | |
# Either can be attached to a system hotkey. | |
#!/usr/bin/env python3 | |
import subprocess, sys, time | |
from pynput.keyboard import Controller, Key |
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 speed test between shell: and script | |
# No discernible difference here on Linux, but recommend using script: to avoid calling | |
# an unnecessary process | |
# Conversation at https://discord.com/channels/884163483409731584/1013916990760554608/1253033704599846973 | |
global_vars: | |
- name: code | |
type: echo | |
params: | |
echo: | |
NewerOlder