Add mod: raise svchost split threshold
This commit is contained in:
parent
36389068fa
commit
b751765b0f
|
@ -1,162 +1,162 @@
|
||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
oldexcepthook = sys.excepthook
|
oldexcepthook = sys.excepthook
|
||||||
def newexcepthook(type,value,traceback):
|
def newexcepthook(type,value,traceback):
|
||||||
oldexcepthook(type,value,traceback)
|
oldexcepthook(type,value,traceback)
|
||||||
input("Press ENTER to quit.")
|
input("Press ENTER to quit.")
|
||||||
sys.excepthook = newexcepthook
|
sys.excepthook = newexcepthook
|
||||||
|
|
||||||
import os
|
import os
|
||||||
p = os.path.join
|
p = os.path.join
|
||||||
pUp = os.path.dirname
|
pUp = os.path.dirname
|
||||||
s = False
|
s = False
|
||||||
if getattr(sys, 'frozen', False) and hasattr(sys, '_MEIPASS'):
|
if getattr(sys, 'frozen', False) and hasattr(sys, '_MEIPASS'):
|
||||||
s = os.path.realpath(sys.executable)
|
s = os.path.realpath(sys.executable)
|
||||||
else:
|
else:
|
||||||
s = os.path.realpath(__file__)
|
s = os.path.realpath(__file__)
|
||||||
sp = pUp(s)
|
sp = pUp(s)
|
||||||
|
|
||||||
# script start
|
# script start
|
||||||
import html
|
import html
|
||||||
import shutil
|
import shutil
|
||||||
|
|
||||||
def getDescription(dir):
|
def getDescription(dir):
|
||||||
desc = "No description"
|
desc = "No description"
|
||||||
try:
|
try:
|
||||||
with open(p(dir,"description.txt")) as dfile:
|
with open(p(dir,"description.txt")) as dfile:
|
||||||
desc = dfile.read().strip(" \t\r\n")
|
desc = dfile.read().strip(" \t\r\n")
|
||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
return desc
|
return desc
|
||||||
|
|
||||||
def getTags(dir):
|
def getTags(dir):
|
||||||
tags = ["none"]
|
tags = ["none"]
|
||||||
try:
|
try:
|
||||||
with open(p(dir,"tags.txt")) as tfile:
|
with open(p(dir,"tags.txt")) as tfile:
|
||||||
tags = tfile.read().strip(" \t\r\n").split(" ")
|
tags = tfile.read().strip(" \t\r\n").split(" ")
|
||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
return tags
|
return tags
|
||||||
|
|
||||||
def getModList(dir, modlist = {}, rootdir = False):
|
def getModList(dir, modlist = {}, rootdir = False):
|
||||||
if rootdir == False: rootdir = dir
|
if rootdir == False: rootdir = dir
|
||||||
for root,dirs,files in os.walk(dir):
|
for root,dirs,files in os.walk(dir):
|
||||||
for file in sorted(dirs):
|
for file in sorted(dirs):
|
||||||
ffile = p(root,file)
|
ffile = p(root,file)
|
||||||
lfile = ffile.replace(rootdir + os.path.sep,"",1)
|
lfile = ffile.replace(rootdir + os.path.sep,"",1)
|
||||||
modname = ffile.replace(dir + os.path.sep,"",1)
|
modname = ffile.replace(dir + os.path.sep,"",1)
|
||||||
activated = True
|
activated = True
|
||||||
if modname[0] == "-":
|
if modname[0] == "-":
|
||||||
modname = modname[1:]
|
modname = modname[1:]
|
||||||
activated = False
|
activated = False
|
||||||
if modname[0] == "[" and modname[-1] == "]":
|
if modname[0] == "[" and modname[-1] == "]":
|
||||||
getModList(ffile,modlist,rootdir)
|
getModList(ffile,modlist,rootdir)
|
||||||
continue
|
continue
|
||||||
fmodname = p(pUp(lfile),modname)
|
fmodname = p(pUp(lfile),modname)
|
||||||
modlist[ffile] = {
|
modlist[ffile] = {
|
||||||
"modname": modname,
|
"modname": modname,
|
||||||
"fmodname": fmodname,
|
"fmodname": fmodname,
|
||||||
"activated": activated
|
"activated": activated
|
||||||
}
|
}
|
||||||
break
|
break
|
||||||
return modlist
|
return modlist
|
||||||
|
|
||||||
def makeHeading(title,id,size = 1):
|
def makeHeading(title,id,size = 1):
|
||||||
return '<h' +str(size)+ ' id="' +id+ '"><a href="#' +id+ '">#</a> ' +html.escape(title)+ '</h' +str(size)+ '>\n'
|
return '<h' +str(size)+ ' id="' +id+ '"><a href="#' +id+ '">#</a> ' +html.escape(title)+ '</h' +str(size)+ '>\n'
|
||||||
|
|
||||||
def readTags():
|
def readTags():
|
||||||
tags = {}
|
tags = {}
|
||||||
with open(p(sp,"tags.txt"),encoding="utf-8") as tfile:
|
with open(p(sp,"tags.txt"),encoding="utf-8") as tfile:
|
||||||
for line in tfile:
|
for line in tfile:
|
||||||
line = line.strip(" \t\r\n")
|
line = line.strip(" \t\r\n")
|
||||||
if line == "": continue
|
if line == "": continue
|
||||||
tagSplit = line.split(" ",1)
|
tagSplit = line.split(" ",1)
|
||||||
tags[tagSplit[0]] = tagSplit[1]
|
tags[tagSplit[0]] = tagSplit[1]
|
||||||
return tags
|
return tags
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
opusPath = pUp(sp)
|
opusPath = pUp(sp)
|
||||||
ofileHtml = p(opusPath,"docs","index.html")
|
ofileHtml = p(opusPath,"docs","index.html")
|
||||||
ofileMd = p(opusPath,"docs","index.md")
|
ofileMd = p(opusPath,"docs","index.md")
|
||||||
ofile = open(ofileHtml,"w",encoding="utf-8")
|
ofile = open(ofileHtml,"w",encoding="utf-8")
|
||||||
ofile.write('''\
|
ofile.write('''\
|
||||||
<!DOCTYPE HTML>
|
<!DOCTYPE HTML>
|
||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
<title>opus-nt - Mod Documentation</title>
|
<title>opus-nt - Mod Documentation</title>
|
||||||
<meta charset="UTF-8">
|
<meta charset="UTF-8">
|
||||||
<style>
|
<style>
|
||||||
body {
|
body {
|
||||||
background-color: ButtonFace;
|
background-color: ButtonFace;
|
||||||
color: ButtonText;
|
color: ButtonText;
|
||||||
font: menu;
|
font: menu;
|
||||||
}
|
}
|
||||||
|
|
||||||
table {
|
table {
|
||||||
border: 1px outset ButtonShadow;
|
border: 1px outset ButtonShadow;
|
||||||
background-color: Window;
|
background-color: Window;
|
||||||
}
|
}
|
||||||
|
|
||||||
th, td {
|
th, td {
|
||||||
border: 1px inset ButtonShadow;
|
border: 1px inset ButtonShadow;
|
||||||
}
|
}
|
||||||
|
|
||||||
th, td {
|
th, td {
|
||||||
padding-left: 5px;
|
padding-left: 5px;
|
||||||
padding-right: 5px;
|
padding-right: 5px;
|
||||||
}
|
}
|
||||||
|
|
||||||
a {
|
a {
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
h1, h2, h3, h4, h5 {
|
h1, h2, h3, h4, h5 {
|
||||||
color: CaptionText;
|
color: CaptionText;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body>\
|
<body>\
|
||||||
''')
|
''')
|
||||||
tags = readTags()
|
tags = readTags()
|
||||||
|
|
||||||
ofile.write(makeHeading("Tags","tags"))
|
ofile.write(makeHeading("Tags","tags"))
|
||||||
ofile.write('''\
|
ofile.write('''\
|
||||||
<table>
|
<table>
|
||||||
<tr><th>Tag</th><th>Description</th></tr>
|
<tr><th>Tag</th><th>Description</th></tr>
|
||||||
''')
|
''')
|
||||||
for tag in tags:
|
for tag in tags:
|
||||||
ofile.write(' <tr><td><b>' +html.escape(tag)+ '</b></td><td>' +html.escape(tags[tag])+ '</td></tr>\n')
|
ofile.write(' <tr><td><b>' +html.escape(tag)+ '</b></td><td>' +html.escape(tags[tag])+ '</td></tr>\n')
|
||||||
|
|
||||||
ofile.write('</table>')
|
ofile.write('</table>')
|
||||||
modPaths = []
|
modPaths = []
|
||||||
for root,dirs,files in os.walk(opusPath):
|
for root,dirs,files in os.walk(opusPath):
|
||||||
for file in sorted(dirs):
|
for file in sorted(dirs):
|
||||||
ffile = p(root,file)
|
ffile = p(root,file)
|
||||||
lfile = ffile.replace(opusPath + os.path.sep,"",1)
|
lfile = ffile.replace(opusPath + os.path.sep,"",1)
|
||||||
if lfile.startswith("mods"):
|
if lfile.startswith("mods"):
|
||||||
modPaths.append(ffile)
|
modPaths.append(ffile)
|
||||||
break
|
break
|
||||||
|
|
||||||
for modPath in modPaths:
|
for modPath in modPaths:
|
||||||
modList = getModList(modPath,{})
|
modList = getModList(modPath,{})
|
||||||
lmodPath = modPath.replace(opusPath + os.path.sep,"",1)
|
lmodPath = modPath.replace(opusPath + os.path.sep,"",1)
|
||||||
ofile.write(makeHeading("Mods: " +lmodPath,lmodPath))
|
ofile.write(makeHeading("Mods: " +lmodPath,lmodPath))
|
||||||
ofile.write(html.escape(getDescription(modPath))+ "<br>\n")
|
ofile.write(html.escape(getDescription(modPath))+ "<br>\n")
|
||||||
|
|
||||||
ofile.write("<table>\n")
|
ofile.write("<table>\n")
|
||||||
ofile.write(' <tr><th>Mod</th><th>Tags</th><th>Description</th></tr>\n')
|
ofile.write(' <tr><th>Mod</th><th>Tags</th><th>Description</th></tr>\n')
|
||||||
for modk in modList:
|
for modk in modList:
|
||||||
mod = modList[modk]
|
mod = modList[modk]
|
||||||
ofile.write(' <tr><td>' +html.escape(pUp(mod["fmodname"]).replace("/","\\"))+ '\\<b>' +html.escape(mod["modname"])+ '</b></td><td>' +html.escape(", ".join(getTags(modk)))+ '</td><td>' +html.escape(getDescription(modk))+ '</td></tr>\n')
|
ofile.write(' <tr><td>' +html.escape(pUp(mod["fmodname"]).replace("/","\\"))+ '\\<b>' +html.escape(mod["modname"])+ '</b></td><td>' +html.escape(", ".join(getTags(modk)))+ '</td><td>' +html.escape(getDescription(modk))+ '</td></tr>\n')
|
||||||
|
|
||||||
ofile.write("</table><br>\n")
|
ofile.write("</table><br>\n")
|
||||||
|
|
||||||
|
|
||||||
ofile.write('</body>\n</html>')
|
ofile.write('</body>\n</html>')
|
||||||
ofile.close()
|
ofile.close()
|
||||||
shutil.copyfile(ofileHtml,ofileMd)
|
shutil.copyfile(ofileHtml,ofileMd)
|
||||||
|
|
||||||
main()
|
main()
|
||||||
|
|
|
@ -151,6 +151,7 @@ Mods that require System rights<br>
|
||||||
<tr><td>[hell]\<b>no start tiles</b></td><td>quality</td><td>Get rid of the default tiles pinned to the start menu.</td></tr>
|
<tr><td>[hell]\<b>no start tiles</b></td><td>quality</td><td>Get rid of the default tiles pinned to the start menu.</td></tr>
|
||||||
<tr><td>[hell]\<b>opus-nt_update</b></td><td>performance, quality</td><td>Remove Windows' automatic updates and updater entirely with a new one that filters unimportant updates and lets you decide when to upgrade your feature version.</td></tr>
|
<tr><td>[hell]\<b>opus-nt_update</b></td><td>performance, quality</td><td>Remove Windows' automatic updates and updater entirely with a new one that filters unimportant updates and lets you decide when to upgrade your feature version.</td></tr>
|
||||||
<tr><td>[hell]\<b>quick access - don't show frequent folders</b></td><td>quality</td><td>Don't show random folders in Explorer's sidebar to reduce clutter.</td></tr>
|
<tr><td>[hell]\<b>quick access - don't show frequent folders</b></td><td>quality</td><td>Don't show random folders in Explorer's sidebar to reduce clutter.</td></tr>
|
||||||
|
<tr><td>[hell]\<b>raise svchost split threshold</b></td><td>performance</td><td>Keeps svchost processes combined to reduce memory usage.</td></tr>
|
||||||
<tr><td>[hell]\<b>remove user libraries</b></td><td>quality</td><td>Stops Explorer from showing user libraries everywhere, reducing clutter.</td></tr>
|
<tr><td>[hell]\<b>remove user libraries</b></td><td>quality</td><td>Stops Explorer from showing user libraries everywhere, reducing clutter.</td></tr>
|
||||||
<tr><td>[hell]\<b>replace quick access shortcuts with user shortcut</b></td><td>quality</td><td>Removes default quick access pins and adds one for the current user to reduce clutter.</td></tr>
|
<tr><td>[hell]\<b>replace quick access shortcuts with user shortcut</b></td><td>quality</td><td>Removes default quick access pins and adds one for the current user to reduce clutter.</td></tr>
|
||||||
<tr><td>[unattend]\[10.0]\[amd64]\<b>unattend</b></td><td>quality</td><td>Skip certain questions in the last step of Windows setup.</td></tr>
|
<tr><td>[unattend]\[10.0]\[amd64]\<b>unattend</b></td><td>quality</td><td>Skip certain questions in the last step of Windows setup.</td></tr>
|
||||||
|
|
|
@ -151,6 +151,7 @@ Mods that require System rights<br>
|
||||||
<tr><td>[hell]\<b>no start tiles</b></td><td>quality</td><td>Get rid of the default tiles pinned to the start menu.</td></tr>
|
<tr><td>[hell]\<b>no start tiles</b></td><td>quality</td><td>Get rid of the default tiles pinned to the start menu.</td></tr>
|
||||||
<tr><td>[hell]\<b>opus-nt_update</b></td><td>performance, quality</td><td>Remove Windows' automatic updates and updater entirely with a new one that filters unimportant updates and lets you decide when to upgrade your feature version.</td></tr>
|
<tr><td>[hell]\<b>opus-nt_update</b></td><td>performance, quality</td><td>Remove Windows' automatic updates and updater entirely with a new one that filters unimportant updates and lets you decide when to upgrade your feature version.</td></tr>
|
||||||
<tr><td>[hell]\<b>quick access - don't show frequent folders</b></td><td>quality</td><td>Don't show random folders in Explorer's sidebar to reduce clutter.</td></tr>
|
<tr><td>[hell]\<b>quick access - don't show frequent folders</b></td><td>quality</td><td>Don't show random folders in Explorer's sidebar to reduce clutter.</td></tr>
|
||||||
|
<tr><td>[hell]\<b>raise svchost split threshold</b></td><td>performance</td><td>Keeps svchost processes combined to reduce memory usage.</td></tr>
|
||||||
<tr><td>[hell]\<b>remove user libraries</b></td><td>quality</td><td>Stops Explorer from showing user libraries everywhere, reducing clutter.</td></tr>
|
<tr><td>[hell]\<b>remove user libraries</b></td><td>quality</td><td>Stops Explorer from showing user libraries everywhere, reducing clutter.</td></tr>
|
||||||
<tr><td>[hell]\<b>replace quick access shortcuts with user shortcut</b></td><td>quality</td><td>Removes default quick access pins and adds one for the current user to reduce clutter.</td></tr>
|
<tr><td>[hell]\<b>replace quick access shortcuts with user shortcut</b></td><td>quality</td><td>Removes default quick access pins and adds one for the current user to reduce clutter.</td></tr>
|
||||||
<tr><td>[unattend]\[10.0]\[amd64]\<b>unattend</b></td><td>quality</td><td>Skip certain questions in the last step of Windows setup.</td></tr>
|
<tr><td>[unattend]\[10.0]\[amd64]\<b>unattend</b></td><td>quality</td><td>Skip certain questions in the last step of Windows setup.</td></tr>
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
Keeps svchost processes combined to reduce memory usage.
|
|
@ -0,0 +1,3 @@
|
||||||
|
for key in opusnt.regQueryKeys(opusnt.regTmpPath + "system"):
|
||||||
|
if key.lower().startswith(opusnt.regTmpPath.lower() + "system\\controlset"):
|
||||||
|
opusnt.runReg(["add",key+ "\\Control","/v","SvcHostSplitThresholdInKB","/t","REG_DWORD","/d","0xffffffff","/f"])
|
|
@ -0,0 +1 @@
|
||||||
|
performance
|
Loading…
Reference in New Issue