#!/usr/bin/python3
# -*- coding: utf-8 -*-

import os
import sys
import subprocess
tlp="/usr/bin/tlp"
tlp2="/usr/sbin/tlp"

if os.path.exists(tlp) or os.path.exists(tlp2):
    if __name__ == "__main__":
        pgrep = subprocess.getoutput("pgrep slimbookbattery")
        numProcRunning = pgrep.split('\n')
        if len(numProcRunning) > 1:
            print("Slimbook Battery it's in execution")
        else:
            os.system('python3 /usr/share/slimbookbattery/slimbookbattery')
else:
    if __name__ == "__main__":
        pgrep = subprocess.getoutput("pgrep slimbookbattery")
        numProcRunning = pgrep.split('\n')
        if len(numProcRunning) > 1:
            print("Slimbook Battery it's in execution")
        else:
            os.system('python3 /usr/share/slimbookbattery/lmt/slimbookbatterylmt')
exit(0)
