diff --git a/CHANGELOG.md b/CHANGELOG.md index 9338542d..6288f3fc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ Changelog * [Improved] Python 2.6 compatibility * [New] Python 3 compatibility +* [New] Respects the `XDG_CONFIG_HOME` environment variable for storing your configuration file ### 1.0.3 (April 17, 2013) diff --git a/README.md b/README.md index f3c1d2ba..60040080 100644 --- a/README.md +++ b/README.md @@ -137,7 +137,7 @@ will replace your encrypted journal file by a Journal in plain text. You can als Advanced usages -------------- -The first time launched, _jrnl_ will create a file called `.jrnl_config` in your home directory. +The first time launched, _jrnl_ will create a file configuration file at `~/.jrnl_config` or, if the `XDG_CONFIG_HOME` environment variable is set, `$XDG_CONFIG_HOME/jrnl`. ### .jrnl_config diff --git a/jrnl/jrnl.py b/jrnl/jrnl.py index 72e97fa7..182eae00 100755 --- a/jrnl/jrnl.py +++ b/jrnl/jrnl.py @@ -31,7 +31,8 @@ __version__ = '1.0.0-rc1' __author__ = 'Manuel Ebert, Stephan Gabler' __license__ = 'MIT' -CONFIG_PATH = os.environ.get('JRNL_CONFIG', os.path.expanduser('~/.jrnl_config')) +xdg_config = os.environ.get('XDG_CONFIG_HOME') +CONFIG_PATH = os.path.join(xdg_config, "jrnl") if xdg_config else os.path.expanduser('~/.jrnl_config')) PYCRYPTO = install.module_exists("Crypto") def parse_args():