shift-shell/components/mobileshellstate/CMakeLists.txt
Devin Lin 839d5e2bff panels: Add support for defining device specific panel tweaks
This adds support for specifying options needed to deal with phone
display panel pecularities (ex. screen curves, notches, punch holes)

This is implemented as settings in ~/.config/plasmamobilerc, which can
set panel heights, paddings, and center spacings to duck display
cutouts. The pixel values are scaling independent, and so are not
affected when the display scaling is changed.

This is then exposed over DBus, so that components from outside of
plasmashell (ex. KWin) can access it easily without needing to connect to
kscreen themselves. Each screen is exposed as a single object.

Currently support is only added in the status bar and the navigation
panel.

Currently all screens have the settings applied. In the future, we may
want to limit this just to the internal screen (?)

---

This also adds a "devices" folder (in `devices/configs`) where per-device configs can be set.

This is installed to `/usr/share/plasma-mobile-device-configs`.
In `plasmamobilerc` (installed to `/etc/xdg/plasmamobilerc`, or
`~/.config/plasmamobilerc`), envmanager will read:

```toml
[Device]
device=oneplus-enchilada
```

for the device config to use and write its settings to
`~/.config/plasma-mobile/plasmamobilerc`.
2025-11-04 23:08:18 -05:00

73 lines
2.4 KiB
CMake

# SPDX-FileCopyrightText: 2022 Devin Lin <devin@kde.org>
# SPDX-License-Identifier: GPL-2.0-or-later
set(mobileshellstateplugin_SRCS
shelldbusobject.cpp
shelldbusclient.cpp
lockscreendbusclient.cpp
startupfeedbackmodel.cpp
windowlistener.cpp
volumeosdlistener.cpp
panelsettingsdbusobjectmanager.cpp
panelsettingsdbusclient.cpp
)
# Add shell dbus API
qt_generate_dbus_interface(
${CMAKE_CURRENT_SOURCE_DIR}/shelldbusobject.h
org.kde.plasmashell.Mobile.xml
OPTIONS -s -m -P
)
qt_add_dbus_adaptor(mobileshellstateplugin_SRCS ${CMAKE_CURRENT_BINARY_DIR}/org.kde.plasmashell.Mobile.xml
${CMAKE_CURRENT_SOURCE_DIR}/shelldbusobject.h ShellDBusObject)
qt_add_dbus_interface(mobileshellstateplugin_SRCS ${CMAKE_CURRENT_BINARY_DIR}/org.kde.plasmashell.Mobile.xml plasmashellmobileinterface)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/org.kde.plasmashell.Mobile.xml DESTINATION ${KDE_INSTALL_DBUSINTERFACEDIR})
# ---
# Add shell panels dbus API
qt_generate_dbus_interface(
${CMAKE_CURRENT_SOURCE_DIR}/panelsettingsdbusobjectmanager.h
org.kde.plasmashell.Mobile.Panels.xml
OPTIONS -s -m -P
)
qt_add_dbus_adaptor(mobileshellstateplugin_SRCS
${CMAKE_CURRENT_BINARY_DIR}/org.kde.plasmashell.Mobile.Panels.xml
${CMAKE_CURRENT_SOURCE_DIR}/panelsettingsdbusobjectmanager.h PanelSettingsDBusObject
)
set_source_files_properties(
${CMAKE_CURRENT_BINARY_DIR}/org.kde.plasmashell.Mobile.Panels.xml
PROPERTIES
CLASSNAME "OrgKdePlasmashellMobilePanelsInterface"
)
qt_add_dbus_interface(
mobileshellstateplugin_SRCS
${CMAKE_CURRENT_BINARY_DIR}/org.kde.plasmashell.Mobile.Panels.xml
plasmashellmobilepanelsinterface
)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/org.kde.plasmashell.Mobile.Panels.xml DESTINATION ${KDE_INSTALL_DBUSINTERFACEDIR})
# ---
ecm_add_qml_module(mobileshellstateplugin URI org.kde.plasma.private.mobileshell.state GENERATE_PLUGIN_SOURCE)
target_sources(mobileshellstateplugin PRIVATE ${mobileshellstateplugin_SRCS} ${RESOURCES})
target_link_libraries(mobileshellstateplugin
PUBLIC
Qt::Core
PRIVATE
Qt::DBus
Qt::Qml
Qt::Gui
Qt::Quick
Qt::DBus
Plasma::Plasma
Plasma::KWaylandClient
KF6::I18n
KF6::Notifications
KF6::Screen
Plasma::PlasmaQuick
)
ecm_finalize_qml_module(mobileshellstateplugin)