reddit / emacs

Display clock only in bottom right mode line

Thin-Ice-7955 · 2022-02-04 12:52
As a space-saving alternative to the tab bar a global mode line one can display information only in mode line in the bottom right corner, for example the date and time: (defun display-time-bottom-right () (and (equal (cddr (window-pixel-edges)) (cddr (window-pixel-edges (frame-root-window)))) '(#(" " 0 1 (display (space :align-to (- right 20)))) display-time-string))) (display-time-mode) (setq global-mode-string '(:eval (display-time-bottom-right)))
HM0880 · 2022-02-05 02:29
Thanks for sharing! I learned the `window-pixel-edges` and `frame-root-window` functions from this.