diff --git a/kconf_update/CMakeLists.txt b/kconf_update/CMakeLists.txt index 93018f6efa..00e06f3108 100644 --- a/kconf_update/CMakeLists.txt +++ b/kconf_update/CMakeLists.txt @@ -1,6 +1,11 @@ # SPDX-FileCopyrightText: 2023 Niccolò Venerandi # SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL +add_executable(kwin-6.0-delete-desktop-switching-shortcuts) +target_sources(kwin-6.0-delete-desktop-switching-shortcuts PRIVATE kwin-6.0-delete-desktop-switching-shortcuts.cpp) +target_link_libraries(kwin-6.0-delete-desktop-switching-shortcuts PRIVATE KF6::GlobalAccel) +install(TARGETS kwin-6.0-delete-desktop-switching-shortcuts DESTINATION ${KDE_INSTALL_LIBDIR}/kconf_update_bin/) + install(FILES kwin.upd DESTINATION ${KDE_INSTALL_KCONFUPDATEDIR}) install(PROGRAMS kwin-6.0-overview-activities-shortcuts.py diff --git a/kconf_update/kwin-6.0-delete-desktop-switching-shortcuts.cpp b/kconf_update/kwin-6.0-delete-desktop-switching-shortcuts.cpp new file mode 100644 index 0000000000..5aba1bab76 --- /dev/null +++ b/kconf_update/kwin-6.0-delete-desktop-switching-shortcuts.cpp @@ -0,0 +1,33 @@ +/* + SPDX-FileCopyrightText: 2023 Marco Martin + + SPDX-License-Identifier: GPL-2.0-or-later +*/ + +#include + +#include +#include +#include + +int main(int argc, char **argv) +{ + QGuiApplication app(argc, argv); + + const QStringList actionNames{ + QStringLiteral("Walk Through Desktops"), + QStringLiteral("Walk Through Desktops (Reverse)"), + QStringLiteral("Walk Through Desktop List"), + QStringLiteral("Walk Through Desktop List (Reverse)"), + }; + + for (const QString &actionName : actionNames) { + QAction action; + action.setObjectName(actionName); + action.setProperty("componentName", QStringLiteral("kwin")); + KGlobalAccel::self()->setShortcut(&action, {QKeySequence()}, KGlobalAccel::NoAutoloading); + KGlobalAccel::self()->removeAllShortcuts(&action); + } + + return 0; +} diff --git a/kconf_update/kwin.upd b/kconf_update/kwin.upd index 4eff165d2c..0b295de745 100644 --- a/kconf_update/kwin.upd +++ b/kconf_update/kwin.upd @@ -3,6 +3,10 @@ Version=6 +# Delete old desktop switching shortcuts. +Id=kwin-6.0-delete-desktop-switching-shortcuts +Script=kwin-6.0-delete-desktop-switching-shortcuts + # Changes the default Activities shortcut from Meta+Tab to Meta+A, # so that the Overview can take its place Id=change-activities-overview-shortcuts