예제 #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()
예제 #2
0
def activate_window(id):
    """
        Focus the window
    """
    command = "xdotool windowactivate {}".format(id)
    output, error = exe(command)
    return output
예제 #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()
예제 #4
0
def sleep(sec):
    command = "xdotool sleep".format(sec)
    output, error = exe(command)
예제 #5
0
def send_keys(*args):
    key = '+'.join(args)
    command = "xdotool key --clearmodifiers {}".format(key)
    output, error = exe(command)
    return output
예제 #6
0
def get_window_active():
    """
        Fetch id of the currently active window
    """
    output, error = exe("xdotool getactivewindow")
    return output