# permanently set alternative root dir
# root=/path/to/root

# rofi command. Make sure to have "$@" as last argument
_rofi () {
    domain="$(xdotool getactivewindow getwindowname | grep -Eo 'https?://\S+' | sed -E 's%^https?://(www.)?([a-zA-Z0-9\-\.]+).+%\2%')"
    while true; do
        if [[ "$(pass find "$domain" | wc -l)" -gt 1 ]]; then
            extra_arg="-select $domain"
            break
        else
            # we search the next domain level until we hit the TLD
            domain="$(echo "$domain" | sed -E '/^[a-zA-Z0-0]*\./{s///;q}; //!q1')" || break
        fi
    done
    rofi -i -no-auto-select $extra_arg "$@"
}

# xdotool needs the keyboard layout to be set using setxkbmap
# You can do this in your autostart scripts (e.g. xinitrc)

# If for some reason, you cannot do this, you can set the command here.
# and set fix_layout to true
fix_layout=false

layout_cmd () {
    setxkbmap -rules evdev -model evdev -layout us -variant altgr-intl
}

# fields to be used
URL_field='url'
USERNAME_field='user'
AUTOTYPE_field='autotype'

# delay to be used for :delay keyword
delay=2

# rofi-pass needs to close itself before it can type passwords. Set delay here.
wait=0.2

## Programs to be used
# Editor
EDITOR='gvim -f'

# Browser
BROWSER='firefox'

## Misc settings

default_do='menu' # menu, autotype, copyPass, typeUser, typePass, copyUser, copyUrl, viewEntry, typeMenu, actionMenu, copyMenu, openUrl
auto_enter='true'
notify='false'
default_autotype='user :tab pass'

# color of the help messages
# leave empty for autodetection
help_color="#4872FF"

# Clipboard settings
# Possible options: primary, clipboard, both
clip=primary

# Options for generating new password entries
# default_user is also used for password files that have no user field.
#default_user=john_doe
#default_user2=mary_ann
password_length=16

# Custom Keybindings
autotype="Alt+1"
type_user="Alt+2"
type_pass="Alt+3"
open_url="Alt+4"
copy_name="Alt+u"
copy_url="Alt+l"
copy_pass="Alt+p"
show="Alt+o"
copy_entry="Alt+2"
type_entry="Alt+1"
copy_menu="Alt+c"
action_menu="Alt+a"
type_menu="Alt+t"
help="Alt+h"
switch="Alt+x"
insert_pass="Alt+n"