summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLaurie Clark-Michalek <bluepeppers@archlinux.us>2012-12-25 16:43:22 +0000
committerLaurie Clark-Michalek <bluepeppers@archlinux.us>2012-12-25 16:43:22 +0000
commitdb0dd9c630bce6ba460499e51a2a581fa2f4260b (patch)
tree70cccbe7c815ed5b454b690fa67a7a9da288041b
parent25d7e3baf1271a74bbd58ea9ab45a59b83e3bf83 (diff)
Fixed problem for people without XDG_CONFIG_HOME
-rwxr-xr-xarchey39
1 files changed, 7 insertions, 2 deletions
diff --git a/archey3 b/archey3
index 784c0d3..b04a815 100755
--- a/archey3
+++ b/archey3
@@ -532,8 +532,13 @@ distro(), uname(n), uname(r), uptime(), wm(), de(), packages(), ram(),\
default config file to $XDG_CONFIG_HOME/archey3.cfg.
"""
- config_location = os.path.expandvars(os.path.expanduser(
- file_location or "$XDG_CONFIG_HOME/archey3.cfg"))
+ if file_location is None and "XDG_CONFIG_HOME" not in os.environ:
+ config_location = os.path.expanduser("~/.archey3.cfg")
+ elif file_location is None:
+ config_location = os.path.expandvars("$XDG_CONFIG_HOME/archey3.cfg")
+ else:
+ config_location = \
+ os.path.expandvars(os.path.expanduser(file_location))
loaded = super(ArcheyConfigParser, self).read(config_location)