[fix] make Xfce optional with separate Linux deb packages, refs #106

This commit is contained in:
dijunkun
2026-10-08 14:43:58 +08:00
parent ec6fe8ea98
commit 9550731681
17 changed files with 256 additions and 64 deletions
@@ -524,7 +524,10 @@ int RunHeadless(const Options& options, const std::function<int()>& run) {
const std::string xvfb = FindExecutable("Xvfb");
if (xvfb.empty()) {
Diagnostic() << "No usable display. Headless mode requires Xvfb; on Debian/Ubuntu "
"install it with: sudo apt install xvfb\n";
"install it with: sudo apt install xvfb\n"
"For a complete independent desktop, install the "
"crossdesk-virtual-desktop-xfce .deb and use "
"--headless-session startxfce4.\n";
return 1;
}
std::string session;
@@ -532,9 +535,15 @@ int RunHeadless(const Options& options, const std::function<int()>& run) {
if (!options.session.empty() && options.session != "none") {
session = FindExecutable(options.session);
dbus = FindExecutable("dbus-run-session");
if (session.empty() || dbus.empty()) {
Diagnostic() << "Headless desktop requires an executable --headless-session "
"and dbus-run-session (Debian/Ubuntu: dbus-daemon)\n";
if (session.empty()) {
Diagnostic() << "Desktop session executable not found: " << options.session
<< ". Install that desktop environment first; for Xfce use the "
"crossdesk-virtual-desktop-xfce .deb.\n";
return 1;
}
if (dbus.empty()) {
Diagnostic() << "Headless desktop requires dbus-run-session. Install "
"dbus-daemon (or dbus on older Debian/Ubuntu releases).\n";
return 1;
}
}