Browse Source

Replace lpass with pass

Ian Adam Naval 6 years ago
parent
commit
43b9abf927
2 changed files with 4 additions and 75 deletions
  1. 0
    73
      dwb/dwb.configdir/userscripts/lastpass.js
  2. 4
    2
      i3/i3.dotfile/config

+ 0
- 73
dwb/dwb.configdir/userscripts/lastpass.js View File

@@ -1,73 +0,0 @@
1
-//!javascript
2
-
3
-Signal.connect("documentLoaded", function(wv, frame) {
4
-    autofillForm(frame.document);
5
-});
6
-
7
-function fillUsername(doc, name, username) {
8
-    var box = doc.querySelector('input[name="' + name + '"]');
9
-    if (!box) {
10
-        box = doc.querySelector("input[name*=user]");
11
-    }
12
-    if (!box) {
13
-        box = doc.querySelector("input[name*=email]");
14
-    }
15
-    if (!box) {
16
-        box = doc.querySelector("input[name*=account]");
17
-    }
18
-    if (!box) {
19
-        box = doc.querySelector("input[type=email]");
20
-    }
21
-    if (box) {
22
-        box.value = username;
23
-    }
24
-}
25
-
26
-function fillPassword(doc, name, password) {
27
-    var box = doc.querySelector('input[name="' + name + '"]');
28
-    if (!box) {
29
-        box = doc.querySelector("input[type=password]");
30
-    }
31
-    if (box) {
32
-        box.value = password;
33
-    }
34
-}
35
-
36
-function lastPassFind(url, callbacks) {
37
-    var cmd = "lpass find " + url;
38
-    system.spawn(cmd, {
39
-        onStdout: function(line) {
40
-            if (line.indexOf("Username: ") == 0) {
41
-                callbacks.onGetUsername(line.substr(10));
42
-            } else if (line.indexOf("Password: ") == 0) {
43
-                callbacks.onGetPassword(line.substr(10));
44
-            } else if (line.indexOf(': ') > -1) {
45
-                var name = line.substring(0, line.indexOf(': '));
46
-                callbacks.onGetFieldName(line, name);
47
-            }
48
-        },
49
-    });
50
-}
51
-
52
-function autofillForm(doc) {
53
-    var username, password;
54
-    lastPassFind(tabs.current.uri, {
55
-        onGetUsername: function (val) {
56
-            username = val;
57
-            fillUsername(doc, "", val);
58
-        },
59
-        onGetPassword: function (val) { 
60
-            password = val;
61
-            fillPassword(doc, "", val);
62
-        },
63
-        onGetFieldName: function (line, name) { 
64
-            if (username && line.indexOf(username) > -1) {
65
-                fillUsername(doc, name, username);
66
-            }
67
-            if (password && line.indexOf(password) > -1) {
68
-                fillPassword(doc, name, password);
69
-            }
70
-        }
71
-    });
72
-}
73
-

+ 4
- 2
i3/i3.dotfile/config View File

@@ -32,8 +32,10 @@ bindsym $mod+Shift+Return exec terminator
32 32
 bindsym $mod+q kill
33 33
 # start dmenu (a program launcher)
34 34
 #bindsym $mod+d exec dmenu_run -sb "#880000"
35
-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"
36
-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
35
+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"
36
+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
37
+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
38
+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
37 39
 # There also is the (new) i3-dmenu-desktop which only displays applications
38 40
 # shipping a .desktop file. It is a wrapper around dmenu, so you need that
39 41
 # installed.

Loading…
Cancel
Save