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