Introduction
Introduction Statistics Contact Development Disclaimer Help
swarp.c - swarp - simple pointer warp for X
git clone git://git.suckless.org/swarp
Log
Files
Refs
README
LICENSE
---
swarp.c (896B)
---
1 /* (C)opyright MMIV-MMV Anselm R. Garbe <garbeam at gmail dot com>
2 * See LICENSE file for license details.
3 */
4
5 #include <stdlib.h>
6 #include <stdio.h>
7 #include <string.h>
8 #include <errno.h>
9 #include <X11/Xlib.h>
10
11 int
12 main(int argc, char **argv) {
13 int x, y;
14 Display *dpy;
15
16 if((argc == 2) && !strncmp(argv[1], "-v", 3)) {
17 fputs("swarp-"VERSION", (C)opyright MMVI Anselm R. Garbe…
18 exit(EXIT_SUCCESS);
19 }
20 if(argc != 3)
21 goto Usage;
22 if(!(dpy = XOpenDisplay(0))) {
23 fputs("swarp: cannot open display\n", stderr);
24 exit(EXIT_FAILURE);
25 }
26 if((sscanf(argv[1], "%d", &x) != 1) || (sscanf(argv[2], "%d", &y…
27 Usage:
28 fputs("usage: swarp <x> <y> [-v]\n", stderr);
29 exit(EXIT_FAILURE);
30 }
31 XWarpPointer(dpy, None, RootWindow(dpy, DefaultScreen(dpy)), 0, …
32 XSetInputFocus(dpy, PointerRoot, RevertToPointerRoot, CurrentTim…
33 XCloseDisplay(dpy);
34 return 0;
35 }
You are viewing proxied material from suckless.org. The copyright of proxied material belongs to its original authors. Any comments or complaints in relation to proxied material should be directed to the original authors of the content concerned. Please see the disclaimer for more details.