diff --git a/docgen/generate-docs.py b/docgen/generate-docs.py old mode 100644 new mode 100755 index 3b64e08..d716697 --- a/docgen/generate-docs.py +++ b/docgen/generate-docs.py @@ -1,162 +1,162 @@ -#!/usr/bin/env python3 -import sys - -oldexcepthook = sys.excepthook -def newexcepthook(type,value,traceback): - oldexcepthook(type,value,traceback) - input("Press ENTER to quit.") -sys.excepthook = newexcepthook - -import os -p = os.path.join -pUp = os.path.dirname -s = False -if getattr(sys, 'frozen', False) and hasattr(sys, '_MEIPASS'): - s = os.path.realpath(sys.executable) -else: - s = os.path.realpath(__file__) -sp = pUp(s) - -# script start -import html -import shutil - -def getDescription(dir): - desc = "No description" - try: - with open(p(dir,"description.txt")) as dfile: - desc = dfile.read().strip(" \t\r\n") - except: - pass - - return desc - -def getTags(dir): - tags = ["none"] - try: - with open(p(dir,"tags.txt")) as tfile: - tags = tfile.read().strip(" \t\r\n").split(" ") - except: - pass - return tags - -def getModList(dir, modlist = {}, rootdir = False): - if rootdir == False: rootdir = dir - for root,dirs,files in os.walk(dir): - for file in sorted(dirs): - ffile = p(root,file) - lfile = ffile.replace(rootdir + os.path.sep,"",1) - modname = ffile.replace(dir + os.path.sep,"",1) - activated = True - if modname[0] == "-": - modname = modname[1:] - activated = False - if modname[0] == "[" and modname[-1] == "]": - getModList(ffile,modlist,rootdir) - continue - fmodname = p(pUp(lfile),modname) - modlist[ffile] = { - "modname": modname, - "fmodname": fmodname, - "activated": activated - } - break - return modlist - -def makeHeading(title,id,size = 1): - return '# ' +html.escape(title)+ '\n' - -def readTags(): - tags = {} - with open(p(sp,"tags.txt"),encoding="utf-8") as tfile: - for line in tfile: - line = line.strip(" \t\r\n") - if line == "": continue - tagSplit = line.split(" ",1) - tags[tagSplit[0]] = tagSplit[1] - return tags - -def main(): - opusPath = pUp(sp) - ofileHtml = p(opusPath,"docs","index.html") - ofileMd = p(opusPath,"docs","index.md") - ofile = open(ofileHtml,"w",encoding="utf-8") - ofile.write('''\ - - - -opus-nt - Mod Documentation - - - - -\ -''') - tags = readTags() - - ofile.write(makeHeading("Tags","tags")) - ofile.write('''\ - - -''') - for tag in tags: - ofile.write(' \n') - - ofile.write('
TagDescription
' +html.escape(tag)+ '' +html.escape(tags[tag])+ '
') - modPaths = [] - for root,dirs,files in os.walk(opusPath): - for file in sorted(dirs): - ffile = p(root,file) - lfile = ffile.replace(opusPath + os.path.sep,"",1) - if lfile.startswith("mods"): - modPaths.append(ffile) - break - - for modPath in modPaths: - modList = getModList(modPath,{}) - lmodPath = modPath.replace(opusPath + os.path.sep,"",1) - ofile.write(makeHeading("Mods: " +lmodPath,lmodPath)) - ofile.write(html.escape(getDescription(modPath))+ "
\n") - - ofile.write("\n") - ofile.write(' \n') - for modk in modList: - mod = modList[modk] - ofile.write(' \n') - - ofile.write("
ModTagsDescription
' +html.escape(pUp(mod["fmodname"]).replace("/","\\"))+ '\\' +html.escape(mod["modname"])+ '' +html.escape(", ".join(getTags(modk)))+ '' +html.escape(getDescription(modk))+ '

