Skip to content

Instantly share code, notes, and snippets.

@fearofcode
Created October 21, 2011 18:37
Show Gist options
  • Save fearofcode/1304595 to your computer and use it in GitHub Desktop.
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
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