Skip to content

Instantly share code, notes, and snippets.

@smeech
Last active August 8, 2025 18:50
Show Gist options
  • Save smeech/53fe4ae0d91e645200337f43099bf578 to your computer and use it in GitHub Desktop.
Save smeech/53fe4ae0d91e645200337f43099bf578 to your computer and use it in GitHub Desktop.
[Encrypted expansion] A working Espanso trigger that securely decrypts a string (such as an address) using a password prompt, and expands it into your target app. First encrypt your address (once only) and store it securely: `echo "123 Fake Street, Faketown, FK1 2AB" | gpg -c -o ~/.secrets/homeaddr.gpg` ensuring the target directory exists first…
# First encrypt your address (once only) and store it securely:
# `echo "123 Fake Street, Faketown, FK1 2AB" | gpg -c -o ~/.secrets/homeaddr.gpg`
# ensuring the target directory exists first.
matches:
- trigger: ":homeaddr"
replace: "{{address}}"
vars:
- name: address
type: script
params:
args:
- bash
- -c
- |
source ~/.zshrc 2>/dev/null || true
PASSWORD="$(zenity --password --title='Decrypt Address')"
[ -z "$PASSWORD" ] && exit 1
echo "$PASSWORD" | gpg --batch --yes --passphrase-fd 0 --decrypt ~/.secrets/homeaddr.gpg 2>/dev/null
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment