title: How to detect if xlib application running from xinit?
body: <p>I write an <em>xlib</em> C application. I need different behavior of it, depending if it running with <code>xinit ./myapp</code> from CLI when no X server started, from running in normal KDE desktop.</p>
  
  <p><em>argv[0]</em> returns same value in both cases (i.e. not sees <code>xinit</code> prefix). </p>
  
  <p>How i can determine when <code>xinit</code> was used for starting my app?</p>