Altering the window titlebar to include time and other indicator icons?

I personally like a very minimal work space so that the main content of any active window gets as much screen space as possible. As such I use the dash-to-panel gnome extension to get rid of the dock and have the top panel hidden unless the mouse moves down to the bottom of the screen. However, I would like to be able to check the time and see battery life on my laptop with a quick glance rather than showing the top panel (or, in my case, it’s at the bottom). Is there anyway that you know of to alter the window manager to add the time/date to the window title bar next to the close/expand/minimize buttons? I would also like to add other indicator icons in the active window as well if possible. If this cannot be done without changing the source code then I would love to dive in and try to write some code of my own. I have working knowledge of C, C++, and Python so I am sure I could make some of the necessary changes myself if someone can direct me to how to get started and the source code for the window manager.

Thanks! Also, I apologize if this is not posted in the correct area, I am new to this forum.

For legacy applications with old-style titlebars, you are getting it backwards, you should add the title to the panel instead (not that I think it’s a good idea, though). For new applications with rich headerbars it’s up to the application how to organize the bar with app-specific buttons, menus and stuff; you can be pretty sure downstream developers would dislike their apps being hacked the way you propose. In any case, you should request this change elsewhere, probably gtk gitlab. Be prepared for downright rejection though :frowning:

I had your same issue, especially because Gnome shell’s titlebars are so huge. I installed the Unite extension to save more space at the top, which combined with Ubuntu dock (with hidden setting) can likely maximise your space.

E.g. using PyCharm the only thing you can see except for the window is the top bar.

You can also make the topbar thinner reducing the font size in Gnome Tweaks (this requires to go in the fonts tab, then reduce the scaling factor, but eventually increase the interface font if it gets too small, the latter doesn’t interfere with the top bar size).

Thanks for the reply! I will post this over at gtk gitlab. Question for you, because there is extra room for the close/maximize buttons, why shouldn’t there be enough space to add date and time as well if I reduced the space for the other window buttons? The configuration settings for window buttons allows for extended spaces as well, which, by definition, takes up more space of the titlebar so my proposed time/date extension shouldn’t interfere that much with what other developers can do with their apps.

Thanks! I’ll play around with the Unite extension and see how that feels.

1 Like

They’re not really fond of the mxximize and close buttons either, I think nowadays they are not even part of the vanilla experience. Anyway, those are just two buttons. If you allow for an arbitrary number of components that are either replicated in each window or rearrange the current window headerbar each time you switch focus, and this in otherwise already cluttered headerbars…