Your name is an answer, not a constant
The :fn/:em espanso triggers hardcoded one person's name and email in a match file shipped to every user -- a misfire that lands inside their own prose, where they are least likely to notice. setup-identity now seeds match/identity.yml, per-machine and gitignored, from the same interview answers that already configure git.
This commit is contained in:
@@ -1,5 +1,7 @@
|
|||||||
# Ignore bash environment variables.
|
# Ignore bash environment variables.
|
||||||
/config/bash/env
|
/config/bash/env
|
||||||
|
# Personal espanso triggers (name, email), seeded per-machine by setup-identity.
|
||||||
|
/config/dot/espanso/match/identity.yml
|
||||||
# Ignore backups of old config files
|
# Ignore backups of old config files
|
||||||
/config/old
|
/config/old
|
||||||
# Ignore Wireguard config of course!
|
# Ignore Wireguard config of course!
|
||||||
|
|||||||
@@ -1,17 +1,9 @@
|
|||||||
# espanso match file
|
# espanso match file
|
||||||
# https://espanso.org/docs/
|
# https://espanso.org/docs/
|
||||||
|
# Name and email triggers (:fn, :em, ...) are NOT here: they are personal, and
|
||||||
|
# this file is shared. setup-identity seeds them into match/identity.yml --
|
||||||
|
# per-machine, gitignored, yours to edit -- from the install interview.
|
||||||
matches:
|
matches:
|
||||||
# Name
|
|
||||||
- trigger: ":fn"
|
|
||||||
replace: "Gabriel Brown"
|
|
||||||
- trigger: ":fin"
|
|
||||||
replace: "Gabriel A Brown"
|
|
||||||
# Email
|
|
||||||
- trigger: ":em"
|
|
||||||
replace: "[email protected]"
|
|
||||||
- trigger: ":empro"
|
|
||||||
replace: "[email protected]"
|
|
||||||
|
|
||||||
# Date
|
# Date
|
||||||
- trigger: ":date"
|
- trigger: ":date"
|
||||||
replace: "{{mydate}}"
|
replace: "{{mydate}}"
|
||||||
|
|||||||
@@ -41,6 +41,26 @@ git config --global alias.st status
|
|||||||
git config --global pull.rebase true
|
git config --global pull.rebase true
|
||||||
log "git aliases and pull.rebase applied"
|
log "git aliases and pull.rebase applied"
|
||||||
|
|
||||||
|
# Text-expansion identity. The :fn/:em triggers used to hardcode the repository
|
||||||
|
# owner's name and email in the shared match file; each machine now writes its
|
||||||
|
# own from the interview's answers. Per-machine and gitignored -- espanso loads
|
||||||
|
# every file under match/, so it sits beside base.yml without being shared.
|
||||||
|
# Kept when it already exists: the file is the user's to edit, and a re-run
|
||||||
|
# must not erase what they added.
|
||||||
|
espanso_identity="${XDG_CONFIG_HOME:-$HOME/.config}/espanso/match/identity.yml"
|
||||||
|
if [[ -d "$(dirname "$espanso_identity")" && ! -e "$espanso_identity" ]] \
|
||||||
|
&& [[ -n "$git_name" || -n "$git_email" ]]; then
|
||||||
|
{
|
||||||
|
printf '# Personal expansion triggers, seeded from the install interview.\n'
|
||||||
|
printf '# Per-machine and untracked: add your own freely.\n'
|
||||||
|
printf 'matches:\n'
|
||||||
|
[[ -n "$git_name" ]] && printf ' - trigger: ":fn"\n replace: "%s"\n' "$git_name"
|
||||||
|
[[ -n "$git_email" ]] && printf ' - trigger: ":em"\n replace: "%s"\n' "$git_email"
|
||||||
|
:
|
||||||
|
} > "$espanso_identity"
|
||||||
|
log "Seeded espanso identity triggers at $espanso_identity"
|
||||||
|
fi
|
||||||
|
|
||||||
if [[ "${PANAMA_GH_LOGIN:-no}" == yes ]]; then
|
if [[ "${PANAMA_GH_LOGIN:-no}" == yes ]]; then
|
||||||
if command -v gh >/dev/null 2>&1; then
|
if command -v gh >/dev/null 2>&1; then
|
||||||
log "Signing in to GitHub"
|
log "Signing in to GitHub"
|
||||||
|
|||||||
Reference in New Issue
Block a user