Project Title in Tree View Tab (help wanted)


I would like to replace the Tree View Tab title from “Project” to the current Project name.

I found in this discussion that the tab can be accessed something like this: document.querySelector('[data-type="TreeView"]').parentNode

Also I found this from this issue:

atom.packages.onDidActivatePackage (pack) ->
        if == 'project-manager'
            atom.packages.getActivePackage('project-manager').mainModule.provideProjects().getProject (project) ->
                console.log project

In theory, if I edit my file, I can access the current Project title, but I know nothing about Coffee Script, nor the Atom API.

So if somebody would help me, I would really appreciate.

Thanks in advance


I know nothing about Coffee Script

What about JavaScript? You can write everything in JavaScript if you want (eg. use init.js).

Sorry, I can’t help you with the actual issue though.


Thanks for the tip!
I 'd try with plain JS


You can get the node for the title text with document.querySelector('[data-type="TreeView"]>.title') (though there might be a better selector?) and change it with textContent or some such.

The snippet you posted is based on the package project-manager.
Do you use it? If so, then the snippet should work for you. There are coffeescript to javascript converters online, so you should be able to convert & reuse the snippet if you prefer it in javascript.


Thank you all for help!