Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am dougpagani on github.
  • I am dougpagani (https://keybase.io/dougpagani) on keybase.
  • I have a public key ASDiMu-hDDGoUYTXGi1tF_AbUs6kNlSCiy1LjRPidaFkkAo

To claim this, I am signing this object:

@dougpagani
dougpagani / add-espanso-entry-new.sh
Last active January 20, 2025 17:11
Dylan's Espanso script, before and after
#!/bin/bash
FORM_OUTPUT=$(zenity --forms \
--add-entry "trigger:" \
--add-entry "replacement:" \
--add-combo "word:" --combo-values="false|true" \
--add-combo "propagate case:" --combo-values="true|false")
TRIGGER=$(echo $FORM_OUTPUT | cut -d "|" -f1 | tr -d '[:space:]')
REPLACE=$(echo $FORM_OUTPUT | cut -d "|" -f2 | tr -d '[:space:]')
# obviously need to modify this, just an example
examples=($(find "$EXAMPLE_FILES_DIR" -iname "*.${extension}"));
PS3='Select which file: ';
select opt in "${examples[@]}";
do
vim "${opt}" && printf "${opt}" | pbcopy && break;
done;
function asdf() {
return 0
}
function show-something-cool() {
thing
return 0
}
ssh-isolate-access() {
cat ~/.ssh/id_rsa.pub | command ssh "$@" '
cat > ~/newakeys;
nohup bash -c '"'"'trap "" HUP; echo $$ > ~/killme && sleep 10 && mv -f ~/authorized_keys ~/.ssh/authorized_keys;'"'"' </dev/null &>/dev/null & disown;
mv ~/.ssh/authorized_keys ~/authorized_keys &&
mv ~/newakeys ~/.ssh/authorized_keys;
echo DONE: close connection
'
}