2016-12-23 19 views
0

테스트 목적으로 Xvfb를 사용했습니다. 오늘 wmctrl 명령으로 일부 테스트를 수행하려고합니다. 나는이 같은 파이썬에서 몇 가지 테스트를 수행합니다Xvfb - xvfb에 대한 창 관리자 시작 또는 연결

display = ":99" 
    pXvfb = subprocess.Popen(["Xvfb", display, "-screen", "0", "1024x768x24"]) 

    # wait that xvfb is up 
    time.sleep(1) 

    os.environ["DISPLAY"] = display 

    p = subprocess.Popen(["wmctrl", "-l" ]) 
    p.wait() 


    pXvfb.terminate() 

이 테스트에서 wmctrl는 말한다 :

Cannot get client list properties. 
(_NET_CLIENT_LIST or _WIN_CLIENT_LIST) 

내가 어떤 창 관리자 내 Xvfb가 부착하지 않았기 때문에 정상입니다, 생각합니다.

Xvfb 만 관리하려면 Windows 관리자 (Enlighenment should be good for my case)를 시작하는 방법은 무엇입니까?

답변

0

몇 일간의 작업 끝에 나 자신에게 대답 할 수 있습니다. 솔루션은 가능한 한 쉽습니다 : DISPLAY 변수가 설정된 Windows 관리자를 시작하십시오. 그래서 내 파이썬 스크립트에서, 난 그냥 :

display = ":99" 
pXvfb = subprocess.Popen(["Xvfb", display, "-screen", "0", "1024x768x24"]) 

# wait that xvfb is up 
time.sleep(1) 

os.environ["DISPLAY"] = display 

# start windows manager 
pWM = subprocess.Popen(["/usr/bin/enlightenment_start", ] ) 

p = subprocess.Popen(["wmctrl", "-l" ]) 
p.wait() 


pXvfb.terminate()