jplattel / open-note-to-window-title Goto Github PK
View Code? Open in Web Editor NEWSmall Obsidian plugin that updates the window title with the current open note
Small Obsidian plugin that updates the window title with the current open note
I'm using Obsidian v1.4.16 and whenever I switch notes I see a glimpse of the standard title before your plugin sets it as configured.
I get this error on console on Android on the new insider build.
Uncaught (in promise) TypeError: Cannot read properties of null (reading 'length')
at ActiveNoteTitlePlugin.eval (plugin:open-note-to-window-title:77:31)
at Generator.next (<anonymous>)
at eval (plugin:open-note-to-window-title:26:71)
at new Promise (<anonymous>)
at __awaiter (plugin:open-note-to-window-title:22:12)
at ActiveNoteTitlePlugin.onload (plugin:open-note-to-window-title:68:16)
at e.load (app.js:1:853135)
at e.<anonymous> (app.js:1:1035966)
at app.js:1:235201
at Object.next (app.js:1:235306)
v0.15.0 makes it so that "Window title will now include the active file name.", which breaks the way this plugin worked up until now. It should be easy to check for the version and work differently in new versions.
in windows, we mainly use \
to spilt filepath.
Very minor: I use the template {{filename}} ({{frontmatter.date}}) - {{vault}} - Obsidian
.
Now when changing my YAML frontmatter date:
variable, even followed by Ctrl+S, the title doesn’t change. Only after closing/reopening the note.
Is there a "file has changed" or "cache changed" event in the Obsidian API that catches this?
If not, I can live with it. It’s not different from some Dataview notes.
When I view pages in reading view, the title of my Obsidian window has the title as is set in the template in the preferences. When I change to edit mode, the title of the window doesn't have the title as set in the preference but it switches to the default title.
Am I doing something wrong?
Thanks for making this plugin, it's very useful. It allows me to properly track the time spend per workspace (topic) in my notes. And makes content-aware hotkeys possible too! 🙂
One thing that would be great is if the plugin can also change the title of new windows (Obsidian's 'Open current pane in new window' and 'Move current panel to new window' commands).
If this is too much work, no problem. I appreciate the work put into this plugin and don't want to add more workload.
Have a nice weekend!
It would be extremely helpful if this plugin had an option to grab metadata from the open note and display it in the window title. For people who track their time using automated time trackers (e.g., ActivityWatcher) this feature would allow them to track time spent across different categories of notes. This use-case is what caused me to think about this feature request.
Here is my full post on the Discord server that provides a little more detail:
I am trying to track the amount of time that I work on certain types of notes (e.g., evergreen, source, technical, or any other classification you want).
My current best idea for how to do this is to use an automated time tracking app (e.g., ActivityWatcher), which uses window titles to categorize activity. Thus, I need a way to determine note type from the text in the Window Title.
If I followed a specific note naming convention (e.g., all source notes start with a "!" or similar idea) then this could be possible using the features currently available in the Open Note to Window Title plug-in (https://github.com/jplattel/open-note-to-window-title by @jplattel). However, simply using note names seems somewhat restrictive in the long run (limits number of different categorizations and susceptible to future changes in workflow) and specific to my use case of tracking time by note type.
A more flexible method, if possible, would be to add the text of certain metadata to the Window Title. For example, adding a note's tags data would allow me to categorize my time based on anything that I add as a tag. Using a custom YAML key name would be even more flexible. Is this possible?
When I used open note to window title
plugin, and at the same time I installed another plugin named search on the internet
; When I used the iframe feature to search stuff in Obsidian, and then I used hotkey to close the iframe windows the latter plugin created. The left sidebar would be toggled and show (if it is hided before)
This is not a big problem and will not cause any crush. So far, the only effect is errors shown in the Console (alt+cmd+i
) as below:
VM267:133 Uncaught (in promise) TypeError: Cannot read properties of null (reading 'path')
at ActiveNoteTitlePlugin.refreshTitle (eval at <anonymous> (app.js:1:1), <anonymous>:133:68)
at ActiveNoteTitlePlugin.eval (eval at <anonymous> (app.js:1:1), <anonymous>:46:18)
at Generator.next (<anonymous>)
at eval (eval at <anonymous> (app.js:1:1), <anonymous>:26:71)
at new Promise (<anonymous>)
at __awaiter (eval at <anonymous> (app.js:1:1), <anonymous>:22:12)
at ActiveNoteTitlePlugin.handleDelete (eval at <anonymous> (app.js:1:1), <anonymous>:45:39)
at t.e.tryTrigger (app.js:1:903075)
at t.e.trigger (app.js:1:903008)
at t.trigger (app.js:1:919684)
However, I usually open the console panel, and sometimes, I need to delete some temp notes, and the red error text is really annoying... I am wondering if it could be fixed...
the content of the related line is:
template = Object.assign({ 'parentpath': (file.parent).path, 'filepath': file.path, 'filename': file.name, 'basename': friendlyBasename, 'extension': file.extension }, template);
Most people expect the window title to go from the smallest to the largest entity, like "file – vault – app". On smaller windows, the title would also be in front, thus recognizable. Btw, all browsers do it like this.
Would you mind changing that?
Or make it templatable in the settings, like doing something on the lines of
{{filename}} – {{vault}} – {{app}}
If so, it might be nice to have two "file" templates: One for the file "title" (just filename, without extension) and one for the full file path (including extension).
When updating to the latest version of the plugin from the Obsidian community plugin list, the default template would be Obsidian - {vault} - {filename}
, instead of Obsidian - {{vault}} - {{filename}}
.
Heya, in the template example I see 'filepath' and 'filename'. Filepath includes the filename, any chance that it could go without the filename? I'd like to just display the path instead.
I am currently using Keyboard maestro. There is a trigger "when the window's title change". If I click the link or click the file from the side bar, the trigger will work. However, If I use command + arrow key to navigate the file, it will not triggering the macro. It might not be the issue of this plugin cos I download the old version of this plugin and it still have this problem. Hopefully you can give some suggestion to solve this problem.
Thanks in advance.
I'd really like to use this plugin! Like many people, however, I'm a big fan of the @kepano's "Minimal" theme and I can't get it to work with this plugin. Any suggestions? I've tried adding a snippet with the text below, but that is not doing it.
.titlebar-text {
display: static;
}
Hey Joost! 👋
Thank you for publishing this plugin! I use Timing too and this is exactly what I was looking for. Unfortunately, I can't get it to load 😞
I'm on Obsidian 0.11.0 / macOS 11.2
I'm cloning the repo into my .obsidian/plugins
directory...
gh repo clone jplattel/open-note-to-window-title
And then reloading Obsidian. I do see the plugin listed
but trying to switch it on results in an error
I note there is no main.js
in the repo, only main.ts
. Seems like the API for the entrypoint may have changed recently. Are you able to point me in the right direction? Very much appreciated!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.