ADd sleep

This commit is contained in:
psy 2019-06-02 17:35:31 +02:00
parent 8c00209ec3
commit b52460d87c
1 changed files with 7 additions and 4 deletions

11
main.c
View File

@ -2,6 +2,7 @@
#include <X11/Xlib.h> #include <X11/Xlib.h>
#include <time.h> #include <time.h>
#include <stdbool.h> #include <stdbool.h>
#include <zconf.h>
void moveCursor(int destX, int destY) { void moveCursor(int destX, int destY) {
Display *dpy; Display *dpy;
@ -20,10 +21,12 @@ int getRandom(int lower, int upper) {
} }
int main() { int main() {
while(true) {
sleep(getRandom(60, 600));
if (getRandom(0, 100) > 50) {
continue;
}
if (getRandom(0, 100) > 50) { moveCursor(getRandom(0, 1920), getRandom(0, 1080));
return 0;
} }
moveCursor(getRandom(0, 1920), getRandom(0, 1080));
} }