Beispiel #1
0
def main():
    commandLineControlMac()
    bootZoom()

    global text_stream

    start_state_checking(1)
    start_listen()
    while True:
        while KEYWORD not in text_stream[0]:
            time.sleep(.25)
        raw_text = text_stream[0]
        text_stream[0] = ''

        print(raw_text)
        print(state)

        if curr_system == 'Darwin':
            os.system(
                '''/usr/bin/osascript -e 'tell app "Finder" to set frontmost of process "zoom.us" to true' '''
            )
        else:
            shortcut('focus')

        time.sleep(.1)

        raw_text = sliceAfterSubstr(raw_text, KEYWORD)
        if " and " in raw_text:
            texts = [
                sliceUpToSubstr(raw_text, " and "),
                sliceAfterSubstr(raw_text, " and ")
            ]
        else:
            texts = [raw_text]
        for text in texts:
            if not text.strip(): continue
            compared = mostSimilar(text, [x for x in vectorized_commands])[0]
            if 'send this message' not in compared:
                text = compared
            for command, callback in commands.items():
                if command in text:
                    if 'send' in command:
                        if 'message' in command:
                            callback(
                                sliceAfterSubstr(text, command + ' ') + '\n')
                        else:
                            callback(macros[command])
                    else:
                        callback()
                    break
Beispiel #2
0
def leave_meeting():
    shortcut('toggle_leave_meeting', content='\n')
Beispiel #3
0
def send_chat(message):
    if state['chat'] == 1:
        shortcut('toggle_chat')
    shortcut('toggle_chat', content=message)
Beispiel #4
0
def toggle_hand():
    shortcut('toggle_hand')
Beispiel #5
0
def open_chat():
    if state['chat'] == 0:
        shortcut('toggle_chat')
Beispiel #6
0
def close_chat():
    if state['chat'] == 1:
        shortcut('toggle_chat')
Beispiel #7
0
def start_share():
    if state['share'] == 0:
        shortcut('toggle_share', content='\n')
Beispiel #8
0
def stop_share():
    if state['share'] == 1:
        shortcut('toggle_share')
Beispiel #9
0
def stop_video():
    if state['video'] == 1:
        shortcut('toggle_video')
Beispiel #10
0
def start_video():
    if state['video'] == 0:
        shortcut('toggle_video')
Beispiel #11
0
def mute():
    if state['audio'] == 1:
        shortcut('toggle_audio')
Beispiel #12
0
def unmute():
    if state['audio'] == 0:
        shortcut('toggle_audio')
Beispiel #13
0
def toggle_fullscreen():
    shortcut('toggle_fullscreen')