diff --git a/CMakeLists.txt b/CMakeLists.txt index 3cb704ec..0a182634 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -38,5 +38,6 @@ plasma_install_package(look-and-feel org.kde.satellite.phone look-and-feel) plasma_install_package(shell org.kde.satellite.phone shells) install(DIRECTORY wallpaper/ DESTINATION "${WALLPAPER_INSTALL_DIR}/org.kde.satellite.lockers") +add_subdirectory(bin) add_subdirectory(qmlcomponents) add_subdirectory(services) diff --git a/bin/CMakeLists.txt b/bin/CMakeLists.txt new file mode 100644 index 00000000..9977660b --- /dev/null +++ b/bin/CMakeLists.txt @@ -0,0 +1,4 @@ +configure_file(${CMAKE_CURRENT_SOURCE_DIR}/plasma-phone.cmake ${CMAKE_CURRENT_BINARY_DIR}/plasma-phone) +install(FILES ${CMAKE_CURRENT_BINARY_DIR}/plasma-phone + PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ WORLD_EXECUTE WORLD_READ GROUP_EXECUTE GROUP_READ + DESTINATION ${BIN_INSTALL_DIR}) diff --git a/bin/plasma-phone.cmake b/bin/plasma-phone.cmake new file mode 100644 index 00000000..ee724418 --- /dev/null +++ b/bin/plasma-phone.cmake @@ -0,0 +1,46 @@ +#!/bin/sh +# +# Script that starts the Plasma phone UI. +# +# Copyright (C) 2014 Pier Luigi Fiorini +# +# This program is free software; you can redistribute it and/or modify it +# under the terms of the GNU Lesser General Public License as published by +# the Free Software Foundation; either version 2.1 of the License, or +# (at your option) any later version. +# + +## Compositor + +export EGL_PLATFORM=hwcomposer +export QT_QPA_PLATFORM=hwcomposer +export QT_QPA_EGLFS_DEPTH=32 +export QT_QPA_EGLFS_HIDECURSOR=1 +export QT_COMPOSITOR_NEGATE_INVERTED_Y=0 +export KSCREEN_BACKEND=QScreen + +/usr/bin/greenisland -plugin evdevtouch:/dev/input/event1 -plugin evdevkeyboard:keymap=/usr/share/qt5/keymaps/droid.qmap -p org.kde.satellite.compositor.phone & + +sleep 3 + +## UI + +unset EGL_PLATFORM +unset QT_QPA_PLATFORM +unset QT_QPA_EGLFS_DEPTH +unset QT_QPA_EGLFS_HIDECURSOR +unset QT_COMPOSITOR_NEGATE_INVERTED_Y + +export LIBEXEC_PATH="/usr/libexec:/usr/lib/libexec:/usr/lib/libexec/kf5" +export QT_PLUGIN_PATH=${QT_PLUGIN_PATH+$QT_PLUGIN_PATH:}`qtpaths --plugin-dir`:/usr/lib/kde5/plugins + +export QT_QPA_PLATFORM=wayland +export QT_QPA_PLATFORMTHEME=KDE +export QT_WAYLAND_DISABLE_WINDOWDECORATION=1 +export XDG_CURRENT_DESKTOP=KDE +export KSCREEN_BACKEND=QScreen + +export KDE_FULL_SESSION=1 +export KDE_SESSION_VERSION=5 + +exec /usr/bin/plasmashell -p org.kde.satellite.phone -n diff --git a/packaging/plasma-phone-components.spec b/packaging/plasma-phone-components.spec index 1a0d7705..9cab43e6 100644 --- a/packaging/plasma-phone-components.spec +++ b/packaging/plasma-phone-components.spec @@ -125,7 +125,8 @@ EOF # Install services links mkdir -p %{buildroot}%{_libdir}/systemd/user/user-session.target.wants -UNITS="plasma-phone-compositor plasma-phone-ui" +#UNITS="plasma-phone-compositor plasma-phone-ui" +UNITS="plasma-phone" for service in $UNITS; do ln -sf ../${service}.service %{buildroot}%{_libdir}/systemd/user/user-session.target.wants/${service}.service done diff --git a/services/plasma-phone.service.cmake b/services/plasma-phone.service.cmake new file mode 100644 index 00000000..4a27180a --- /dev/null +++ b/services/plasma-phone.service.cmake @@ -0,0 +1,17 @@ +# +# Copyright (C) 2014 Pier Luigi Fiorini +# +# Starts Plasma shell for phones. +# + +[Unit] +Description=Plasma Phone +Requires=dbus.socket + +[Service] +Environment=DBUS_SESSION_BUS_ADDRESS=unix:path=%t/dbus/user_bus_socket +ExecStart=@CMAKE_INSTALL_FULL_BINDIR@/plasma-phone +Restart=on-failure + +[Install] +WantedBy=user-session.target