diff --git a/shell/main.cpp b/shell/main.cpp --- a/shell/main.cpp +++ b/shell/main.cpp @@ -88,6 +88,11 @@ app.setQuitOnLastWindowClosed(false); + QString defaultShell = qgetenv("KDE_PLASMA_DEFAULT_SHELLPACKAGE"); + if (defaultShell.isEmpty()) { + defaultShell = QStringLiteral("org.kde.plasma.desktop"); + } + { QCommandLineParser cliOptions; @@ -101,7 +106,7 @@ QCommandLineOption shellPluginOption(QStringList() << QStringLiteral("p") << QStringLiteral("shell-plugin"), i18n("Force loading the given shell plugin"), - QStringLiteral("plugin"), QStringLiteral("org.kde.plasma.desktop")); + QStringLiteral("plugin"), defaultShell); QCommandLineOption standaloneOption(QStringList() << QStringLiteral("a") << QStringLiteral("standalone"), i18n("Load plasmashell as a standalone application, needs the shell-plugin option to be specified")); diff --git a/startkde/startplasma-wayland.cpp b/startkde/startplasma-wayland.cpp --- a/startkde/startplasma-wayland.cpp +++ b/startkde/startplasma-wayland.cpp @@ -23,7 +23,7 @@ #include #include -int main(int /*argc*/, char** /*argv*/) +int main(int argc, char** argv) { createConfigDirectory(); setupCursor(true); @@ -74,7 +74,13 @@ out << "startplasmacompositor: Could not start D-Bus. Can you call qdbus?\n"; return 1; } - setupPlasmaEnvironment(); + + QString plasmaShell = QStringLiteral("org.kde.plasma.desktop"); + if (argc > 1) { + plasmaShell = QString::fromLatin1(argv[1]); + } + setupPlasmaEnvironment(plasmaShell); + qputenv("XDG_SESSION_TYPE", "wayland"); if (!syncDBusEnvironment()) { diff --git a/startkde/startplasma-x11.cpp b/startkde/startplasma-x11.cpp --- a/startkde/startplasma-x11.cpp +++ b/startkde/startplasma-x11.cpp @@ -29,7 +29,7 @@ out << "GOT SIGHUP\n"; } -int main(int /*argc*/, char** /*argv*/) +int main(int argc, char** argv) { // When the X server dies we get a HUP signal from xinit. We must ignore it // because we still need to do some cleanup. @@ -90,7 +90,12 @@ out << "startkde: Starting up...\n"; - setupPlasmaEnvironment(); + QString plasmaShell = QStringLiteral("org.kde.plasma.desktop"); + if (argc > 1) { + plasmaShell = QString::fromLatin1(argv[1]); + } + + setupPlasmaEnvironment(plasmaShell); setupX11(); if (!syncDBusEnvironment()) { diff --git a/startkde/startplasma.h b/startkde/startplasma.h --- a/startkde/startplasma.h +++ b/startkde/startplasma.h @@ -35,7 +35,7 @@ void runStartupConfig(); void setupCursor(bool wayland); void runEnvironmentScripts(); -void setupPlasmaEnvironment(); +void setupPlasmaEnvironment(const QString &plasmaShell); void cleanupPlasmaEnvironment(); void cleanupX11(); bool syncDBusEnvironment(); diff --git a/startkde/startplasma.cpp b/startkde/startplasma.cpp --- a/startkde/startplasma.cpp +++ b/startkde/startplasma.cpp @@ -216,7 +216,7 @@ // Since KDE4 there is also KDE_SESSION_VERSION, containing the major version number. // -void setupPlasmaEnvironment() +void setupPlasmaEnvironment(const QString &plasmaShell) { //Manually disable auto scaling because we are scaling above //otherwise apps that manually opt in for high DPI get auto scaled by the developer AND manually scaled by us @@ -226,6 +226,7 @@ qputenv("KDE_SESSION_VERSION", "5"); qputenv("KDE_SESSION_UID", QByteArray::number(getuid())); qputenv("XDG_CURRENT_DESKTOP", "KDE"); + qputenv("KDE_PLASMA_DEFAULT_SHELLPACKAGE", plasmaShell.toLatin1()); } void setupX11() @@ -255,6 +256,7 @@ qunsetenv("KDE_FULL_SESSION"); qunsetenv("KDE_SESSION_VERSION"); qunsetenv("KDE_SESSION_UID"); + qunsetenv("KDE_PLASMA_DEFAULT_SHELLPACKAGE"); } // kwin_wayland can possibly also start dbus-activated services which need env variables.