Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
15 changes: 15 additions & 0 deletions desktopAssistant.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import smtplib
import requests
from weather import Weather
import psutil

def talkToMe(audio):
"speaks audio passed as argument"
Expand Down Expand Up @@ -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:
Expand Down
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@ SpeechRecognition==3.8.1
urllib3==1.24.2
beautifulsoup4==4.6.0
weather-api==0.0.4
psutil