Added xlib.py and fixed user activity support