autodetect help_color, if none is set

This commit is contained in:
Rasmus Steinke 2015-12-27 08:21:28 +01:00
parent 4b8a942fb9
commit 9c43549dc2
2 changed files with 11 additions and 0 deletions

View File

@ -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

View File

@ -4,6 +4,7 @@
# (c) 2015 Rasmus Steinke <rasi@xssn.at>
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