aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRasmus Steinke <rasi@xssn.at>2018-03-10 11:54:48 +0100
committerGitHub <noreply@github.com>2018-03-10 11:54:48 +0100
commitb6514f9186740f633871fe546625bb916d6d9d68 (patch)
treed3955f482640e61cb6de5d51318ed794780ee20a
parent29307e3048acca8f725bc1c0ce799ef2c78dddf9 (diff)
parent04162d6ae9b72d05df0efb72bb35a7b152fa605b (diff)
downloadrofi-pass-b6514f9186740f633871fe546625bb916d6d9d68.tar.gz
Merge pull request #118 from lsbloxx/feature-own-config-path
add ROFI_PASS_CONFIG environment variable
-rw-r--r--README.md5
-rwxr-xr-xrofi-pass5
2 files changed, 10 insertions, 0 deletions
diff --git a/README.md b/README.md
index a27cd30..607424e 100644
--- a/README.md
+++ b/README.md
@@ -78,8 +78,13 @@ in a convenient way using [rofi](https://github.com/DaveDavenport/rofi).
## Configuration
rofi-pass may read its configuration values from `/etc/rofi-pass.conf` and/or `$HOME/.config/rofi-pass/config`.
+You can also set a configuration by using the environment variable ROFI_PASS_CONFIG (see example below).
For an example configuration please take a look at the included `config.example` file.
+```
+ROFI_PASS_CONFIG="$HOME/path/to/config" rofi-pass
+```
+
## Extras
### addpass
diff --git a/rofi-pass b/rofi-pass
index 752ee2c..180dca5 100755
--- a/rofi-pass
+++ b/rofi-pass
@@ -724,6 +724,11 @@ main () {
source "$HOME/.config/rofi-pass/config"
fi
+ # check if path to config in environment variable exists and load it
+ if [[ -f "$ROFI_PASS_CONFIG" ]]; then
+ source "$ROFI_PASS_CONFIG"
+ fi
+
# create tmp dir
if [[ ! -d "$HOME/.cache/rofi-pass" ]]; then
mkdir "$HOME/.cache/rofi-pass"