diff options
author | Olivier@Portable <olivier.radisson@insa-lyon.fr> | 2018-08-02 03:51:43 +0200 |
---|---|---|
committer | Olivier@Portable <olivier.radisson@insa-lyon.fr> | 2018-08-02 20:52:39 +0200 |
commit | 7841c77c9ac1ac9a004cce00170d7f8b8e868f94 (patch) | |
tree | f23a7a8c4fa59211a5d336b521c20ee5ac4bfbea | |
parent | 4fdd367c6b69f2e5b740ba86ce304f58d18ec03e (diff) | |
download | rofi-pass-7841c77c9ac1ac9a004cce00170d7f8b8e868f94.tar.gz |
allow to use the password filename as user
-rwxr-xr-x | rofi-pass | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -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)" |