LibreraReader icon indicating copy to clipboard operation
LibreraReader copied to clipboard

Feature: watch filesystem for changes

Open natebragg opened this issue 1 year ago • 2 comments

When I close a file, then modify it outside of Librera (e.g., rebuild it using pdflatex), sometimes a cached version shows up when I open it again (strangely, sometimes it opens the new one). My workaround is to delete the file inside Librera's directory view. It would be nice if Librera hooked filesystem changes so I could just close and reopen it.

If this is possible, it would also be nice if Librera would autoreload and redisplay the file on change even if the file is open on the screen. Or possibly open a dialog that says "the file has changed, would you like to reload? y/n"

natebragg avatar Apr 11 '24 14:04 natebragg

Is it possible to hook that without the app running constantly? Another option would be some heuristics, like caching the file size, mtime/ctime, maybe a hash on some parts of the file (not just the beginning to make sure adding new content at the end also triggers it).

TheHardew avatar Dec 11 '24 21:12 TheHardew

That's a good solution, too. Switching back to the file could trigger one of those heuristics.

natebragg avatar Dec 15 '24 15:12 natebragg