Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom save-location #2

Closed
riek-lt opened this issue Mar 27, 2022 · 3 comments
Closed

Custom save-location #2

riek-lt opened this issue Mar 27, 2022 · 3 comments

Comments

@riek-lt
Copy link

riek-lt commented Mar 27, 2022

situationI
Often be out of house for over a week, and since the default save location is appdata, I can't sync that up easily.
But I do use something like Google Drive and therefore could manage a cross-system save-settings thing.

Wanted solution
Not per se other system settings, but definitely the table data and filled-in days be thrown to a file in a location the user can set.
By doing it this way, I can on the main computer point it to c:/users/documents/info.db, and on another computer it imports data from d:/things/resoday/info.db, and make it still work.
So settings are different per computer, but actual calendar data is similar.

@rybak
Copy link
Owner

rybak commented Mar 27, 2022

That's a very reasonable request and I would consider implementing this.

There is a workaround: you can pass a path as an argument to Resoday. So far, it was only intended to be used for testing. It is currently not supported as a user-facing feature, so use it on your own risk:

java -jar resoday-release.jar <insert path to your directory here>

The directory will be used both for data and configuration files.


Here's another much-less-likely-to-work-on-Windows workaround. On Unix-like systems Resoday is compliant with XDG Base Directory Specification. Using the Specification, a user on a Unix-like system (e.g. Linux) can override environment variables XDG_DATA_HOME and XDG_CONFIG_HOME to control where Resoday puts the data and configuration files correspondingly. E.g. via a custom Bash script:

#!/usr/bin/bash
export XDG_DATA_HOME=...
export XDG_CONFIG_HOME=...
java -jar resoday-release.jar

For finding the paths to the directories Resoday uses library directories-jvm. The library also supports generating the paths to equivalent directories on Windows.

I don't know it is possible to override the paths generated for Windows in directories-jvm. Reading dirs-dev/directories-jvm#49 it seems that it's not possible. Some projects even roll their own implementation just for Windows to make overrides possible sbt/sbt#6408.

@rybak
Copy link
Owner

rybak commented Jun 10, 2022

Preliminary work started in branch https://github.com/rybak/resoday/tree/custom-data-dir

@rybak rybak closed this as completed in d3b35f4 Jul 9, 2022
@rybak
Copy link
Owner

rybak commented Jul 9, 2022

Released in v1.3.

rybak added a commit that referenced this issue Nov 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants