From a3c3b73a00f4e034ffeae11f20b00d1eb948a6e6 Mon Sep 17 00:00:00 2001 From: TEC Date: Thu, 27 Oct 2022 00:47:53 +0800 Subject: [PATCH] Add hover text to modeline clock image --- config.org | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/config.org b/config.org index d24afa9..b86aa5b 100644 --- a/config.org +++ b/config.org @@ -4005,6 +4005,8 @@ which is exactly what we need. With that sorted, we just add some caching and the obvious customisations and we've got modeline-appropriate clock generation! #+begin_src emacs-lisp +(require 'svg) + (defvar +doom-modeline-micro-clock-minute-resolution 1 "The clock will be updated every this many minutes, truncating.") (defvar +doom-modeline-micro-clock-inverse-size 2.8 @@ -4012,7 +4014,10 @@ the obvious customisations and we've got modeline-appropriate clock generation! (defvar +doom-modeline-micro-clock--cache nil) -(require 'svg) +(defvar +doom-modeline-clock-text-format "%c") + +(defun +doom-modeline--clock-text (&optional _window _object _pos) + (format-time-string +doom-modeline-clock-text-format)) (defun +doom-modeline-micro-clock () "Return a string containing an current analogue clock." @@ -4037,7 +4042,9 @@ the obvious customisations and we've got modeline-appropriate clock generation! " " 'display (append (get-text-property 0 'display (buffer-string)) - '(:ascent center))))))))) + '(:ascent center)) + 'face 'doom-modeline-time + 'help-echo #'+doom-modeline--clock-text))))))) #+end_src With clock generation sorted out, all that's to be done is replacing the =time=