diff --git a/README.md b/README.md index 8f5d543..0fe95ea 100644 --- a/README.md +++ b/README.md @@ -28,3 +28,7 @@ Supported commands : * Current weather in {cityname} : Tells you the current condition and temperture * weather forecast in {cityname} : Tells you the condition, highest and lowest temperture of the next two days * What's up +* shut down : shut down the system +* open notepad : Opens the notepad +* battery status : Tells you the current battery status of the system +* cpu status : Tells you the current CPU status of the system diff --git a/desktopAssistant.py b/desktopAssistant.py index 5186e19..a643f94 100644 --- a/desktopAssistant.py +++ b/desktopAssistant.py @@ -6,6 +6,7 @@ import smtplib import requests from weather import Weather +import psutil def talkToMe(audio): "speaks audio passed as argument" @@ -55,6 +56,20 @@ def assistant(command): webbrowser.open(url) print('Done!') + elif 'shutdown' in command: + talkToMe("system is going to shutdown") + os.system("shutdown /s /t 1") + + elif 'battery' in command: + battery=psutil.sensors_battery() + talkToMe("Your is system is at " + str(battery.percent) + " percent") + + elif 'cpu' in command: + talkToMe("CPU is at" + str(psutil.cpu_percent())) + + elif 'notepad' in command: + os.system('notepad') + elif 'open website' in command: reg_ex = re.search('open website (.+)', command) if reg_ex: diff --git a/requirements.txt b/requirements.txt index bd41a2b..18a08d3 100644 --- a/requirements.txt +++ b/requirements.txt @@ -11,3 +11,4 @@ SpeechRecognition==3.8.1 urllib3==1.24.2 beautifulsoup4==4.6.0 weather-api==0.0.4 +psutil \ No newline at end of file