00001
00002
00003
00004
00005
00006
00007 #include "../lux/win.h"
00008 #include <stdlib.h>
00009
00010 main()
00011 {
00012 Display *display;
00013 char *display_name = NULL;
00014 char *disp;
00015
00016 disp = getenv("DISPLAY");
00017
00018 if (disp == '\0') {
00019 printf("DISPLAY variable not set.\n");
00020 exit(1);
00021 } else
00022 printf("Checking permission to open X-display %s...", disp);
00023
00024 if ( (display = XOpenDisplay(display_name)) == NULL ){
00025 printf("denied.\n");
00026 exit(1);
00027 } else {
00028 printf("OK.\n");
00029 exit(0);
00030 }
00031 }