Anyone used Xlib much? I just want to ring the speaker/bell/beeeeep with it.
Code:
#include <stdio.h>
#include <X11/Xlib.h>
int main(void) {
Display *display = NULL;
perror("Now");
if ((display = XOpenDisplay(":0.0")) == NULL) {
perror("Can't connect to server");
}
printf("%p\n",display);
perror("Now");
XBell(display,100);
perror("Now");
return 0;
}
Complile -lX11.
What's weird to my mind here is this output:
Now: Success
0xf3a010
Now: Resource temporarily unavailable
Now: Resource temporarily unavailable
Apparently errno is getting set before the XBell call, but XOpenDisplay returned a valid pointer...