hamster icon indicating copy to clipboard operation
hamster copied to clipboard

Symlink'd db and template

Open ezeedub opened this issue 1 year ago • 2 comments

I've recently switched to using the flatpak version, and would like to manage my modifications to report_template.html the same way I did before using the package manager version.

Using the package manager version, I kept the file in a separate folder for revision control, and then symlinked to it from ~/.local/share/hamster.

Using flatpak, I have tried similar by symlinking to the file from ~/.var/app/org.gnome.Hamster/data/hamster (per the instructions on the default template. I've also tried ~/.local/share/flatpak/exports/share/hamster.

The problem I'm having is that when I run an export with flatpak run org.gnome.Hamster export html YYYY-MM-DD YYYY-MM-DD I get the default template. If I replace the symlink with the actual file, I get my customized template.

Hamster seems not to see the report if it's a symlink. Am I running the export incorrectly, or is there something I can do to make the symlink work?

I have the same issue for hamster.db which I'd like to keep in my custom folder. I can load the file, but not through the symlink.

ezeedub avatar Feb 02 '24 18:02 ezeedub

I do not have much experience with flatpak, but my first thought would be that the problem is not the symlink, but that the target of the symlink is not available inside the flatpak. Maybe additional permissions could be assigned to the flatpak to give it access to your entire homedir (I recall this is how it works with snap, not sure about flatpak).

If I replace the symlink with the actual file, I get my customized template.

Could this just be a solution? And if you want to keep the native package usable as well without duplication the file, you could consider making the symlink the other way around? (Not saying this is a perfect solution and we should not look into the issue, but if this is a limitation inherent to the flatpak concept, it might be hard to fix)

matthijskooijman avatar Feb 03 '24 11:02 matthijskooijman

Good tip. I'll look into how to give flatpak the permissions it needs. I'll update here when I find something.

I already have a well-established system of files I control/override like this that I keep in a repo so I can track changes over time. I usually come back to something a year or two later, and have no memory of what I did before, so I like to have the history.

But for now, I will definitely stick with the workaround and just leave the actual file in that location. Thanks for the response!

ezeedub avatar Feb 05 '24 18:02 ezeedub