{"action":"created","issue":{"url":"https://api.github.com/repos/lra/mackup/issues/618","labels_url":"https://api.github.com/repos/lra/mackup/issues/618/labels{/name}","comments_url":"https://api.github.com/repos/lra/mackup/issues/618/comments","events_url":"https://api.github.com/repos/lra/mackup/issues/618/events","html_url":"https://github.com/lra/mackup/issues/618","id":100127825,"number":618,"title":"Reference shell environment variables from within app.cfg files","user":{"login":"mkwmms","id":2526129,"avatar_url":"https://avatars.githubusercontent.com/u/2526129?v=3","gravatar_id":"","url":"https://api.github.com/users/mkwmms","html_url":"https://github.com/mkwmms","followers_url":"https://api.github.com/users/mkwmms/followers","following_url":"https://api.github.com/users/mkwmms/following{/other_user}","gists_url":"https://api.github.com/users/mkwmms/gists{/gist_id}","starred_url":"https://api.github.com/users/mkwmms/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mkwmms/subscriptions","organizations_url":"https://api.github.com/users/mkwmms/orgs","repos_url":"https://api.github.com/users/mkwmms/repos","events_url":"https://api.github.com/users/mkwmms/events{/privacy}","received_events_url":"https://api.github.com/users/mkwmms/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2015-08-10T17:48:37Z","updated_at":"2015-08-10T23:03:33Z","closed_at":null,"body":"Is it possible/would it be possible to reference `$XDG_CONFIG_HOME` etc. environment variables from within app.cfg files?\r\n\r\nFor example:\r\nMy `$XDG_CONFIG_HOME` is set to my iCloud Drive directory/.config (aka the ugly path: `~/Library/Mobile Documents/com~apple~CloudDocs/.config`)\r\n\r\nSo for .pythonrc it looks like:\r\n```\r\n[application]\r\nname = Python\r\n\r\n[configuration_files]\r\nLibrary/Mobile Documents/com~apple~CloudDocs/.config/python/.pythonrc\r\n```\r\nBut it would be awesome if it could look like:\r\n```\r\n[application]\r\nname = Python\r\n\r\n[configuration_files]\r\n$XDG_CONFIG_HOME/.config/python/.pythonrc\r\n```\r\nor:\r\n`os.environ['XDG_CONFIG_HOME']/python/.pythonrc`\r\n\r\nThis would also be helpful for apps that support custom environment variables like atom:\r\n```\r\n[application]\r\nname = Atom\r\n\r\n[configuration_files]\r\n\r\nLibrary/Preferences/com.github.atom.plist\r\n$ATOM_HOME/config.cson\r\n$ATOM_HOME/init.coffee\r\n$ATOM_HOME/keymap.cson\r\n$ATOM_HOME/keymaps\r\n$ATOM_HOME/snippets.cson\r\n$ATOM_HOME/styles.less\r\n```\r\n__default app XDG support__\r\nThis would also be helpful for apps that support the XDG spec like git (see: the [git spec](http://git-scm.com/docs/git-config))\r\n```\r\n[application]\r\nname = Git\r\n\r\n[configuration_files]\r\n$XDG_CONFIG_HOME/git/config\r\n$XDG_CONFIG_HOME/git/credentials\r\n$XDG_CONFIG_HOME/git/ignore\r\n.gitignore\r\n.gitcredentials\r\n.gitconfig\r\n```"},"comment":{"url":"https://api.github.com/repos/lra/mackup/issues/comments/129642503","html_url":"https://github.com/lra/mackup/issues/618#issuecomment-129642503","issue_url":"https://api.github.com/repos/lra/mackup/issues/618","id":129642503,"user":{"login":"mkwmms","id":2526129,"avatar_url":"https://avatars.githubusercontent.com/u/2526129?v=3","gravatar_id":"","url":"https://api.github.com/users/mkwmms","html_url":"https://github.com/mkwmms","followers_url":"https://api.github.com/users/mkwmms/followers","following_url":"https://api.github.com/users/mkwmms/following{/other_user}","gists_url":"https://api.github.com/users/mkwmms/gists{/gist_id}","starred_url":"https://api.github.com/users/mkwmms/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mkwmms/subscriptions","organizations_url":"https://api.github.com/users/mkwmms/orgs","repos_url":"https://api.github.com/users/mkwmms/repos","events_url":"https://api.github.com/users/mkwmms/events{/privacy}","received_events_url":"https://api.github.com/users/mkwmms/received_events","type":"User","site_admin":false},"created_at":"2015-08-10T23:03:33Z","updated_at":"2015-08-10T23:03:33Z","body":"Good points...\r\nWhat if it was:\r\n```\r\n[application]\r\nname = Git\r\n\r\n[configuration_files]\r\ngit/config\r\ngit/credentials\r\ngit/ignore\r\n.gitignore\r\n.gitcredentials\r\n.gitconfig\r\n``` \r\nSo the parser isn't changed at all (writing parsers suck) and the relative paths are not violated (because I agree this should be a `~` only thing...\r\n\r\nBUT the only difference is:\r\n\r\n1. if `$XDG_CONFIG_HOME` is set, look there for the files (thus finding `git/config`, `git/credentials`, `git/ignore`, and skipping the others)\r\n2. look in `~` regardless of whether or not `$XDG_CONFIG_HOME` is set (finding nothing if `$XDG_CONFIG_HOME` is set but finding the normal .gitignore files if `$XDG_CONFIG_HOME` is not set)\r\n\r\nI propose that if `$XDG_CONFIG_HOME` is set outside of `~` you could give the user a warning to proceed or just quit mackup etc. so we can handle the /usr/share/I/dont/understand/unix people haha"}}