Ejemplo n.º 1
0
def get_window_name(id):
    """
        Fetch name of the window with corresponding id
    """
    command = "xdotool getwindowname {}".format(id)
    output, error = exe(command)
    return output.strip()
Ejemplo n.º 2
0
def activate_window(id):
    """
        Focus the window
    """
    command = "xdotool windowactivate {}".format(id)
    output, error = exe(command)
    return output
Ejemplo n.º 3
0
def search_window_class(class_name):
    """
        Search all the windows with class name
        Eg: xdotool search --class Chromium
    """
    command = "xdotool search --class {}".format(class_name)
    output, error = exe(command)
    return output.split()
Ejemplo n.º 4
0
def sleep(sec):
    command = "xdotool sleep".format(sec)
    output, error = exe(command)
Ejemplo n.º 5
0
def send_keys(*args):
    key = '+'.join(args)
    command = "xdotool key --clearmodifiers {}".format(key)
    output, error = exe(command)
    return output
Ejemplo n.º 6
0
def get_window_active():
    """
        Fetch id of the currently active window
    """
    output, error = exe("xdotool getactivewindow")
    return output