{"action":"created","issue":{"url":"https://api.github.com/repos/haskell/directory/issues/6","labels_url":"https://api.github.com/repos/haskell/directory/issues/6/labels{/name}","comments_url":"https://api.github.com/repos/haskell/directory/issues/6/comments","events_url":"https://api.github.com/repos/haskell/directory/issues/6/events","html_url":"https://github.com/haskell/directory/issues/6","id":46807111,"number":6,"title":"Properly support XDG Base Directory Specification","user":{"login":"hvr","id":285533,"avatar_url":"https://avatars.githubusercontent.com/u/285533?v=3","gravatar_id":"","url":"https://api.github.com/users/hvr","html_url":"https://github.com/hvr","followers_url":"https://api.github.com/users/hvr/followers","following_url":"https://api.github.com/users/hvr/following{/other_user}","gists_url":"https://api.github.com/users/hvr/gists{/gist_id}","starred_url":"https://api.github.com/users/hvr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hvr/subscriptions","organizations_url":"https://api.github.com/users/hvr/orgs","repos_url":"https://api.github.com/users/hvr/repos","events_url":"https://api.github.com/users/hvr/events{/privacy}","received_events_url":"https://api.github.com/users/hvr/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/haskell/directory/labels/discussion","name":"discussion","color":"fbca04"},{"url":"https://api.github.com/repos/haskell/directory/labels/enhancement","name":"enhancement","color":"84b6eb"}],"state":"closed","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/haskell/directory/milestones/3","html_url":"https://github.com/haskell/directory/milestones/1.2.3.0","labels_url":"https://api.github.com/repos/haskell/directory/milestones/3/labels","id":1015936,"number":3,"title":"1.2.3.0","description":"","creator":{"login":"Rufflewind","id":6571068,"avatar_url":"https://avatars.githubusercontent.com/u/6571068?v=3","gravatar_id":"","url":"https://api.github.com/users/Rufflewind","html_url":"https://github.com/Rufflewind","followers_url":"https://api.github.com/users/Rufflewind/followers","following_url":"https://api.github.com/users/Rufflewind/following{/other_user}","gists_url":"https://api.github.com/users/Rufflewind/gists{/gist_id}","starred_url":"https://api.github.com/users/Rufflewind/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Rufflewind/subscriptions","organizations_url":"https://api.github.com/users/Rufflewind/orgs","repos_url":"https://api.github.com/users/Rufflewind/repos","events_url":"https://api.github.com/users/Rufflewind/events{/privacy}","received_events_url":"https://api.github.com/users/Rufflewind/received_events","type":"User","site_admin":false},"open_issues":2,"closed_issues":1,"state":"open","created_at":"2015-03-11T06:26:16Z","updated_at":"2015-04-27T02:17:35Z","due_on":null,"closed_at":null},"comments":15,"created_at":"2014-10-25T09:19:28Z","updated_at":"2015-04-27T06:42:36Z","closed_at":"2015-04-27T02:17:35Z","body":"`directory` provides a function `getAppUserDataDirectory :: String -> IO FilePath` which on Linux simply constructs the resulting path as `${HOME}/.${APPNAME}`.\r\n\r\nHowever, that doesn't conform to the [XDG Base Directory Specification](http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html)\r\n\r\nFurther reading:\r\n\r\n - http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html\r\n - https://wiki.debian.org/XDGBaseDirectorySpecification\r\n - https://wiki.gnome.org/Initiatives/GnomeGoals/XDGConfigFolders\r\n"},"comment":{"url":"https://api.github.com/repos/haskell/directory/issues/comments/96521020","html_url":"https://github.com/haskell/directory/issues/6#issuecomment-96521020","issue_url":"https://api.github.com/repos/haskell/directory/issues/6","id":96521020,"user":{"login":"Rufflewind","id":6571068,"avatar_url":"https://avatars.githubusercontent.com/u/6571068?v=3","gravatar_id":"","url":"https://api.github.com/users/Rufflewind","html_url":"https://github.com/Rufflewind","followers_url":"https://api.github.com/users/Rufflewind/followers","following_url":"https://api.github.com/users/Rufflewind/following{/other_user}","gists_url":"https://api.github.com/users/Rufflewind/gists{/gist_id}","starred_url":"https://api.github.com/users/Rufflewind/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Rufflewind/subscriptions","organizations_url":"https://api.github.com/users/Rufflewind/orgs","repos_url":"https://api.github.com/users/Rufflewind/repos","events_url":"https://api.github.com/users/Rufflewind/events{/privacy}","received_events_url":"https://api.github.com/users/Rufflewind/received_events","type":"User","site_admin":false},"created_at":"2015-04-27T06:42:36Z","updated_at":"2015-04-27T06:42:36Z","body":"The upgrade path is not straightforward unfortunately:\r\n\r\n  - For one thing, using the new location will obviously break the existing configuration, so a well-behaved application will need to seamlessly migrate the files to the new location.  (And update documentation, tutorials, etc.)\r\n\r\n  - Secondly, there's the question of *where* the files are to be migrated: depending on how strict the application wants to follow the XDG specs, it will have to decide whether the files are moved to `~/.local/share`, `~/.config`, `~/.cache`, or some subset of those.  I think if the developer wants to be lazy and not think about it, `~/.config` seems like a good bet.  Chromium, for example, just dumps *everything* into `~/.config`.\r\n\r\nNow, changing the relevant code to use XDG isn't that difficult:\r\n\r\n    getAppUserDataDirectory \"myapp\"\r\n\r\nmay be replaced with\r\n\r\n    (</> \"myapp\") <$> getXdgDirectory XdgConfig\r\n\r\n(Substitute `XdgConfig` with `XdgData` or `XdgCache` as needed.)\r\n\r\nI can add some of this to the docs but ultimately the hardest part is doing the migration :/"}}