Rename module, split program categories
This commit is contained in:
parent
9ec51fa959
commit
e9f92af66f
@ -1,5 +0,0 @@
|
|||||||
from .cmd_tools import CmdToolsModule
|
|
||||||
|
|
||||||
|
|
||||||
def get_module():
|
|
||||||
return CmdToolsModule()
|
|
@ -1,19 +0,0 @@
|
|||||||
import json
|
|
||||||
import subprocess
|
|
||||||
|
|
||||||
from AbstractModule import AbstractModule
|
|
||||||
|
|
||||||
|
|
||||||
class CmdToolsModule(AbstractModule):
|
|
||||||
def run(self):
|
|
||||||
print("Try to install basic Command-line tools")
|
|
||||||
|
|
||||||
with open("modules/command-line tools/programs.json") as config_file:
|
|
||||||
programs_json = json.load(config_file)
|
|
||||||
programs_list = ""
|
|
||||||
for program in programs_json:
|
|
||||||
programs_list += " " + program
|
|
||||||
|
|
||||||
subprocess.run("sudo apt install" + programs_list, shell=True)
|
|
||||||
|
|
||||||
print("Script ran to completion.")
|
|
@ -1,8 +0,0 @@
|
|||||||
[
|
|
||||||
"bleachbit",
|
|
||||||
"nano",
|
|
||||||
"xrdp",
|
|
||||||
"htop",
|
|
||||||
"bash-completion",
|
|
||||||
"dialog"
|
|
||||||
]
|
|
5
modules/program-installer/__init__.py
Normal file
5
modules/program-installer/__init__.py
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
from .module import CmdToolsModule
|
||||||
|
|
||||||
|
|
||||||
|
def get_module():
|
||||||
|
return CmdToolsModule()
|
26
modules/program-installer/module.py
Normal file
26
modules/program-installer/module.py
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
import json
|
||||||
|
import subprocess
|
||||||
|
|
||||||
|
from AbstractModule import AbstractModule
|
||||||
|
|
||||||
|
|
||||||
|
class CmdToolsModule(AbstractModule):
|
||||||
|
|
||||||
|
def __init__(self):
|
||||||
|
super().__init__()
|
||||||
|
with open("modules/program-installer/programs.json") as config_file:
|
||||||
|
self.programs_json = json.load(config_file)
|
||||||
|
|
||||||
|
def run(self):
|
||||||
|
"""Install the most basic tools!"""
|
||||||
|
print("Try to install basic Command-line tools")
|
||||||
|
|
||||||
|
programs_list = " ".join(p for p in self.programs_json['basic-tools'])
|
||||||
|
subprocess.run("apt install" + programs_list, shell=True)
|
||||||
|
|
||||||
|
print("Script ran to completion.")
|
||||||
|
|
||||||
|
def hard_drive_tools(self):
|
||||||
|
"""Install tools to look up smart information from your hard-drives"""
|
||||||
|
programs_list = " ".join(p for p in self.programs_json['hard-drive'])
|
||||||
|
subprocess.run("apt install " + programs_list, shell=True)
|
16
modules/program-installer/programs.json
Normal file
16
modules/program-installer/programs.json
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
{
|
||||||
|
"basic-tools": [
|
||||||
|
"bleachbit",
|
||||||
|
"nano",
|
||||||
|
"xrdp",
|
||||||
|
"htop",
|
||||||
|
"bash-completion",
|
||||||
|
"dialog",
|
||||||
|
"powertop",
|
||||||
|
"tree"
|
||||||
|
],
|
||||||
|
"hard-drive": [
|
||||||
|
"smartmontools",
|
||||||
|
"gsmartcontrol"
|
||||||
|
]
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user