nicer default field names

This commit is contained in:
Rasmus Steinke 2015-09-13 04:04:21 +02:00
parent eab022949e
commit f36ad274fe
3 changed files with 14 additions and 10 deletions

View File

@ -16,24 +16,25 @@
* Auto Type User and Password. Format of password files are expected to be like: * Auto Type User and Password. Format of password files are expected to be like:
``` ```
foobarmysecurepassword foobarmysecurepassword
UserName: MyUser user: MyUser
URL: http://my.url.foo url: http://my.url.foo
``` ```
* Auto Typing of more than one field. This expects a autotype field in password file. * Auto Typing of more than one field. This expects a autotype field in password file.
``` ```
foobarmysecurepassword foobarmysecurepassword
--- ---
UserName: MyUser user: MyUser
SomeField: foobar SomeField: foobar
AnotherField: barfoo AnotherField: barfoo
URL: http://my.url.foo url: http://my.url.foo
autotype: SomeField :tab UserName :tab AnotherField :tab pass autotype: SomeField :tab UserName :tab AnotherField :tab pass
``` ```
The `:tab` field has a special meaning. this will hit the tab key, obviously.<br> The `:tab` field has a special meaning. this will hit the tab key, obviously.<br>
Same for `:space`, which will hit the space key, can be used to activate checkboxes. Same for `:space`, which will hit the space key, can be used to activate checkboxes.
In addition to those `:enter` and `:delay` are available.
* All Hotkeys are configurable in config file * All Hotkeys are configurable in config file
* Username, URL and autotype field names are also configurable * user, url and autotype field names are also configurable
## Requirements ## Requirements
* pass (https://github.com/zx2c4/password-store) * pass (https://github.com/zx2c4/password-store)

View File

@ -5,13 +5,16 @@
# keep in mind that 0.15.7 has different arguments compared to # keep in mind that 0.15.7 has different arguments compared to
# latest git. for rofi-pass this means that "-i" will not work with # latest git. for rofi-pass this means that "-i" will not work with
# 0.15.7. # 0.15.7.
rofiopts="-no-levenshtein-sort" rofiopts="-i -width 1000 -no-levenshtein-sort"
# fields to be used # fields to be used
URL_field='URL' URL_field='url'
USERNAME_field='UserName' USERNAME_field='user'
AUTOTYPE_field='autotype' AUTOTYPE_field='autotype'
# delay to be used for :delay keyword
delay=2
## Programs to be used ## Programs to be used
# Editor # Editor
EDITOR='gvim -f' EDITOR='gvim -f'

View File

@ -60,8 +60,8 @@ def password_data(element, path=''):
username = get_value(element, 'UserName') username = get_value(element, 'UserName')
url = get_value(element, 'URL') url = get_value(element, 'URL')
notes = get_value(element, 'Notes') notes = get_value(element, 'Notes')
data = "%sUserName: %s\n" % (data, username) data = "%suser: %s\n" % (data, username)
data = "%sURL: %s\n" % (data, url) data = "%surl: %s\n" % (data, url)
data = "%s%s\n" % (data, notes) data = "%s%s\n" % (data, notes)
return data return data