Add mutt and offlineimap config to edit mails on the terminal easily
This commit is contained in:
36
.local/bin/gmail-app-credentials
Executable file
36
.local/bin/gmail-app-credentials
Executable file
@@ -0,0 +1,36 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
type="$1"
|
||||
account="$2"
|
||||
jq_chain="."
|
||||
vault_type="text"
|
||||
|
||||
case "$type" in
|
||||
pass)
|
||||
jq_chain='select(.label == "gmail app-password") | .password'
|
||||
;;
|
||||
user)
|
||||
jq_chain='select(.label == "gmail app-password") | .login'
|
||||
;;
|
||||
realname)
|
||||
jq_chain='select(.label == "Real Name") | .password'
|
||||
;;
|
||||
email)
|
||||
vault_type="email"
|
||||
jq_chain='select(.password != "") | .password'
|
||||
;;
|
||||
smtp)
|
||||
vault_type="email"
|
||||
jq_chain='select(.password != "") | "smtp://" + .password + "@smtp.gmail.com:587/"'
|
||||
;;
|
||||
*)
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
enpasscli \
|
||||
-vault ~/Documents/Enpass/Vaults/primary \
|
||||
-json \
|
||||
--type "$vault_type" \
|
||||
show "Google ($account)" \
|
||||
| jq -r '.[] | '"$jq_chain"
|
||||
Reference in New Issue
Block a user