Compare commits
2 Commits
98b2f461cd
...
858f68f9c6
| Author | SHA1 | Date | |
|---|---|---|---|
| 858f68f9c6 | |||
| 8578e23114 |
+1
-1
Submodule azos-core updated: 5450612860...66202e528f
@@ -12,6 +12,7 @@
|
|||||||
|
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(use-package lichess
|
(use-package lichess
|
||||||
|
:demand t
|
||||||
:init
|
:init
|
||||||
(defun azos/chess/open ()
|
(defun azos/chess/open ()
|
||||||
"Open lichess in its dedicated \"chess\" tab."
|
"Open lichess in its dedicated \"chess\" tab."
|
||||||
|
|||||||
@@ -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")))
|
(string-trim (shell-command-to-string "pass lichess.org/token 2>/dev/null | head -1")))
|
||||||
#+end_src
|
#+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
|
** Beacon Remote Jobs
|
||||||
|
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
|
|||||||
Reference in New Issue
Block a user