Created
October 14, 2014 23:47
-
-
Save TheWaWaR/f0fc672f9396515c9065 to your computer and use it in GitHub Desktop.
Capture window by {xwd}
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import os | |
import sys | |
def main(wid): | |
arg_dict = {'wid': wid} | |
CMD_XWD = 'xwd -id %(wid)d -out %(wid)d.xwd' % arg_dict | |
CMD_CONVERT = 'convert %(wid)d.xwd %(wid)d.png' % arg_dict | |
os.system('xwininfo -id %d' % wid) | |
print CMD_XWD | |
os.system(CMD_XWD) | |
print CMD_CONVERT | |
os.system(CMD_CONVERT) | |
if __name__ == '__main__': | |
main(int(sys.argv[1])) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment