detecting where I am



How can I detect if am on a console?

Currently I do that:

#include <X11/Xlib.h>
....

int main (int argc, char *argv[])
{
  Display *dis;

     if( (dis = XOpenDisplay(NULL)) == NULL )
       {
          /* print help screen and some other stuff */
	  
	  return 0;
       }
     else
      {
      	XCloseDisplay( dis );

	gnome_init( APPLICATION, VERSION, argc, argv );

        /*  gnome stuff   */

        return 0;	
      }
}

That code works very well.

My question now: Is there a better way?

-- 
The linux is with me.



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]