1
0
mirror of https://gitlab.com/kelteseth/ScreenPlay.git synced 2024-09-18 08:22:33 +02:00

Add basic kde setup

This commit is contained in:
Elias Steurer 2021-12-02 16:15:21 +01:00
parent 20fa5de37d
commit f781b31173
2 changed files with 42 additions and 0 deletions

View File

@ -1,6 +1,7 @@
#include "app.h"
#include "steam/steam_qt_enums_generated.h"
#include <QProcessEnvironment>
namespace ScreenPlay {
/*!
@ -235,4 +236,42 @@ void App::exit()
QApplication::instance()->quit();
}
/*!
\brief
*/
bool App::setupKDE()
{
QProcessEnvironment env;
qInfo() << qgetenv("KDE_FULL_SESSION");
qInfo() << qgetenv("DESKTOP_SESSION");
qInfo() << qgetenv("XDG_CURRENT_DESKTOP");
QProcess plasmaShellVersionProcess;
plasmaShellVersionProcess.start("plasmashell",{"--version"});
plasmaShellVersionProcess.waitForFinished();
QString versionOut = plasmaShellVersionProcess.readAll();
if(!versionOut.contains("plasmashell ")){
qWarning() << "Unable to read plasma shell version";
return false;
}
const QString basePath = QDir(QDir::homePath() + "/.local/share/plasma/wallpapers/ScreenPlay/").canonicalPath();
const QFileInfo wallpaperMetadata(basePath + "/metadata.desktop");
if (wallpaperMetadata.exists()) {
const QString appPath = QGuiApplication::instance()->applicationDirPath() + "/kde";
process.setWorkingDirectory(appPath);
process.start("plasmapkg2", { "--upgrade", "ScreenPlay" });
process.waitForFinished();
process.terminate();
qInfo() << process.readAllStandardError() << process.readAllStandardOutput();
process.start("kquitapp5", { "plasmashell" });
process.waitForFinished();
process.terminate();
qInfo() << process.readAllStandardError() << process.readAllStandardOutput();
process.startDetached("kstart5", { "plasmashell" });
qInfo() << process.readAllStandardError() << process.readAllStandardOutput();
}
return true;
}
}

View File

@ -215,6 +215,8 @@ public slots:
m_wizards.reset(wizards);
emit wizardsChanged(m_wizards.get());
}
private:
bool setupKDE();
private:
QPluginLoader m_workshopPlugin;
@ -234,5 +236,6 @@ private:
std::shared_ptr<MonitorListModel> m_monitorListModel;
std::shared_ptr<ProfileListModel> m_profileListModel;
std::shared_ptr<InstalledListFilter> m_installedListFilter;
QProcess process;
};
}