aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPhilip Gawehn <3gawehn@informatik.uni-hamburg.de>2018-03-09 23:37:17 +0100
committerPhilip Gawehn <3gawehn@informatik.uni-hamburg.de>2018-03-09 23:37:17 +0100
commit04162d6ae9b72d05df0efb72bb35a7b152fa605b (patch)
treed3955f482640e61cb6de5d51318ed794780ee20a
parent29307e3048acca8f725bc1c0ce799ef2c78dddf9 (diff)
downloadrofi-pass-04162d6ae9b72d05df0efb72bb35a7b152fa605b.tar.gz
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"