From 9c43549dc285a84d349e4b505c98d3a56e2e8ae2 Mon Sep 17 00:00:00 2001 From: Rasmus Steinke Date: Sun, 27 Dec 2015 08:21:28 +0100 Subject: [PATCH] autodetect help_color, if none is set --- config.example | 4 ++++ rofi-pass | 7 +++++++ 2 files changed, 11 insertions(+) diff --git a/config.example b/config.example index f455aef..712c16a 100644 --- a/config.example +++ b/config.example @@ -33,6 +33,10 @@ passlength='20' # after autotyping an entry. Set to "off" to disable count=2 +# color of the help messages +# leave empty for autodetection +help_color="" + # Clipboard settings # Possible options: primary, clipboard, both clip=primary diff --git a/rofi-pass b/rofi-pass index f0772b6..2797057 100755 --- a/rofi-pass +++ b/rofi-pass @@ -4,6 +4,7 @@ # (c) 2015 Rasmus Steinke basecommand=$(echo "$0" | awk '{ print $1 }') + # get all password files and create an array list_passwords() { cd "${root}" @@ -491,6 +492,12 @@ if [[ -f $HOME/.config/rofi-pass/config ]]; then source $HOME/.config/rofi-pass/config fi +# set help color +if [[ $help_color == "" ]]; then + help_color=$(rofi -dump-xresources | grep 'rofi.color.normal' | awk -F ', ' '{ print $2 }') + help_separator_color=$(rofi -dump-xresources | grep 'rofi.color.normal' | awk -F ', ' '{ print $2 }') +fi + # check for BROWSER variable, use xdg-open as fallback if [[ -z $BROWSER ]]; then export BROWSER=xdg-open