title: Check if at least one Wayland session is running
body: <p>I'm using Qt and want to check if any Wayland session is running.</p>
  
  <p>For now I have this just for test code, that works as expected:</p>
  
  <pre class="lang-cpp prettyprint-override"><code>QProcess process;
  process.setProgram("bash");
  process.setArguments({"-c", "loginctl list-sessions --no-legend | awk '{print $1}'"});
  process.start();
  process.waitForFinished();
  const QByteArrayList sessionsList = process.readAll().split('\n');
  
  foreach (const QByteArray &amp;sessionID, sessionsList) {
      if (sessionID.isEmpty())
          continue;
      process.setArguments({"-c", "loginctl show-session " + sessionID});
      process.start();
      process.waitForFinished();
      if (process.readAll().contains("Type=wayland"))
          qDebug() &lt;&lt; "At least one Wayland session is running";
  }
  </code></pre>
  
  <p>Is it possible to get rid of QProcess and use Linux C++ API?</p>