Compare commits

..

2 Commits

Author SHA1 Message Date
aner 858f68f9c6 Lazily retry lichess token fetch; demand-load lichess package
gpg-agent may not have a cached passphrase yet when the top-level setq
runs at Emacs startup, so a cold agent makes 'pass' fail silently
(stderr redirected) and leaves lichess-token permanently empty for the
session. Retry the fetch right before each use instead of only once
at startup.
2026-10-06 00:30:30 +03:00
aner 8578e23114 Bump azos-core: org-roam-resync hook, no-Emacs-dependency 2026-10-06 00:30:00 +03:00
3 changed files with 17 additions and 1 deletions
+1
View File
@@ -12,6 +12,7 @@
#+begin_src emacs-lisp
(use-package lichess
:demand t
:init
(defun azos/chess/open ()
"Open lichess in its dedicated \"chess\" tab."
+15
View File
@@ -295,6 +295,21 @@ Redirect stderr away so only the token itself is ever captured.
(string-trim (shell-command-to-string "pass lichess.org/token 2>/dev/null | head -1")))
#+end_src
=gpg-agent= may not have a cached passphrase yet when the =setq= above
runs at Emacs startup, in which case =pass= fails silently (stderr is
redirected away) and =lichess-token= is left as =""=. Retry the fetch
lazily right before each actual use, so a cold agent at startup
doesn't permanently wedge the token for the rest of the session.
#+begin_src emacs-lisp
(with-eval-after-load 'lichess
(advice-add 'lichess-token :before
(lambda ()
(when (string-empty-p lichess-token)
(setq lichess-token
(string-trim (shell-command-to-string "pass lichess.org/token 2>/dev/null | head -1")))))))
#+end_src
** Beacon Remote Jobs
#+begin_src emacs-lisp