1 /* briefly flashes a fullscreen white window to simulate a visual bell */
2 #define _DEFAULT_SOURCE
7 int main (int argc
, char** argv
) {
10 XWindowAttributes xwa
;
11 XSetWindowAttributes xswa
;
12 unsigned long bgcolor
= 0xffffff;
14 /* parse command line arguments for 3bit colors */
15 if (argc
> 1) switch(argv
[1][0]) {
16 case 'r': bgcolor
= 0xff0000; break;
17 case 'g': bgcolor
= 0x00ff00; break;
18 case 'b': bgcolor
= 0x0000ff; break;
19 case 'c': bgcolor
= 0x00ffff; break;
20 case 'm': bgcolor
= 0xff00ff; break;
21 case 'y': bgcolor
= 0xffff00; break;
22 case 'k': bgcolor
= 0x000000; break;
23 case 'w': bgcolor
= 0xffffff; break;
26 display
= XOpenDisplay(NULL
);
28 /* indirectly aquire display resolution through root window's size*/
29 XGetWindowAttributes(display
, XDefaultRootWindow(display
), &xwa
);
31 window
= XCreateSimpleWindow (display
, XDefaultRootWindow(display
),
32 0, 0, /* position left/top */
33 xwa
.width
, xwa
.height
,
34 0, 0, /* border settings */
37 /*shut out window manager (makes window full screen over all monitors)*/
38 xswa
.override_redirect
= 1;
39 XChangeWindowAttributes (display
, window
, CWOverrideRedirect
, &xswa
);
41 XMapWindow(display
,window
);