Replace lpass with pass

This commit is contained in:
Ian Adam Naval 2015-03-28 02:00:50 -04:00
parent 416280b788
commit 43b9abf927
2 changed files with 4 additions and 75 deletions

View File

@ -1,73 +0,0 @@
//!javascript
Signal.connect("documentLoaded", function(wv, frame) {
autofillForm(frame.document);
});
function fillUsername(doc, name, username) {
var box = doc.querySelector('input[name="' + name + '"]');
if (!box) {
box = doc.querySelector("input[name*=user]");
}
if (!box) {
box = doc.querySelector("input[name*=email]");
}
if (!box) {
box = doc.querySelector("input[name*=account]");
}
if (!box) {
box = doc.querySelector("input[type=email]");
}
if (box) {
box.value = username;
}
}
function fillPassword(doc, name, password) {
var box = doc.querySelector('input[name="' + name + '"]');
if (!box) {
box = doc.querySelector("input[type=password]");
}
if (box) {
box.value = password;
}
}
function lastPassFind(url, callbacks) {
var cmd = "lpass find " + url;
system.spawn(cmd, {
onStdout: function(line) {
if (line.indexOf("Username: ") == 0) {
callbacks.onGetUsername(line.substr(10));
} else if (line.indexOf("Password: ") == 0) {
callbacks.onGetPassword(line.substr(10));
} else if (line.indexOf(': ') > -1) {
var name = line.substring(0, line.indexOf(': '));
callbacks.onGetFieldName(line, name);
}
},
});
}
function autofillForm(doc) {
var username, password;
lastPassFind(tabs.current.uri, {
onGetUsername: function (val) {
username = val;
fillUsername(doc, "", val);
},
onGetPassword: function (val) {
password = val;
fillPassword(doc, "", val);
},
onGetFieldName: function (line, name) {
if (username && line.indexOf(username) > -1) {
fillUsername(doc, name, username);
}
if (password && line.indexOf(password) > -1) {
fillPassword(doc, name, password);
}
}
});
}

View File

@ -32,8 +32,10 @@ bindsym $mod+Shift+Return exec terminator
bindsym $mod+q kill bindsym $mod+q kill
# start dmenu (a program launcher) # start dmenu (a program launcher)
#bindsym $mod+d exec dmenu_run -sb "#880000" #bindsym $mod+d exec dmenu_run -sb "#880000"
bindsym $mod+d exec --no-startup-id j4-dmenu-desktop --dmenu="dmenu -i -sb '#800' -nb '#252525' -fn 'Meslo LG S DZ-8' -hist ~/.dmenu_history -h 24" bindsym $mod+d exec --no-startup-id j4-dmenu-desktop --dmenu="dmenu -i -sb '#800' -nb '#252525' -fn 'Meslo LG S DZ-8' -hist ~/.dmenu_history -h 22"
bindsym $mod+Shift+d exec --no-startup-id dmenu_run -i -sb '#800' -nb '#252525' -fn 'Meslo LG S DZ-8' -hist ~/.dmenu_history -h 24 bindsym $mod+Shift+d exec --no-startup-id dmenu_run -i -sb '#800' -nb '#252525' -fn 'Meslo LG S DZ-8' -hist ~/.dmenu_history -h 22
bindsym $mod+p exec --no-startup-id ~/.i3/passmenu --type -i -sb '#800' -nb '#252525' -fn 'Meslo LG S DZ-8' -hist ~/.passmenu_history --h 22
bindsym $mod+Shift+p exec --no-startup-id ~/.i3/passmenu -i -sb '#800' -nb '#252525' -fn 'Meslo LG S DZ-8' -hist ~/.passmenu_history --h 22
# There also is the (new) i3-dmenu-desktop which only displays applications # There also is the (new) i3-dmenu-desktop which only displays applications
# shipping a .desktop file. It is a wrapper around dmenu, so you need that # shipping a .desktop file. It is a wrapper around dmenu, so you need that
# installed. # installed.