From 04162d6ae9b72d05df0efb72bb35a7b152fa605b Mon Sep 17 00:00:00 2001 From: Philip Gawehn <3gawehn@informatik.uni-hamburg.de> Date: Fri, 9 Mar 2018 23:37:17 +0100 Subject: add ROFI_PASS_CONFIG environment variable --- README.md | 5 +++++ rofi-pass | 5 +++++ 2 files changed, 10 insertions(+) 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" -- cgit