varsderk · 2022-07-20 15:29
I use `tab-bar-mode` a lot. I also have a lot of stuff on my mode-line. I used to use Emacs such that I could see the clock on my OS, but now I want to try using Emacs entirely full-screen; problem is, I don't have a clock any more. I used to have it on the mode-line, but I didn't like how the time was replicated *everywhere*, and it was taking up space that I wanted for other things.
Is there a way to put a clock, say, in the right side of the tab-bar? This is a little line of space that is almost *never* in use, so it'd be perfect.
**Update**: Here's a hack that I *don't* recommend, but it was kinda fun to figure out: it uses a posframe and a timer to get it to display: https://paste.sr.ht/~ashton314/4d490af6b4c6ae2f00012c8d807383001b242f1e
There are some better suggestions in the comments, which I'll probably be using. :)
**2nd Update**: Thanks to u/karthink, I've found a solution that works perfectly:
```lisp
(add-to-list 'tab-bar-format 'tab-bar-format-align-right 'append)
(add-to-list 'tab-bar-format 'tab-bar-format-global 'append)
(setq display-time-format "%a %e %b %T")
(setq display-time-interval 1)
(display-time-mode)
```
revex_ · 2022-07-20 15:54
New to Emacs haven't used the tab bar. `C-h v` showed me `tab-bar-format` which you could set to something like `(setf tab-bar-format '(tab-bar-format-history tab-bar-format-tabs tab-bar-separator tab-bar-format-add-tab current-time-string))`
Doesn't appear to refresh often though
karthink · 2022-07-20 16:06
The built-in solution requires Emacs 28. Add `tab-bar-format-global` to `tab-bar-format`:
(add-to-list 'tab-bar-format 'tab-bar-format-global 'append)
Now turning on `display-time-mode` should display it in the tab bar instead of the mode-line. This works for any text that is otherwise displayed in the `global-mode-string`.
varsderk · 2022-07-20 16:47
Hey that works pretty well! Is there a way to get the time to move all the way over to the right?
karthink · 2022-07-20 17:16
Add `tab-bar-format-align-right` at the desired position to `tab-bar-format`. See the doc for more details.
varsderk · 2022-07-20 17:19
I just found that in the docstring before reading this. :) I've updated my original post with the final solution.
Thank you so much for your help in pointing me to the right place!
ieure · 2022-07-20 20:16
Not in the tab bar, but I found Symon a while back. It's abandoned, but it displays monitors in the echo area. I picked it up, rewrote a bunch, and renamed it [lemon](https://gitlab.com/ieure/lemon).
I use it every day, give it a shot if you like. It's not perfect, but works alright for me, and the other things I've tried have been worse in some way or another.
varsderk · 2022-07-21 17:02
This is a very nice recommendation. I'll have to give this a look. Thanks!