kconf_update: Add script to drop old desktop switching shortcuts
BUG: 479984
This commit is contained in:
parent
bbc833baa6
commit
2505fd03f1
3 changed files with 42 additions and 0 deletions
|
@ -1,6 +1,11 @@
|
|||
# SPDX-FileCopyrightText: 2023 Niccolò Venerandi <niccolo.venerandi@kde.org>
|
||||
# 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
|
||||
|
|
33
kconf_update/kwin-6.0-delete-desktop-switching-shortcuts.cpp
Normal file
33
kconf_update/kwin-6.0-delete-desktop-switching-shortcuts.cpp
Normal file
|
@ -0,0 +1,33 @@
|
|||
/*
|
||||
SPDX-FileCopyrightText: 2023 Marco Martin <mart@kde.org>
|
||||
|
||||
SPDX-License-Identifier: GPL-2.0-or-later
|
||||
*/
|
||||
|
||||
#include <KGlobalAccel>
|
||||
|
||||
#include <QAction>
|
||||
#include <QGuiApplication>
|
||||
#include <QStandardPaths>
|
||||
|
||||
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;
|
||||
}
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue