TriliumNext / Notes

Build your personal knowledge base with TriliumNext Notes
GNU Affero General Public License v3.0
739 stars 37 forks source link

Open in file manager of Trilium's data directory #389

Closed SiriusXT closed 3 weeks ago

SiriusXT commented 4 weeks ago

Related to https://github.com/TriliumNext/Notes/issues/86

SiriusXT commented 4 weeks ago

This is a nice feature, but for me it does have a slight issue: on Windows when I click the link, Windows Explorer is opened behind Trilium, with the icon in the taskbar flashing.

From what I see it would theoretically be possible to use electron.shell.openPath instead, which does seem to open it in the foreground. The only problem is that this has to be done from the server-side/Electron main thread, and not from the renderer thread. You would have to send a message over on IPC to open the data directory. Is this something you would like to look into?

The directory is currently opened via electron.shell.openPath, but it still seems to open in the background

zerebos commented 2 weeks ago

Here is the relevant electron issue: https://github.com/electron/electron/issues/36765 seems like it's unlikely to be fixed by them considering they never responded or acknowledged it. There are some workarounds posted there using explorer.exe but it's not a perfect solution since some users could have a different file explorer registered as default.