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:
```
foobarmysecurepassword
UserName: MyUser
URL: http://my.url.foo
user: MyUser
url: http://my.url.foo
```
* Auto Typing of more than one field. This expects a autotype field in password file.
```
foobarmysecurepassword
---
UserName: MyUser
user: MyUser
SomeField: foobar
AnotherField: barfoo
URL: http://my.url.foo
url: http://my.url.foo
autotype: SomeField :tab UserName :tab AnotherField :tab pass
```
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.
In addition to those `:enter` and `:delay` are available.
* 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
* 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
# latest git. for rofi-pass this means that "-i" will not work with
# 0.15.7.
rofiopts="-no-levenshtein-sort"
rofiopts="-i -width 1000 -no-levenshtein-sort"
# fields to be used
URL_field='URL'
USERNAME_field='UserName'
URL_field='url'
USERNAME_field='user'
AUTOTYPE_field='autotype'
# delay to be used for :delay keyword
delay=2
## Programs to be used
# Editor
EDITOR='gvim -f'

View File

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