diff options
author | Ben Sima <ben@bsima.me> | 2024-05-16 13:15:15 -0400 |
---|---|---|
committer | Ben Sima <ben@bsima.me> | 2025-02-07 13:14:08 -0500 |
commit | 1bb0ee40e2ec38b035a94c382cf15b8ff2e2a65d (patch) | |
tree | 243160f7159af245b89f4a093a0e6b213b42bc82 | |
parent | aa1fc7460c04794c088ea2cb1b9d5486473f92a8 (diff) |
add gpg-reset-pinentry
-rwxr-xr-x | gpg-reset-pinentry | 16 | ||||
-rwxr-xr-x | nav | 6 |
2 files changed, 20 insertions, 2 deletions
diff --git a/gpg-reset-pinentry b/gpg-reset-pinentry new file mode 100755 index 0000000..4065d61 --- /dev/null +++ b/gpg-reset-pinentry @@ -0,0 +1,16 @@ +#!/usr/bin/env bash +# +# If I can't use gpg-agent for ssh, then it could be because the pinentry tty is +# locked. This can also happen if I try to sign a commit in emacs, and the +# pinentry minibuffer get eaten by the interface. In both cases, pinentry is +# pending, so I can't unlock the card, but I lost the pinentry and can't enter +# my pin, so I'm totally stuck. Took me forever to figure this out but thanks to +# SultanLegend on StackOverflow I figured it out. +# +# > I had the error when using gpg-agent as my ssh-agent and using a gpg subkey +# > as my ssh key https://wiki.archlinux.org/index.php/GnuPG#gpg-agent. I +# > suspect that the problem was caused by having an invalid pin entry tty for +# > gpg caused by my sleep+lock command used in my sway config +# +# source: https://stackoverflow.com/a/57116258 +gpg-connect-agent updatestartuptty /bye > /dev/null @@ -1,12 +1,12 @@ #!/usr/bin/env bash cat \ - <(echo "edit: enter | prnt: alt-enter | view: alt-0..6 | pgup/pgdn: scroll") \ + <(echo "edit: enter | prnt: alt-enter | view: alt-0..6 | pgup/alt-p/pgdn/alt-n: scroll window") \ <(fd --exclude=_ -t f . $PWD | sed "s,$PWD/*,,g") \ | fzf \ --bind "alt-enter:accept" \ --bind "enter:execute(vim {})" \ --bind "esc:ignore" \ - --bind "ctrl-/:change-preview-window(90%|hidden|)" \ + --bind "ctrl-/:change-preview-window(80%|60%|40%|hidden|)" \ --bind "alt-0:change-preview(bat -p --color always {})" \ --bind "alt-1:change-preview(git log --color=always --date=relative --abbrev-commit --pretty=format:'%Cred%h%Creset %s / %an %Creset%C(yellow)%d%Creset%Cgreen(%cr)%Creset' -- {})" \ --bind "alt-2:change-preview(git log --color=always {})" \ @@ -14,6 +14,8 @@ cat \ --bind "alt-4:change-preview(git blame -c --date=short {})" \ --bind "alt-5:change-preview(git log --pretty=short {} | git shortlog -nse)" \ --bind "alt-6:change-preview(git log --pretty=short {} | git shortlog)" \ + --bind "alt-p:preview-up" \ + --bind "alt-n:preview-down" \ --bind "pgup:preview-page-up" \ --bind "pgdn:preview-page-down" \ --bind "backward-eof:abort" \ |