feat(emacs.d): Display modeline time in dottime
See dotti.me for more information about dottime. <3 edef
This commit is contained in:
parent
c1ba41a62d
commit
1f204f2891
1 changed files with 14 additions and 0 deletions
|
@ -31,6 +31,20 @@
|
|||
(when (equal "adho" (system-name))
|
||||
(setq battery-mode-line-format " %b%p%%")
|
||||
(display-battery-mode))
|
||||
;; Display modeline time in dottime (see https://dotti.me)
|
||||
;;
|
||||
;; This is done in a way that initially seems more complicated than
|
||||
;; one would like, but this is unfortunately required due to the way
|
||||
;; `format-time-string' handles timezones.
|
||||
(defun format-dottime-advice (orig _ &optional _ _)
|
||||
(let* ((offset-sec (car (current-time-zone)))
|
||||
(offset-hours (/ offset-sec 60 60))
|
||||
(dottime (if (/= offset-hours 0)
|
||||
(concat "%M-%Dt%H·%M" (format "%0+3d" offset-hours))
|
||||
"%m-%dT%H·%M")))
|
||||
(apply orig '("%m-%dT%H·%M" nil t))))
|
||||
|
||||
(advice-add 'format-time-string :around #'format-dottime-advice)
|
||||
|
||||
;; Configure telephone-line
|
||||
(defun telephone-misc-if-last-window ()
|
||||
|
|
Loading…
Reference in a new issue