diff options
author | Mattias Andrée <maandree@operamail.com> | 2014-03-11 18:04:04 +0100 |
---|---|---|
committer | Mattias Andrée <maandree@operamail.com> | 2014-03-11 18:04:14 +0100 |
commit | 62dfc4c226f3cef8907bb00ea8f42241cd795456 (patch) | |
tree | 42c251bb96e9f2e3d7442c876970da024aba74fa /src | |
parent | add backlight example (diff) | |
download | blueshift-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-x | src/__main__.py | 5 |
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): |