Esempio n. 1
0
def f(n):
    ids = store.get_global_value("mru_ids")
    if ids:
        ids = ids.split("$|$")
        win_title = window.get_active_title()
        #dialog.info_dialog(win_title)
        win_id = get_active_window_id(win_title, system.exec_command)

        id_to_activate = ids[0] if win_id != ids[0] else update_mru(n, ids)

        title_to_activate = get_win_title_from_id(id_to_activate,
                                                  system.exec_command)
        if win_title != title_to_activate:
            #if win_id in ids:
            #    try:
            #        #This has to be in a trycatch for some reason
            #        system.exec_command('xdotool getactivewindow windowminimize')
            #    except:
            #       pass
            window.activate(title_to_activate)
        else:
            try:
                system.exec_command('xdotool getactivewindow windowminimize')
            except:
                pass
def f(double):
    win_id = store.get_global_value('remembered_win_7_id')

    if win_id is not None:
        win_title = get_win_title_from_id(win_id, system.exec_command)
        active_title = window.get_active_title()
        if win_title == active_title:
            try:
                if double:
                    system.exec_command('xdotool getactivewindow set_desktop_for_window 0')
                else:
                    system.exec_command('xdotool getactivewindow windowminimize')
            except:
                pass
        else:
            window.activate(win_title)
Esempio n. 3
0
def new_tab():
    active_class = window.get_active_class()

    if 'Brave' in active_class:
        keyboard.send_keys('<ctrl>+t')
        time.sleep(0.01)
    else:
        win_id = store.get_global_value('chrome_win_id_for_new_tabs')
        win_title = get_win_title_from_id(win_id, system.exec_command)
        if win_title:
            window.activate(win_title)
            keyboard.send_keys('<ctrl>+t')
            time.sleep(0.01)
        else:
            system.exec_command('google-chrome' if 'oogle-chrome' in
                                active_class else 'brave-browser')
            retCode = window.wait_for_focus('New Tab', timeOut=0.1)
from utils import get_win_title_from_id

win_id = store.get_global_value('remembered_win_5_id')

if win_id is not None:
    win_title = get_win_title_from_id(win_id, system.exec_command)
    active_title = window.get_active_title()
    if win_title == active_title:
        try:
            system.exec_command('xdotool getactivewindow windowminimize')
        except:
            pass
    else:
        window.activate(win_title)