Move effect config KCM to a standalone Plasma app, to support desktop files and pinning to the task bar

This commit is contained in:
wheaney 2025-09-13 21:11:58 -07:00
parent db1faf706b
commit 703961a338
8 changed files with 49 additions and 6 deletions

1
.gitignore vendored
View File

@ -9,3 +9,4 @@ kwin/VERSION
kwin/build-test/ kwin/build-test/
kwin/src/qml/calibrating.png kwin/src/qml/calibrating.png
kwin/src/qml/custom_banner.png kwin/src/qml/custom_banner.png
kwin/src/kcm/com.xronlinux.BreezyDesktop.svg

View File

@ -76,6 +76,7 @@ fi
cp ui/modules/PyXRLinuxDriverIPC/xrdriveripc.py $KWIN_DIR/src/xrdriveripc/xrdriveripc.py cp ui/modules/PyXRLinuxDriverIPC/xrdriveripc.py $KWIN_DIR/src/xrdriveripc/xrdriveripc.py
cp VERSION $KWIN_DIR cp VERSION $KWIN_DIR
cp modules/sombrero/*.png $KWIN_DIR/src/qml cp modules/sombrero/*.png $KWIN_DIR/src/qml
cp ui/data/icons/hicolor/scalable/apps/com.xronlinux.BreezyDesktop.svg $KWIN_DIR/src/kcm/
pushd $KWIN_DIR > /dev/null pushd $KWIN_DIR > /dev/null
if [ -z "${LOCAL_BUILD_SYSTEM+x}" ]; then if [ -z "${LOCAL_BUILD_SYSTEM+x}" ]; then

View File

@ -41,8 +41,10 @@ fi
EFFECT_ID="breezy_desktop" EFFECT_ID="breezy_desktop"
EFFECT_DIR="$XDG_DATA_HOME/kwin/effects/$EFFECT_ID" EFFECT_DIR="$XDG_DATA_HOME/kwin/effects/$EFFECT_ID"
ICON_PATH="$XDG_DATA_HOME/icons/hicolor/scalable/apps/com.xronlinux.BreezyDesktop.svg"
DESKTOP_FILE_PATH="$XDG_DATA_HOME/applications/breezy_desktop.desktop"
PLUGIN_SO="$LIB_HOME/qt6/plugins/kwin/effects/plugins/${EFFECT_ID}.so" PLUGIN_SO="$LIB_HOME/qt6/plugins/kwin/effects/plugins/${EFFECT_ID}.so"
CONFIG_SO="$LIB_HOME/qt6/plugins/kwin/effects/configs/${EFFECT_ID}_config.so" CONFIG_SO="$LIB_HOME/qt6/plugins/plasma/kcms/${EFFECT_ID}_config.so"
BREEZY_LIBRARY_DIR="$LIB_HOME/breezy_kwin" BREEZY_LIBRARY_DIR="$LIB_HOME/breezy_kwin"
if [[ -d "$EFFECT_DIR" ]]; then if [[ -d "$EFFECT_DIR" ]]; then
@ -50,6 +52,16 @@ if [[ -d "$EFFECT_DIR" ]]; then
$SUDO rm -rf "$EFFECT_DIR" $SUDO rm -rf "$EFFECT_DIR"
fi fi
if [[ -f "$ICON_PATH" ]]; then
[ "$for_install" -eq 0 ] && echo "Removing $ICON_PATH"
$SUDO rm -f "$ICON_PATH"
fi
if [[ -f "$DESKTOP_FILE_PATH" ]]; then
[ "$for_install" -eq 0 ] && echo "Removing $DESKTOP_FILE_PATH"
$SUDO rm -f "$DESKTOP_FILE_PATH"
fi
if [[ -f "$PLUGIN_SO" ]]; then if [[ -f "$PLUGIN_SO" ]]; then
[ "$for_install" -eq 0 ] && echo "Removing $PLUGIN_SO" [ "$for_install" -eq 0 ] && echo "Removing $PLUGIN_SO"
$SUDO rm -f "$PLUGIN_SO" $SUDO rm -f "$PLUGIN_SO"

View File

@ -2,7 +2,7 @@ set(breezy_desktop_config_SOURCES breezydesktopeffectkcm.cpp labeledslider.cpp)
ki18n_wrap_ui(breezy_desktop_config_SOURCES breezydesktopeffectkcm.ui) ki18n_wrap_ui(breezy_desktop_config_SOURCES breezydesktopeffectkcm.ui)
qt_add_dbus_interface(breezy_desktop_config_SOURCES ${KWIN_EFFECTS_INTERFACE} kwineffects_interface) qt_add_dbus_interface(breezy_desktop_config_SOURCES ${KWIN_EFFECTS_INTERFACE} kwineffects_interface)
kcoreaddons_add_plugin(breezy_desktop_config INSTALL_NAMESPACE "kwin/effects/configs" SOURCES ${breezy_desktop_config_SOURCES}) kcoreaddons_add_plugin(breezy_desktop_config INSTALL_NAMESPACE "plasma/kcms" SOURCES ${breezy_desktop_config_SOURCES})
kconfig_add_kcfg_files(breezy_desktop_config ../breezydesktopconfig.kcfgc) kconfig_add_kcfg_files(breezy_desktop_config ../breezydesktopconfig.kcfgc)
target_link_libraries(breezy_desktop_config target_link_libraries(breezy_desktop_config
Qt6::DBus Qt6::DBus
@ -22,3 +22,14 @@ target_link_libraries(breezy_desktop_config
if(BREEZY_DESKTOP_VERSION) if(BREEZY_DESKTOP_VERSION)
target_compile_definitions(breezy_desktop_config PRIVATE BREEZY_DESKTOP_VERSION_STR=\"${BREEZY_DESKTOP_VERSION}\") target_compile_definitions(breezy_desktop_config PRIVATE BREEZY_DESKTOP_VERSION_STR=\"${BREEZY_DESKTOP_VERSION}\")
endif() endif()
set(KCMSHELL "kcmshell6")
configure_file(
${CMAKE_CURRENT_SOURCE_DIR}/breezy_desktop.desktop.in
${CMAKE_CURRENT_BINARY_DIR}/breezy_desktop.desktop
@ONLY
)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/breezy_desktop.desktop
DESTINATION ${KDE_INSTALL_APPDIR})
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/com.xronlinux.BreezyDesktop.svg
DESTINATION ${KDE_INSTALL_ICONDIR}/hicolor/scalable/apps)

View File

@ -0,0 +1,11 @@
[Desktop Entry]
Type=Application
Name=Breezy Desktop
GenericName=KWin Effect Settings
Comment=Configure Breezy Desktop
Exec=@KCMSHELL@ breezy_desktop_config
Icon=com.xronlinux.BreezyDesktop
Categories=Utility;Qt;KDE;
Keywords=Breezy;XR;Desktop;Effect;
Terminal=false
X-KDE-AuthorizeAction=org.kde.kcontrol.kcmkwinrules.save

View File

@ -48,7 +48,7 @@ void addShortcutAction(KActionCollection *collection, const BreezyShortcuts::Sho
KGlobalAccel::self()->setShortcut(action, {shortcut.shortcut}); KGlobalAccel::self()->setShortcut(action, {shortcut.shortcut});
} }
K_PLUGIN_CLASS(BreezyDesktopEffectConfig) K_PLUGIN_CLASS_WITH_JSON(BreezyDesktopEffectConfig, "kcm_metadata.json")
BreezyDesktopEffectConfig::BreezyDesktopEffectConfig(QObject *parent, const KPluginMetaData &data) BreezyDesktopEffectConfig::BreezyDesktopEffectConfig(QObject *parent, const KPluginMetaData &data)
: KCModule(parent, data) : KCModule(parent, data)

View File

@ -0,0 +1,8 @@
{
"KPlugin": {
"Name": "Breezy Desktop",
"Description": "Configure Breezy Desktop",
"Category": "Tools",
"License": "GPL"
}
}

View File

@ -11,7 +11,6 @@
"Description": "Breezy Desktop XR Effect", "Description": "Breezy Desktop XR Effect",
"EnabledByDefault": true, "EnabledByDefault": true,
"License": "GPL", "License": "GPL",
"Name": "Breezy Desktop XR" "Name": "Breezy Desktop"
}, }
"X-KDE-ConfigModule": "breezy_desktop_config"
} }