Skip to content

Instantly share code, notes, and snippets.

@ankurs
Created November 13, 2011 18:17
Show Gist options
  • Save ankurs/1362439 to your computer and use it in GitHub Desktop.
Save ankurs/1362439 to your computer and use it in GitHub Desktop.
Watch movie without screen getting locked
#include<X11/Xlib.h>
#include<X11/Xutil.h>
#include<X11/keysym.h>
#include<unistd.h>
#define DURATION 100
int main()
{
Display *display = NULL;
display = XOpenDisplay(NULL);
while(1)
{
XWarpPointer(display, None, None, 0, 0, 0, 0, 100, 100);
XFlush(display);
sleep(DURATION);
XWarpPointer(display, None, None, 0, 0, 0, 0, -100, -100);
XFlush(display);
sleep(DURATION);
}
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment