瀏覽代碼

generator.py will now make a .user.js

This is to go along with #3
david 6 月之前
父節點
當前提交
1721e03478
共有 3 個文件被更改,包括 21 次插入2 次删除
  1. 1 0
      .gitignore
  2. 18 1
      README.md
  3. 2 1
      generator.py

+ 1 - 0
.gitignore

@@ -0,0 +1 @@
+.user.js

+ 18 - 1
README.md

@@ -1,3 +1,20 @@
 # Key.Card
 
-A Greasemonkey script to generate passwords based on Qwerty Card
+A user script to generate passwords based on Qwerty Card
+
+## Installation
+
+> I'll assume you have [Greasemonkey](https://www.greasespot.net/) already installed
+
+1. Clone this repo
+2. Run a generator script (generator.\*)
+
+> Currently there is only one script, `generator.py`, a Python3 script. (In the future, there will be other languages to choose from, so you don't have to install a language just to do this step)
+
+3. Now with the newly modified `.user.js`, copy it's contents as a new user script in the Greasemonkey User Menu.
+    1. Click the Monkey.
+    2. Click 'New user script'
+    3. Copy + Paste the contents of `.user.js` from this repo into the new user script.
+    4. Press CTRL + S to save.
+    5. Reload open pages to see it run.
+

+ 2 - 1
generator.py

@@ -36,7 +36,7 @@ def modify_skript(spacebar, card):
                 old.append(f"let keys = \"{card}\".split(\"\");\n")
             else:
                 old.append(line)
-    with open("skript.js", "w") as f:
+    with open(".user.js", "w") as f:
         for line in old:
             f.write(line)
     return True
@@ -45,5 +45,6 @@ if __name__ == "__main__":
     sb = spacebar(6)
     c = card()
     print(f"SpaceBar: {sb}")
+    print(f"Letters:  {LETTERS}")
     print(f"Card:     {c}")
     modify_skript(sb, c)