aboutsummaryrefslogtreecommitdiff
path: root/gmail-refresh-token.tes
diff options
context:
space:
mode:
Diffstat (limited to 'gmail-refresh-token.tes')
-rwxr-xr-xgmail-refresh-token.tes13
1 files changed, 13 insertions, 0 deletions
diff --git a/gmail-refresh-token.tes b/gmail-refresh-token.tes
new file mode 100755
index 0000000..fc3137d
--- /dev/null
+++ b/gmail-refresh-token.tes
@@ -0,0 +1,13 @@
+#!/usr/local/bin/sciteco -8qm
+!*
+ * To update the Gmail refresh token in Aerc's accounts.conf, first run
+ * oauth2.py --generate_oauth2_token --user="user@gmail.com" --client_id="<CLIENT_ID>" --client_secret="<CLIENT_SECRET>"
+ * ./gmail-refresh-token.tes <refresh-token>
+ *!
+:Q[^A1]"< 1^C^C '
+!* URL-encode the refresh token *!
+@EQ[^A1]// <0A:; @I/%/ 0A-16"<@I/0/' 16^R0A\^D D>
+@EB'accounts.conf' HXa @E%a'accounts.conf.bak'
+@S/imaps+oauthbearer:/ @S/:/ @FK/@/ G[^A1] L
+@S/smtps+oauthbearer:/ @S/:/ @FK/@/ G[^A1]
+:EX