Created
October 21, 2011 18:37
-
-
Save fearofcode/1304595 to your computer and use it in GitHub Desktop.
handy script to print out mouse position in Linux (tested on Ubuntu 11.04 64-bit). requires python-xlib
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
import time | |
from Xlib import X, display | |
while True: | |
d = display.Display() | |
s = d.screen() | |
root = s.root | |
a=root.query_pointer() | |
b=a._data | |
print b["root_x"], b["root_y"] | |
d.sync() | |
time.sleep(1) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment