summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMattias Andrée <maandree@operamail.com>2014-03-11 18:04:04 +0100
committerMattias Andrée <maandree@operamail.com>2014-03-11 18:04:14 +0100
commit62dfc4c226f3cef8907bb00ea8f42241cd795456 (patch)
tree42c251bb96e9f2e3d7442c876970da024aba74fa /src
parentadd backlight example (diff)
downloadblueshift-62dfc4c226f3cef8907bb00ea8f42241cd795456.tar.gz
blueshift-62dfc4c226f3cef8907bb00ea8f42241cd795456.tar.bz2
blueshift-62dfc4c226f3cef8907bb00ea8f42241cd795456.tar.xz
check passwd for user home if necessary
Signed-off-by: Mattias Andrée <maandree@operamail.com>
Diffstat (limited to 'src')
-rwxr-xr-xsrc/__main__.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/__main__.py b/src/__main__.py
index f66f974..e894221 100755
--- a/src/__main__.py
+++ b/src/__main__.py
@@ -403,7 +403,7 @@ if (config_file is None) and any([doreset, location] + settings):
else:
## Load extension and configurations via blueshiftrc
if config_file is None:
- for file in ('$XDG_CONFIG_HOME/%/%rc', '$HOME/.config/%/%rc', '$HOME/.%rc', '/etc/%rc'):
+ for file in ('$XDG_CONFIG_HOME/%/%rc', '$HOME/.config/%/%rc', '$HOME/.%rc', '$~/.config/%/%rc', '$~/.%c', '/etc/%rc'):
file = file.replace('%', 'blueshift')
for arg in ('XDG_CONFIG_HOME', 'HOME'):
if '$' + arg in file:
@@ -412,6 +412,9 @@ else:
else:
file = None
break
+ if file.startswith('$~'):
+ import pwd
+ file = pwd.getpwuid(os.getuid()).pw_dir + file[2:]
if file is not None:
file = file.replace('\0', '$')
if os.path.exists(file):