Skip to content

Instantly share code, notes, and snippets.

@rhaberkorn
Created September 14, 2025 14:25
Show Gist options
  • Save rhaberkorn/6935eebef817aa35e976a27b3d09df1a to your computer and use it in GitHub Desktop.
Save rhaberkorn/6935eebef817aa35e976a27b3d09df1a to your computer and use it in GitHub Desktop.
Update Aerc's accounts.conf after regenerating the Gmail refresh token
#!/usr/local/bin/sciteco -8qm
!*
* To update the Gmail refresh token in accounts.conf, first run
* oauth2.py --generate_oauth2_token --user="[email protected]" --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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment