()
return None
returns the details about the window not just the title
returns the details about the window not just the title
returns the details about the window not just the title
def get_active_window_raw():
    '''
    returns the details about the window not just the title
    '''
    root = subprocess.Popen(
        ['xprop', '-root', '_NET_ACTIVE_WINDOW'], stdout=subprocess.PIPE)
    stdout, stderr = root.communicate()

    m = re.search(b'^_NET_ACTIVE_WINDOW.* ([\w]+)$', stdout)
    if m != None:
        window_id = m.group(1)
        window = subprocess.Popen(
            ['xprop', '-id', window_id, 'WM_NAME'], stdout=subprocess.PIPE)
        stdout, stderr = window.communicate()
    else:
        return None

    match = re.match(b"WM_NAME\(\w+\) = (?P<name>.+)$", stdout)
    if match != None:
        ret = match.group("name").strip(b'"')
        #print(type(ret))
        '''
        ret is str for python2
        ret is bytes for python3 (- gives error while calling in other file)
        be careful
        '''
        return ret
    return None
def get_active_window_raw ( ) : root = subprocess . Popen ( [ 'xprop' , '-root' , '_NET_ACTIVE_WINDOW' ] , stdout = subprocess . PIPE ) stdout , stderr = root . communicate ( ) m = re . search ( b'^_NET_ACTIVE_WINDOW.* ([\w]+)$' , stdout ) if m != None : window_id = m . group ( 1 ) window = subprocess . Popen ( [ 'xprop' , '-id' , window_id , 'WM_NAME' ] , stdout = subprocess . PIPE ) stdout , stderr = window . communicate ( ) else : return None match = re . match ( b"WM_NAME\(\w+\) = (?P<name>.+)$" , stdout ) if match != None : ret = match . group ( "name" ) . strip ( b'"' ) #print(type(ret)) '''
        ret is str for python2
        ret is bytes for python3 (- gives error while calling in other file)
        be careful
        ''' return ret return None