diff --git a/kcmkwin/kwinscreenedges/main.cpp b/kcmkwin/kwinscreenedges/main.cpp index ce7b571614..e0f7639d8f 100644 --- a/kcmkwin/kwinscreenedges/main.cpp +++ b/kcmkwin/kwinscreenedges/main.cpp @@ -187,6 +187,8 @@ void KWinScreenEdgesConfig::monitorInit() monitorAddItem(i18n("No Action")); monitorAddItem(i18n("Show Desktop")); monitorAddItem(i18n("Lock Screen")); + monitorAddItem(i18nc("Open krunner", "Run Command")); + monitorAddItem(i18n("Activity Manager")); // Add the effects const QString presentWindowsName = BuiltInEffects::effectData(BuiltInEffect::PresentWindows).displayName; @@ -211,6 +213,8 @@ void KWinScreenEdgesConfig::monitorLoadAction(ElectricBorder edge, const QString QString lowerName = config.readEntry(configName, "None").toLower(); if (lowerName == "showdesktop") monitorChangeEdge(edge, int(ElectricActionShowDesktop)); else if (lowerName == "lockscreen") monitorChangeEdge(edge, int(ElectricActionLockScreen)); + else if (lowerName == "krunner") monitorChangeEdge(edge, int(ElectricActionKRunner)); + else if (lowerName == "activitymanager") monitorChangeEdge(edge, int(ElectricActionActivityManager)); } void KWinScreenEdgesConfig::monitorLoad() @@ -307,6 +311,10 @@ void KWinScreenEdgesConfig::monitorSaveAction(int edge, const QString& configNam config.writeEntry(configName, "ShowDesktop"); else if (item == 2) config.writeEntry(configName, "LockScreen"); + else if (item == 3) + config.writeEntry(configName, "KRunner"); + else if (item == 4) + config.writeEntry(configName, "ActivityManager"); else // Anything else config.writeEntry(configName, "None"); } diff --git a/libkwineffects/kwinglobals.h b/libkwineffects/kwinglobals.h index 3d833b760d..18b78f44e7 100644 --- a/libkwineffects/kwinglobals.h +++ b/libkwineffects/kwinglobals.h @@ -93,6 +93,8 @@ enum ElectricBorderAction { ElectricActionNone, // No special action, not set, desktop switch or an effect ElectricActionShowDesktop, // Show desktop or restore ElectricActionLockScreen, // Lock screen + ElectricActionKRunner, // Open KRunner + ElectricActionActivityManager, // Activity Manager ELECTRIC_ACTION_COUNT }; diff --git a/screenedge.cpp b/screenedge.cpp index 8a4a71c92c..52e5ec73c5 100644 --- a/screenedge.cpp +++ b/screenedge.cpp @@ -242,6 +242,26 @@ bool Edge::handleAction() } return true; } + case ElectricActionKRunner: { // open krunner + QDBusConnection::sessionBus().asyncCall( + QDBusMessage::createMethodCall(QStringLiteral("org.kde.krunner"), + QStringLiteral("/App"), + QStringLiteral("org.kde.krunner.App"), + QStringLiteral("display") + ) + ); + return true; + } + case ElectricActionActivityManager: { // open activity manager + QDBusConnection::sessionBus().asyncCall( + QDBusMessage::createMethodCall(QStringLiteral("org.kde.plasmashell"), + QStringLiteral("/PlasmaShell"), + QStringLiteral("org.kde.PlasmaShell"), + QStringLiteral("toggleActivityManager") + ) + ); + return true; + } default: return false; } @@ -552,6 +572,10 @@ static ElectricBorderAction electricBorderAction(const QString& name) return ElectricActionShowDesktop; } else if (lowerName == QStringLiteral("lockscreen")) { return ElectricActionLockScreen; + } else if (lowerName == QLatin1String("krunner")) { + return ElectricActionKRunner; + } else if (lowerName == QLatin1String("activitymanager")) { + return ElectricActionActivityManager; } return ElectricActionNone; }