unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* [tab-bar] How to show something in the right side?
@ 2021-06-25 15:22 Rodrigo Morales
  2021-06-25 21:18 ` Stephen Berman
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Rodrigo Morales @ 2021-06-25 15:22 UTC (permalink / raw)
  To: help-gnu-emacs


* The question

Have any of you managed to insert some content in the right side of the
tab-bar (the one that is shown when tab-bar-mode is enabled)?

For those who don't know, the current behavior of =tab-bar-mode= is to
show the name of opened tabs starting from the left side, so if you have
3 tabs opened and your font is small enough, the names will fill the bar
less than the middle of the screen. This means that there is an empty
space that could be used for something else. For this reason, I would
like to show the current time (i.e. 10:10AM) in that part of the screen
because most of the time that part is empty. Some users use "polybar"
for accomplishing this, but I was wondering whether it was possible to
do this with "tab-bar-mode" without much tinkering.

* Additional context

I could also make the time be shown in my screen with
=display-time-mode=, but I don't particularly like this because this
makes the time be shown in all modelines, so if I have 4 buffers, the
time is shown in the modeline of each buffer (i.e. 4 times). I would
rather the time be shown just once.



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [tab-bar] How to show something in the right side?
  2021-06-25 15:22 [tab-bar] How to show something in the right side? Rodrigo Morales
@ 2021-06-25 21:18 ` Stephen Berman
  2021-06-28 12:16 ` Eric S Fraga
  2021-06-28 12:17 ` Eric S Fraga
  2 siblings, 0 replies; 4+ messages in thread
From: Stephen Berman @ 2021-06-25 21:18 UTC (permalink / raw)
  To: Rodrigo Morales; +Cc: help-gnu-emacs

On Fri, 25 Jun 2021 10:22:21 -0500 Rodrigo Morales <moralesrodrigo1100@gmail.com> wrote:

> * The question
>
> Have any of you managed to insert some content in the right side of the
> tab-bar (the one that is shown when tab-bar-mode is enabled)?
>
> For those who don't know, the current behavior of =tab-bar-mode= is to
> show the name of opened tabs starting from the left side, so if you have
> 3 tabs opened and your font is small enough, the names will fill the bar
> less than the middle of the screen. This means that there is an empty
> space that could be used for something else. For this reason, I would
> like to show the current time (i.e. 10:10AM) in that part of the screen
> because most of the time that part is empty. Some users use "polybar"
> for accomplishing this, but I was wondering whether it was possible to
> do this with "tab-bar-mode" without much tinkering.
>
> * Additional context
>
> I could also make the time be shown in my screen with
> =display-time-mode=, but I don't particularly like this because this
> makes the time be shown in all modelines, so if I have 4 buffers, the
> time is shown in the modeline of each buffer (i.e. 4 times). I would
> rather the time be shown just once.

Juri Linkov, the author of tab-bar-mode, offered this way to do that
(see https://lists.gnu.org/archive/html/emacs-devel/2019-10/msg00685.html):

(advice-add 'tab-bar-make-keymap-1 :around
  (lambda (orig-fun)
    (append (funcall orig-fun)
            `((display-time menu-item
               ,(concat
                 (propertize " " 'display '(space :align-to (- right 5)))
                 (format-time-string "%H:%M"))
               ignore))))
  '((name . tab-bar-display-time)))

Steve Berman



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [tab-bar] How to show something in the right side?
  2021-06-25 15:22 [tab-bar] How to show something in the right side? Rodrigo Morales
  2021-06-25 21:18 ` Stephen Berman
@ 2021-06-28 12:16 ` Eric S Fraga
  2021-06-28 12:17 ` Eric S Fraga
  2 siblings, 0 replies; 4+ messages in thread
From: Eric S Fraga @ 2021-06-28 12:16 UTC (permalink / raw)
  To: help-gnu-emacs

On Friday, 25 Jun 2021 at 10:22, Rodrigo Morales wrote:
> * The question
>
> Have any of you managed to insert some content in the right side of the
> tab-bar (the one that is shown when tab-bar-mode is enabled)?

I have the following:

#+begin_src emacs-lisp
  (setq display-time-day-and-date t)
  (display-time)
  (add-to-list 'tab-bar-format 'tab-bar-format-align-right t)
  (add-to-list 'tab-bar-format 'tab-bar-format-global t)
#+end_src 

which seems to automatically add the time/date display that appears in
the mode-line to the tab bar at the right.

I think that's all I had to do.

Emms track information is also meant to appear but only the first track
played does for some reason.  I have not had the (spare) time to figure
out why this is.

-- 
Eric S Fraga via Emacs 28.0.50 & org 9.4.6 on Debian bullseye/sid




^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [tab-bar] How to show something in the right side?
  2021-06-25 15:22 [tab-bar] How to show something in the right side? Rodrigo Morales
  2021-06-25 21:18 ` Stephen Berman
  2021-06-28 12:16 ` Eric S Fraga
@ 2021-06-28 12:17 ` Eric S Fraga
  2 siblings, 0 replies; 4+ messages in thread
From: Eric S Fraga @ 2021-06-28 12:17 UTC (permalink / raw)
  To: help-gnu-emacs

Arggghhhhh I did not fully read/comprehend your second paragraph so
please ignore my other post! ;-)
-- 
Eric S Fraga via Emacs 28.0.50 & org 9.4.6 on Debian bullseye/sid




^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-06-28 12:17 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-06-25 15:22 [tab-bar] How to show something in the right side? Rodrigo Morales
2021-06-25 21:18 ` Stephen Berman
2021-06-28 12:16 ` Eric S Fraga
2021-06-28 12:17 ` Eric S Fraga

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).