\n") - - - ofile.write('\n') - ofile.close() - shutil.copyfile(ofileHtml,ofileMd) - -main() \ No newline at end of file +#!/usr/bin/env python3 +import sys + +oldexcepthook = sys.excepthook +def newexcepthook(type,value,traceback): + oldexcepthook(type,value,traceback) + input("Press ENTER to quit.") +sys.excepthook = newexcepthook + +import os +p = os.path.join +pUp = os.path.dirname +s = False +if getattr(sys, 'frozen', False) and hasattr(sys, '_MEIPASS'): + s = os.path.realpath(sys.executable) +else: + s = os.path.realpath(__file__) +sp = pUp(s) + +# script start +import html +import shutil + +def getDescription(dir): + desc = "No description" + try: + with open(p(dir,"description.txt")) as dfile: + desc = dfile.read().strip(" \t\r\n") + except: + pass + + return desc + +def getTags(dir): + tags = ["none"] + try: + with open(p(dir,"tags.txt")) as tfile: + tags = tfile.read().strip(" \t\r\n").split(" ") + except: + pass + return tags + +def getModList(dir, modlist = {}, rootdir = False): + if rootdir == False: rootdir = dir + for root,dirs,files in os.walk(dir): + for file in sorted(dirs): + ffile = p(root,file) + lfile = ffile.replace(rootdir + os.path.sep,"",1) + modname = ffile.replace(dir + os.path.sep,"",1) + activated = True + if modname[0] == "-": + modname = modname[1:] + activated = False + if modname[0] == "[" and modname[-1] == "]": + getModList(ffile,modlist,rootdir) + continue + fmodname = p(pUp(lfile),modname) + modlist[ffile] = { + "modname": modname, + "fmodname": fmodname, + "activated": activated + } + break + return modlist + +def makeHeading(title,id,size = 1): + return '# ' +html.escape(title)+ '\n' + +def readTags(): + tags = {} + with open(p(sp,"tags.txt"),encoding="utf-8") as tfile: + for line in tfile: + line = line.strip(" \t\r\n") + if line == "": continue + tagSplit = line.split(" ",1) + tags[tagSplit[0]] = tagSplit[1] + return tags + +def main(): + opusPath = pUp(sp) + ofileHtml = p(opusPath,"docs","index.html") + ofileMd = p(opusPath,"docs","index.md") + ofile = open(ofileHtml,"w",encoding="utf-8") + ofile.write('''\ + + + +opus-nt - Mod Documentation + + + + +\ +''') + tags = readTags() + + ofile.write(makeHeading("Tags","tags")) + ofile.write('''\ + + +''') + for tag in tags: + ofile.write(' \n') + + ofile.write('
TagDescription
' +html.escape(tag)+ '' +html.escape(tags[tag])+ '
') + modPaths = [] + for root,dirs,files in os.walk(opusPath): + for file in sorted(dirs): + ffile = p(root,file) + lfile = ffile.replace(opusPath + os.path.sep,"",1) + if lfile.startswith("mods"): + modPaths.append(ffile) + break + + for modPath in modPaths: + modList = getModList(modPath,{}) + lmodPath = modPath.replace(opusPath + os.path.sep,"",1) + ofile.write(makeHeading("Mods: " +lmodPath,lmodPath)) + ofile.write(html.escape(getDescription(modPath))+ "
\n") + + ofile.write("\n") + ofile.write(' \n') + for modk in modList: + mod = modList[modk] + ofile.write(' \n') + + ofile.write("
ModTagsDescription
' +html.escape(pUp(mod["fmodname"]).replace("/","\\"))+ '\\' +html.escape(mod["modname"])+ '' +html.escape(", ".join(getTags(modk)))+ '' +html.escape(getDescription(modk))+ '

\n") + + + ofile.write('\n') + ofile.close() + shutil.copyfile(ofileHtml,ofileMd) + +main() diff --git a/docs/index.html b/docs/index.html index 80ba7de..e76ab96 100644 --- a/docs/index.html +++ b/docs/index.html @@ -151,6 +151,7 @@ Mods that require System rights
[hell]\no start tilesqualityGet rid of the default tiles pinned to the start menu. [hell]\opus-nt_updateperformance, qualityRemove Windows' automatic updates and updater entirely with a new one that filters unimportant updates and lets you decide when to upgrade your feature version. [hell]\quick access - don't show frequent foldersqualityDon't show random folders in Explorer's sidebar to reduce clutter. + [hell]\raise svchost split thresholdperformanceKeeps svchost processes combined to reduce memory usage. [hell]\remove user librariesqualityStops Explorer from showing user libraries everywhere, reducing clutter. [hell]\replace quick access shortcuts with user shortcutqualityRemoves default quick access pins and adds one for the current user to reduce clutter. [unattend]\[10.0]\[amd64]\unattendqualitySkip certain questions in the last step of Windows setup. diff --git a/docs/index.md b/docs/index.md index 80ba7de..e76ab96 100644 --- a/docs/index.md +++ b/docs/index.md @@ -151,6 +151,7 @@ Mods that require System rights
[hell]\no start tilesqualityGet rid of the default tiles pinned to the start menu. [hell]\opus-nt_updateperformance, qualityRemove Windows' automatic updates and updater entirely with a new one that filters unimportant updates and lets you decide when to upgrade your feature version. [hell]\quick access - don't show frequent foldersqualityDon't show random folders in Explorer's sidebar to reduce clutter. + [hell]\raise svchost split thresholdperformanceKeeps svchost processes combined to reduce memory usage. [hell]\remove user librariesqualityStops Explorer from showing user libraries everywhere, reducing clutter. [hell]\replace quick access shortcuts with user shortcutqualityRemoves default quick access pins and adds one for the current user to reduce clutter. [unattend]\[10.0]\[amd64]\unattendqualitySkip certain questions in the last step of Windows setup. diff --git a/mods/[hell]/raise svchost split threshold/description.txt b/mods/[hell]/raise svchost split threshold/description.txt new file mode 100644 index 0000000..48bb820 --- /dev/null +++ b/mods/[hell]/raise svchost split threshold/description.txt @@ -0,0 +1 @@ +Keeps svchost processes combined to reduce memory usage. diff --git a/mods/[hell]/raise svchost split threshold/modscript.py b/mods/[hell]/raise svchost split threshold/modscript.py new file mode 100644 index 0000000..344ca6d --- /dev/null +++ b/mods/[hell]/raise svchost split threshold/modscript.py @@ -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"]) diff --git a/mods/[hell]/raise svchost split threshold/tags.txt b/mods/[hell]/raise svchost split threshold/tags.txt new file mode 100644 index 0000000..3c804e8 --- /dev/null +++ b/mods/[hell]/raise svchost split threshold/tags.txt @@ -0,0 +1 @@ +performance \ No newline at end of file