def getWinId(self):
"""
Get Window id by clicking using xwininfo tool
"""
wininfo = subprocess.Popen('xwininfo', shell=True, stdout=subprocess.PIPE).stdout
for line in wininfo:
if line.find('Window id: ') > -1:
return line[21:30]
return 0
def getWinSnap(self):
"""
Get snapshot of window
"""
id = self.getWinId()
snap = QtGui.QPixmap.grabWindow(id)
print id