diff --git a/eg/config.py b/eg/config.py
index f448d28..661057a 100644
--- a/eg/config.py
+++ b/eg/config.py
@@ -173,12 +173,16 @@ def get_egrc_config(cli_egrc_path):
 
     if config_path == '':
       # Try for the xdg config.
-      xdg_home_dir = os.getenv('XDG_CONFIG_HOME')
-      if xdg_home_dir:
-        xdg_config_path = os.path.join(xdg_home_dir, 'eg', 'egrc')
-        xdg_config_path = get_expanded_path(xdg_config_path)
-        if os.path.isfile(xdg_config_path):
-          config_path = xdg_config_path
+      # The freedesktop.org spec says '$HOME/.config' should be used if the
+      # environment variable is not set or is empty. os.getenv() will be falsey
+      # if it is either not set (None) or an empty string.
+      default_xdg_dir = os.path.join('~', '.config')
+      xdg_home_dir = os.getenv('XDG_CONFIG_HOME') or default_xdg_dir
+
+      xdg_config_path = os.path.join(xdg_home_dir, 'eg', 'egrc')
+      xdg_config_path = get_expanded_path(xdg_config_path)
+      if os.path.isfile(xdg_config_path):
+        config_path = xdg_config_path
 
     if config_path == '':
       # Fall back to our home directory.

diff --git a/test/config_test.py b/test/config_test.py
index 4277230..c7ea4cb 100644
--- a/test/config_test.py
+++ b/test/config_test.py
@@ -200,6 +200,50 @@ def test_get_egrc_config_uses_home_dir_default_no_xdg_dir():
     )
 
 
+def test_get_egrc_config_uses_default_xdg_dir_if_env_var_not_set():
+    """
+    If the XDG environment variable isn't set, but the file exists at the
+    default XDG location, it should be used. Note that here we don't have
+    'egrc', not as a hidden file by default.
+
+    See: https://github.com/srsudar/eg/issues/87
+    """
+    expected = 'mock config from default position'
+
+    _assert_about_get_egrc_config(
+        cli_path=None,
+        cli_config_exists=False,
+        winning_config_path=os.path.join(
+          '~', '.config', 'eg', 'egrc_expanded'),
+        home_config_exists=True,
+        expected_config=expected,
+        xdg_dir_variable=None,
+        xdg_config_exists=True,
+    )
+
+
+def test_get_egrc_config_uses_default_xdg_dir_if_env_var_empty():
+    """
+    If the XDG environment variable is empty, but the file exists at the default
+    XDG location, it should be used. Note that here we don't have 'egrc', not as
+    a hidden file by default.
+
+    See: https://github.com/srsudar/eg/issues/87
+    """
+    expected = 'mock config from default position'
+
+    _assert_about_get_egrc_config(
+        cli_path=None,
+        cli_config_exists=False,
+        winning_config_path=os.path.join(
+          '~', '.config', 'eg', 'egrc_expanded'),
+        home_config_exists=True,
+        expected_config=expected,
+        xdg_dir_variable='',
+        xdg_config_exists=True,
+    )
+
+
 def test_get_egrc_config_uses_home_dir_default_xdg_dir_file_not_present():
     """
     Fallback to the home directory config if XDG directory is set but the XDG
@@ -217,7 +261,7 @@ def test_get_egrc_config_uses_home_dir_default_xdg_dir_file_not_present():
         xdg_config_exists=False,
     )
 
-def test_get_egrc_config_uses_xdg_dir_default_if_present():
+def test_get_egrc_config_uses_xdg_dir_default_if_both_present():
     """
     The XDG config should win over the home directory.
     """
@@ -278,8 +322,13 @@ def _assert_about_get_egrc_config(
         return cli_config_exists
       if file_name == os.path.join('~', '.egrc_expanded'):
         return home_config_exists
-      if file_name == os.path.join(xdg_dir_variable, 'eg', 'egrc_expanded'):
-        # ${XDG_DIR_HOME}/eg/egrc
+      if (xdg_dir_variable and
+          file_name == os.path.join(xdg_dir_variable, 'eg', 'egrc_expanded')):
+        # ${XDG_CONFIG_HOME}/eg/egrc
+        return xdg_config_exists
+      if file_name == os.path.join('~', '.config', 'eg', 'egrc_expanded'):
+        # This is the default location of XDG_CONFIG_HOME, which we may fall
+        # back to under some test cases.
         return xdg_config_exists
       return False
     mock_isfile.side_effect = isfile_side_effect

No recognize config path: $HOME/.config/eg/egrc 
Version: 1.2.0
Installed from pip

I follow the [information](https://github.com/srsudar/eg#configuration-and-extension) on README of the repository. For custom config file I create a file called `egrc` on the next path: `skabit/.config/eg`, but nothing happens. In this file I only add a custom directory with my examples:

```
[eg-config]
# Lines starting with # are treated as comments
custom-dir = ~/docu/cheats
```


test/config_test.py::test_get_egrc_config_uses_default_xdg_dir_if_env_var_not_set test/config_test.py::test_get_egrc_config_uses_default_xdg_dir_if_env_var_empty
test/config_test.py::test_get_egrc_config_uses_home_dir_default_xdg_dir_file_not_present test/config_test.py::test_get_resolved_config_falls_back_to_defaults test/config_test.py::test_get_priority_respect_false test/config_test.py::test_get_config_tuple_from_egrc_all_none_when_not_present test/config_test.py::test_default_color_config test/config_test.py::test_get_priority_first test/config_test.py::test_parse_bool_true_for_truthy_values test/config_test.py::test_get_config_tuple_from_egrc_when_present test/config_test.py::test_get_resolved_config_calls_expand_paths test/config_test.py::test_merge_color_configs_mixed test/config_test.py::test_parse_substitution_error_if_not_list test/config_test.py::test_parse_substitution_error_if_wrong_length test/config_test.py::test_get_resolved_config_defaults_to_egrc test/config_test.py::test_parse_substitution_error_if_third_element_not_bool test/config_test.py::test_get_egrc_config_uses_home_dir_default_no_xdg_dir test/config_test.py::test_get_substitution_from_config_finds_multiple_substitutions test/config_test.py::test_config_returns_egrc_values_if_present test/config_test.py::test_get_resolved_config_uses_custom_egrc_path test/config_test.py::test_parse_substitution_from_list_without_is_multiline test/config_test.py::test_get_egrc_returns_empty_if_no_egrc test/config_test.py::test_get_priority_third test/config_test.py::test_merge_color_configs_take_all_first test/config_test.py::test_merge_color_configs_first_all_none test/config_test.py::test_get_substitution_from_config_finds_single_substitution test/config_test.py::test_get_egrc_config_uses_xdg_dir_default_if_both_present test/config_test.py::test_parse_substitution_from_list_with_is_multiline test/config_test.py::test_get_resolved_config_prioritizes_cli test/config_test.py::test_get_priority_second test/config_test.py::test_inform_if_paths_invalid_selectively_informs test/config_test.py::test_get_egrc_config_reads_from_command_line test/config_test.py::test_parse_bool_false_for_non_truthy_values