From db0dd9c630bce6ba460499e51a2a581fa2f4260b Mon Sep 17 00:00:00 2001 From: Laurie Clark-Michalek Date: Tue, 25 Dec 2012 16:43:22 +0000 Subject: Fixed problem for people without XDG_CONFIG_HOME --- archey3 | 9 +++++++-- 1 file 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) -- cgit v1.2.2