aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xrofi-pass6
1 files changed, 5 insertions, 1 deletions
diff --git a/rofi-pass b/rofi-pass
index eb29c9a..ca9cb2a 100755
--- a/rofi-pass
+++ b/rofi-pass
@@ -417,7 +417,11 @@ mainMenu () {
fi
if [[ -z "${stuff["${USERNAME_field}"]}" ]]; then
if [[ -n $default_user ]]; then
- stuff["${USERNAME_field}"]="${default_user}"
+ if [[ "$default_user" == "%filename" ]]; then
+ stuff["${USERNAME_field}"]="$(basename $selected_password)"
+ else
+ stuff["${USERNAME_field}"]="${default_user}"
+ fi
fi
fi
pass_content="$(for key in "${!stuff[@]}"; do printf '%s\n' "${key}: ${stuff[$key]}"; done)"