How to change/customize atom Title Bar?


#1

I have many atom windows open, often they are open folders to npm packages. Many of these windows are open to package.json files, or similarly named files. I want the window title bar to show the top-level folder name, not an absolute path “/foo/bar/…/” as this information gets cut off, leaving only the prefix which is the same across many open atom editor windows.

How could I customize the title bar?

Ideally I would want something like 1 folder level (the folder atom is open to), a dash (-) and then the name of the file that window has selected in the current tab (with no folder prefixes).

What I mean by a Title Bar: http://en.wikipedia.org/wiki/Title_bar

This should hopefully also customize the window selector in windows 8.1, (I think the title bar text is re-used).

It looks like I would have to change what get rendered into the html title element in the dom, where is the code that renders the title element in each document?

I think I found the method:
(I can’t put more links because I am new user):
h ttps://github.com/atom/atom/blob/master/src/workspace.coffee#L156

how could I override this method in atom config?


#2

I made a package to override the default title bar: https://atom.io/packages/custom-title

To show the project name instead of its path, you’d want to use a template like:

<%= fileName %><% if (projectPath) { %> - <%= projectName %><% } %> - Atom


#3

Awesome, got my star!


#4

Exactly what I wanted too. Thanks!


#5

I’m new to Atom. I’m coming from Sublime Text 3 which had this feature built in so I was used to it.
I’m trying to use the package postcasio provides but not having success in using it. I’m on Atom 1.4.3 and after placing even the simple string <%= filePath %> I instead see “untitled - Atom” for all tabs in my project.
Virtually any string suggested does not return anything different. Does 1.4.3 of Atom break this package?


#6

I have since found that the package is working (sort of) in Atom 1.4.3. It appears for me to be a title bar refresh issue. I can change tabs containing open files but the title does not update/refresh. If I click to another window I have open, then back to Atom, the refresh is forced and it does indeed show the right filename path.

I have also seen this refresh issue without the custom-title package installed as far as the title bar background color goes. I’ve seen Atom not fully refresh the color of the title bar, showing only a portion of it with the default Windows navy blue background color.


#7

If you have a refresh problem like I described above, here is a workaround from jackomat:


#8

This is a duplicate of a previous topic:

We like to unify similar discussions under one topic so that people don’t have to read a bunch of different threads to get the whole story. Please continue the discussion there. I’m closing this topic as duplicate.


#9