#
# Copyright (C) 2019-Present A-Team Digital Solutions
#

import os
from pathlib import Path
from gi.repository import (
    GLib,
    Vte

)
BASE = str(
    Path(__file__).resolve().parent.parent
)

class ResourceMonitor:
    def get_command(self):
        return [
            "bash",
            os.path.join(
                BASE,
                "scripts",
                "resource_monitor.sh"
            )
        ]
    def get_workdir(self):
        return BASE
    def start(self, terminal):
        terminal.spawn_async(
            Vte.PtyFlags.DEFAULT,
            self.get_workdir(),
            self.get_command(),
            None,
            GLib.SpawnFlags.DEFAULT,
            None,
            None,
            -1,
            None,
            None
        )
