def stop_music(): if ad.is_ubuntu(): os.system("rhythmbox-client --stop") return "Music stopped" else: return "Not available for windows yet"
def remind(msg, date, time): reminder_time = time[0].split(':') current_time = get_time().split('-') today_date = get_date().split('-') months = [ 'jan', 'feb', 'march', 'april', 'may', 'june', 'july', 'aug', 'sep', 'oct', 'nov', 'dec' ] reminder_date = date.split(' ') # print(today_date[1]) # print(months.index(reminder_date[1].lower())+1) if int(today_date[1]) == months.index(reminder_date[1].lower()) + 1: if reminder_time[0] == current_time[0] and reminder_time[ 1] == current_time[1]: remind_msg = 'notify-send "' + msg + '"' if ad.is_ubuntu(): os.system(remind_msg) else: from win10toast import ToastNotifier toaster = ToastNotifier() toaster.show_toast("Virtual Assistant", msg) return True return False
def pause_music(): if ad.is_ubuntu(): os.system("rhythmbox-client --pause") return "Music paused" else: #windows code return "For windows its not available it"
def previous_song(): if ad.is_ubuntu(): os.system("rhythmbox-client --previous") return "Playing Previous Song" else: return "For windows its not available"
def next_song(): if ad.is_ubuntu(): os.system("rhythmbox-client --next") return "Playing Next Song" else: return "For windows its not available"
def stop_music(): if ad.is_ubuntu(): os.system("rhythmbox-client --stop") return "Music Stoped" else: return "For windows its not available"
def play_music(): if ad.is_ubuntu(): os.system("rhythmbox-client --play") return "Playing Music" else: #windows code return "For windows its not available it"
def play_music(): if ad.is_ubuntu(): os.system("rhythmbox-client --play") return "Playing Music" else: os.startfile(os.path.join(music_path, songs[0])) return "Playing Music"
def play_specific_song(song_name): song_name = song_name.replace('play', '') if ad.is_ubuntu(): file_search.set_root(music_path) songs = file_search.searchFile(song_name) try: song_uri = songs[0] command = 'rhythmbox-client --play-uri="' + song_uri + '"' os.system(command) return ("playing " + song_name) except: return ("song not found in your computer") else: return "not availble for windows yet"
def change_wallpaper(): if ad.is_ubuntu(): wallpaper_path = '/home/shivam-gupta/Pictures/Wallpapers' wallpapers = os.listdir(wallpaper_path) #os.system("export GIO_EXTRA_MODULES=/usr/lib/x86_64-linux-gnu/gio/modules/") wallpaper = random.choice(wallpapers) command = 'export GIO_EXTRA_MODULES=/usr/lib/x86_64-linux-gnu/gio/modules/' + '\n' + 'gsettings set org.gnome.desktop.background picture-uri file:///' + wallpaper_path + "/" + wallpaper os.system(command) return "Wallpaper changed" else: import ctypes SPI_SETDESKWALLPAPER = 20 ctypes.windll.user32.SystemParametersInfoW( SPI_SETDESKWALLPAPER, 0, 'C:\\Users\\shiva\\Desktop\\AI_Virtual_Assistant\\image.jpg', 0) return "Wallpaper changed"
def play_specific_song(song_name): song_name = song_name.replace('play ', '') if ad.is_ubuntu(): file_search.set_root(music_path) songs = file_search.searchFile(song_name) try: song_uri = songs[0] command = 'rhythmbox-client --play-uri="' + song_uri + '"' os.system(command) return "Playing " + song_name except: return ("Song not found in your computer") else: file_search.set_root(music_path) songs = file_search.searchFile(song_name) try: os.startfile(os.path.join(music_path, songs[0])) return "Playing " + song_name except: return "Song not found in your computer"
from output_module import output import welcome import os import assistant_details as ad from database import listen_is_on from listen_module import listen import AssistantGUI as gui from automatic import check_last_modify from pathlib import Path my_file = Path("setup.py") if my_file.is_file(): import setup if ad.is_ubuntu(): os.system('clear') else: os.system('cls') def installation(): f = open("setup.py", "a") print("-----------Welcome to Virtual Assistant------------") output("Before starting few Setup is required") output("Should I Call You Ma'am or Sir or whatever you say") status = take_input() statement1 = 'status = "' + status + '"' + '\n' f.write(statement1) output("Do you want to set the path for music") ans = take_input()
def previous_song(): if ad.is_ubuntu(): os.system("rhythmbox-client --previous") return "Playing previous song" else: return "not availble for windows yet"
def next_song(): if ad.is_ubuntu(): os.system("rhythmbox-client --next") return "Playing next song" else: return "not availble for windows yet"