depot/third_party/nixpkgs/pkgs/desktops/plasma-5/plasma-workspace/0001-startkde.patch
Default email 58f8944c92 Project import generated by Copybara.
GitOrigin-RevId: 5aba0fe9766a7201a336249fd6cb76e0d7ba2faf
2020-09-24 23:45:31 -05:00

114 lines
6.3 KiB
Diff

From 6477e377fcca39c07ef5f91a55084d7d74715d00 Mon Sep 17 00:00:00 2001
From: Thomas Tuegel <ttuegel@mailbox.org>
Date: Tue, 28 Jan 2020 05:00:53 -0600
Subject: [PATCH 1/2] startkde
---
startkde/startplasma-waylandsession.cpp | 2 +-
startkde/startplasma-x11.cpp | 2 +-
startkde/startplasma.cpp | 24 ++++++++++--------------
3 files changed, 12 insertions(+), 16 deletions(-)
diff --git a/startkde/startplasma-waylandsession.cpp b/startkde/startplasma-waylandsession.cpp
index 87c71c6b3..5fc53140e 100644
--- a/startkde/startplasma-waylandsession.cpp
+++ b/startkde/startplasma-waylandsession.cpp
@@ -67,7 +67,7 @@ int main(int /*argc*/, char** /*argv*/)
waitForKonqi();
out << "startplasma-waylandsession: Shutting down...\n";
- runSync(QStringLiteral("kdeinit5_shutdown"), {});
+ runSync(QStringLiteral(NIXPKGS_KDEINIT5_SHUTDOWN), {});
cleanupX11();
out << "startplasma-waylandsession: Done.\n";
diff --git a/startkde/startplasma-x11.cpp b/startkde/startplasma-x11.cpp
index 3314b6283..14cbe29fa 100644
--- a/startkde/startplasma-x11.cpp
+++ b/startkde/startplasma-x11.cpp
@@ -111,7 +111,7 @@ int main(int /*argc*/, char** /*argv*/)
out << "startkde: Shutting down...\n";
- runSync(QStringLiteral("kdeinit5_shutdown"), {});
+ runSync(QStringLiteral(NIXPKGS_KDEINIT5_SHUTDOWN), {});
cleanupPlasmaEnvironment();
cleanupX11();
diff --git a/startkde/startplasma.cpp b/startkde/startplasma.cpp
index 4c9f5cef6..5ea4c2cf1 100644
--- a/startkde/startplasma.cpp
+++ b/startkde/startplasma.cpp
@@ -34,7 +34,7 @@ QTextStream out(stderr);
void messageBox(const QString &text)
{
out << text;
- runSync(QStringLiteral("xmessage"), {QStringLiteral("-geometry"), QStringLiteral("500x100"), text});
+ runSync(QStringLiteral(NIXPKGS_XMESSAGE), {QStringLiteral("-geometry"), QStringLiteral("500x100"), text});
}
QStringList allServices(const QLatin1String& prefix)
@@ -242,15 +242,15 @@ void setupX11()
// If the user has overwritten fonts, the cursor font may be different now
// so don't move this up.
- runSync(QStringLiteral("xsetroot"), {QStringLiteral("-cursor_name"), QStringLiteral("left_ptr")});
- runSync(QStringLiteral("xprop"), {QStringLiteral("-root"), QStringLiteral("-f"), QStringLiteral("KDE_FULL_SESSION"), QStringLiteral("8t"), QStringLiteral("-set"), QStringLiteral("KDE_FULL_SESSION"), QStringLiteral("true")});
- runSync(QStringLiteral("xprop"), {QStringLiteral("-root"), QStringLiteral("-f"), QStringLiteral("KDE_SESSION_VERSION"), QStringLiteral("32c"), QStringLiteral("-set"), QStringLiteral("KDE_SESSION_VERSION"), QStringLiteral("5")});
+ runSync(QStringLiteral(NIXPKGS_XSETROOT), {QStringLiteral("-cursor_name"), QStringLiteral("left_ptr")});
+ runSync(QStringLiteral(NIXPKGS_XPROP), {QStringLiteral("-root"), QStringLiteral("-f"), QStringLiteral("KDE_FULL_SESSION"), QStringLiteral("8t"), QStringLiteral("-set"), QStringLiteral("KDE_FULL_SESSION"), QStringLiteral("true")});
+ runSync(QStringLiteral(NIXPKGS_XPROP), {QStringLiteral("-root"), QStringLiteral("-f"), QStringLiteral("KDE_SESSION_VERSION"), QStringLiteral("32c"), QStringLiteral("-set"), QStringLiteral("KDE_SESSION_VERSION"), QStringLiteral("5")});
}
void cleanupX11()
{
- runSync(QStringLiteral("xprop"), { QStringLiteral("-root"), QStringLiteral("-remove"), QStringLiteral("KDE_FULL_SESSION") });
- runSync(QStringLiteral("xprop"), { QStringLiteral("-root"), QStringLiteral("-remove"), QStringLiteral("KDE_SESSION_VERSION") });
+ runSync(QStringLiteral(NIXPKGS_XPROP), { QStringLiteral("-root"), QStringLiteral("-remove"), QStringLiteral("KDE_FULL_SESSION") });
+ runSync(QStringLiteral(NIXPKGS_XPROP), { QStringLiteral("-root"), QStringLiteral("-remove"), QStringLiteral("KDE_SESSION_VERSION") });
}
// TODO: Check if Necessary
@@ -267,11 +267,7 @@ bool syncDBusEnvironment()
{
int exitCode;
// At this point all environment variables are set, let's send it to the DBus session server to update the activation environment
- if (!QStandardPaths::findExecutable(QStringLiteral("dbus-update-activation-environment")).isEmpty()) {
- exitCode = runSync(QStringLiteral("dbus-update-activation-environment"), { QStringLiteral("--systemd"), QStringLiteral("--all") });
- } else {
- exitCode = runSync(QStringLiteral(CMAKE_INSTALL_FULL_LIBEXECDIR "/ksyncdbusenv"), {});
- }
+ exitCode = runSync(QStringLiteral(NIXPKGS_DBUS_UPDATE_ACTIVATION_ENVIRONMENT), { QStringLiteral("--systemd"), QStringLiteral("--all") });
return exitCode == 0;
}
@@ -287,7 +283,7 @@ void setupFontDpi()
//TODO port to c++?
const QByteArray input = "Xft.dpi: " + QByteArray::number(fontsCfg.readEntry("forceFontDPI", 0));
QProcess p;
- p.start(QStringLiteral("xrdb"), { QStringLiteral("-quiet"), QStringLiteral("-merge"), QStringLiteral("-nocpp") });
+ p.start(QStringLiteral(NIXPKGS_XRDB), { QStringLiteral("-quiet"), QStringLiteral("-merge"), QStringLiteral("-nocpp") });
p.setProcessChannelMode(QProcess::ForwardedChannels);
p.write(input);
p.closeWriteChannel();
@@ -309,7 +305,7 @@ QProcess* setupKSplash()
KConfigGroup ksplashCfg = cfg.group("KSplash");
if (ksplashCfg.readEntry("Engine", QStringLiteral("KSplashQML")) == QLatin1String("KSplashQML")) {
p = new QProcess;
- p->start(QStringLiteral("ksplashqml"), { ksplashCfg.readEntry("Theme", QStringLiteral("Breeze")) });
+ p->start(QStringLiteral(CMAKE_INSTALL_FULL_BINDIR "/ksplashqml"), { ksplashCfg.readEntry("Theme", QStringLiteral("Breeze")) });
}
}
return p;
@@ -331,7 +327,7 @@ bool startKDEInit()
{
// We set LD_BIND_NOW to increase the efficiency of kdeinit.
// kdeinit unsets this variable before loading applications.
- const int exitCode = runSync(QStringLiteral(CMAKE_INSTALL_FULL_LIBEXECDIR_KF5 "/start_kdeinit_wrapper"), { QStringLiteral("--kded"), QStringLiteral("+kcminit_startup") }, { QStringLiteral("LD_BIND_NOW=true") });
+ const int exitCode = runSync(QStringLiteral(NIXPKGS_START_KDEINIT_WRAPPER), { QStringLiteral("--kded"), QStringLiteral("+kcminit_startup") }, { QStringLiteral("LD_BIND_NOW=true") });
if (exitCode != 0) {
messageBox(QStringLiteral("startkde: Could not start kdeinit5. Check your installation."));
return false;
--
2.25.1