aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOlivier@Portable <olivier.radisson@insa-lyon.fr>2018-08-02 03:51:43 +0200
committerOlivier@Portable <olivier.radisson@insa-lyon.fr>2018-08-02 20:52:39 +0200
commit7841c77c9ac1ac9a004cce00170d7f8b8e868f94 (patch)
treef23a7a8c4fa59211a5d336b521c20ee5ac4bfbea
parent4fdd367c6b69f2e5b740ba86ce304f58d18ec03e (diff)
downloadrofi-pass-7841c77c9ac1ac9a004cce00170d7f8b8e868f94.tar.gz
allow to use the password filename as user
-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)"