aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Keller <tjkeller.xyz>2024-11-17 20:48:17 -0600
committerTim Keller <tjkeller.xyz>2024-11-17 20:48:17 -0600
commit5dd17fe3c88d8543cbff634116d76f1fb1692faf (patch)
treeb29fd0725d405ce64a5849758c66749c8231b644
parent1299cc3ad20614e6396e71af75b6d19c08567aff (diff)
downloaduserscripts-5dd17fe3c88d8543cbff634116d76f1fb1692faf.tar.xz
userscripts-5dd17fe3c88d8543cbff634116d76f1fb1692faf.zip
add mkconfig.py script to generate violentmonkey zip
-rw-r--r--.gitignore1
-rw-r--r--README.md36
-rw-r--r--mkconfig.py25
-rw-r--r--settings.json8
4 files changed, 43 insertions, 27 deletions
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..c4c4ffc
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1 @@
+*.zip
diff --git a/README.md b/README.md
index 1ed89e4..59d7325 100644
--- a/README.md
+++ b/README.md
@@ -1,31 +1,13 @@
# Userscripts
+These are my [Violentmoney](https://violentmonkey.github.io/) userscripts for various sites.
+Violentmonkey is a modern free software replacement for Tampermonkey/Greasemonkey.
-These are my userscripts for various sites.
-I use [Violentmoney](https://violentmonkey.github.io/) as my userscript manager extension.
-It is free software, unlike tamper/greese monkey.
+# Install from URL
+In Violentmonkey, click the `+` button => `Install from URL`, and paste the following:
-# Install
+`https://git.tjkeller.xyz/userscripts.git/plain/{path to userscript.js}`
-Simply pull up Violentmonkey's config page, click the `+` button, `Install from URL`, and paste one of the following scripts:
-
-## Youtube
-
-### Disable Youtube Miniplayer
-[https://git.tjkeller.xyz/userscripts.git/plain/youtube/disable-mini-player.js](https://git.tjkeller.xyz/userscripts.git/plain/youtube/disable-mini-player.js)
-
-### Piped Button
-[https://git.tjkeller.xyz/userscripts.git/plain/youtube/piped-button.js](https://git.tjkeller.xyz/userscripts.git/plain/youtube/piped-button.js)
-
-### Remove youtube home and shorts
-[https://git.tjkeller.xyz/userscripts.git/plain/youtube/remove-home-shorts.js](https://git.tjkeller.xyz/userscripts.git/plain/youtube/remove-home-shorts.js)
-
-## Miscellaneous
-
-### Piped - Fill Preferences
-[https://git.tjkeller.xyz/userscripts.git/tree/misc/piped-preferences.js](https://git.tjkeller.xyz/userscripts.git/tree/misc/piped-preferences.js)
-
-### rateyourmusic.com dark reader compatibility
-[https://git.tjkeller.xyz/userscripts.git/tree/misc/rateyourmusic.com-dark-reader-compatibility.js](https://git.tjkeller.xyz/userscripts.git/tree/misc/rateyourmusic.com-dark-reader-compatibility.js)
-
-### Fill out usps scheduled pickup
-[https://git.tjkeller.xyz/userscripts.git/tree/misc/usps-fill-out-scheduled-pickup.js](https://git.tjkeller.xyz/userscripts.git/tree/misc/usps-fill-out-scheduled-pickup.js)
+# Install from zip
+A python script `mkconfig.py` is included to generate a `violentmonkey.zip`
+file that can be imported in
+`Violentmoney` => `Settings => `Backup and maintenance`
diff --git a/mkconfig.py b/mkconfig.py
new file mode 100644
index 0000000..47cc0ee
--- /dev/null
+++ b/mkconfig.py
@@ -0,0 +1,25 @@
+import json
+import os
+import glob
+import zipfile
+
+# handle settings
+settings = {}
+if os.path.isfile("settings.json"):
+ with open("settings.json", 'r') as f:
+ settings = json.load(f)
+
+# get all userscripts
+paths = glob.glob(os.path.join('.', '**', '*.js'), recursive=True)
+paths = [ path.removesuffix(".js") for path in paths ]
+
+# zipp
+with zipfile.ZipFile("violentmonkey.zip", 'w', zipfile.ZIP_DEFLATED) as zipf:
+ for path in paths:
+ arcname = os.path.basename(path) + ".user.js" # basename and add .user.js suffix
+ path += ".js"
+ zipf.write(path, arcname=arcname)
+ zipf.writestr("violentmonkey", json.dumps({
+ "scripts": { os.path.basename(path): {} for path in paths },
+ "settings": settings,
+ }))
diff --git a/settings.json b/settings.json
new file mode 100644
index 0000000..7fc6664
--- /dev/null
+++ b/settings.json
@@ -0,0 +1,8 @@
+{
+ "editor": {
+ "indentWithTabs": true
+ },
+ "valueEditor": {
+ "indentWithTabs": true
+ }
+}