Pages
Developer Documentation
On this page

Execute applications

This page describes the environment variables and steps for running and debugging applications on the mobile interface. Users don't need any of this, because applications start from the application drawer, but it's useful for development.

Setting up the environment

To run an application on the device, set up your environment like the one the shell is running in:

while IFS= read -r -d '' variable; do
    export "$variable"
done < "/proc/$(pidof sonicshell)/environ"

If the shell isn't running, these are the variables the mobile session sets. startplasmamobile sets most of them, and startplasma-x11 sets the rest:

export QT_QPA_PLATFORM='xlibre;xcb'
export QT_QPA_PLATFORMTHEME=KDE
export QT_QUICK_CONTROLS_STYLE=org.kde.breeze
export QT_QUICK_CONTROLS_MOBILE=true
export PLASMA_PLATFORM=phone:handset
export QT_IM_MODULE=sonicvirtualkeyboard
export XDG_CURRENT_DESKTOP=SonicDE:KDE
export KDE_FULL_SESSION=true
export KDE_SESSION_VERSION=6

xlibre;xcb prefers the QXLibre platform plugin and falls back to the xcb one.

Starting the shell manually

The whole session is started by startplasmamobile. To start only the shell, with a new D-Bus session and without restarting automatically if it crashes:

dbus-run-session sonicshell -p org.kde.plasma.mobileshell --no-respawn

It needs an X server and a window manager, and exits if the activity manager, kactivitymanagerd, can't be started. On a running system, add --replace to replace the running shell instead.

Forcing a user interface for one application

To start an application with its desktop user interface, if it has one, rather than the mobile one:

QT_QUICK_CONTROLS_MOBILE=false program-to-run

The inverse also works. To run an application on a desktop system with its mobile interface, set the variable to true. This sets what Kirigami applications see in Kirigami.Settings.isMobile.

Adapted for SonicDE from develop.kde.org/docs/packaging/plasma-mobile/running-apps/ by Carl Schwan, Devin Lin, Mikhail Zolotukhin, Pixie A, Thiago Sueto, licensed under CC BY-SA 4.0.

Edit this page on GitHub

We use cookies to personalize content and to analyze our traffic. Please decide if you are willing to accept cookies from our website.