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

XDG Base Directories #3285

Closed
Deide opened this issue Mar 29, 2019 · 4 comments
Closed

XDG Base Directories #3285

Deide opened this issue Mar 29, 2019 · 4 comments
Labels

Comments

@Deide
Copy link

Deide commented Mar 29, 2019

I've noticed that in #3242, XDG_CONFIG_HOME is preferred as scoop's config directory and persistence is being reworked in #3212.

I was wondering if applying more of the XDG specification to scoop might not be a good idea with regards to persist while it's being worked on.

It could be useful to have the ability to link to both XDG_CONFIG_HOME and XDG_DATA_HOME from manifests. That way, apps can differentiate between persistent configurations and persistent application data.

The new persist object schema could just specify data or config:

  "persist": {
    "config": [
      {
        "type": "file",
        "name": "config.dat",
        "content": "[Config]`nlanguage=eng",
        "encoding": "UTF-8",
        "method": "copy"
      }
    ],
    "data": [
      {
        "type": "directory",
        "name": "data",
        "method": "link"
      },
      {
        "type": "directory",
        "name": "plugins",
        "method": "merge"
      }
    ]
  }

And while at it, XDG_CACHE_HOME could be used for the cache.

@niheaven
Copy link
Member

XDG_DATA_HOME is not under scoop's control, so scoop cannot 'persist' it, so as XDG_CACHE_HOME. scoop just use XDG_CONFIG_HOME to store its own config.

@Deide
Copy link
Author

Deide commented Mar 31, 2019

Right now, applications installed with scoop keep their persistent configs and data in $SCOOP/persist/$appname, where $SCOOP is the directory scoop was installed in. And then symlinks are made inside $SCOOP/apps/$appname, pointing to files/folders from the persist path. Other than no longer being in the $SCOOP directory, it's not that different if you make the persist path $XDA_CONFIG_HOME/$appname.

@niheaven
Copy link
Member

Then where will be the XDG_XXX_HOME if user install scoop under a custom dir instead of $USERPROFILES? User who installed scoop in some location, e.g. D:, wants to keep persistence out of system, but XDG_XXX_HOME shouldn't be changed by scoop, and that broken persistence.

@Deide
Copy link
Author

Deide commented Mar 31, 2019

XDG directories wouldn't be changed by Scoop. Scoop would only add application folders to the XDG directories if they're set in the first place - just like scoop is doing for its own config. Users themselves would set the XDG environment variables.

I have scoop installed in I:\applications\, and I could set XDG_CONFIG_HOME to I:\.config\. If I don't have that environment variable, scoop can just use I:\applications\persist as it does now.

The only downside is that if you should ever choose to change or remove the XDG directories, all the symlinks for apps would need to be updated since they can't use environment variables. Though I don't see why you would, personally.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants