diff --git a/bin/CMakeLists.txt b/bin/CMakeLists.txt index b0e91b98..c42e5849 100644 --- a/bin/CMakeLists.txt +++ b/bin/CMakeLists.txt @@ -10,3 +10,8 @@ install(FILES ${CMAKE_CURRENT_BINARY_DIR}/plasma-mobile.desktop DESTINATION ${KDE_INSTALL_DATADIR}/wayland-sessions ) + +# For Plasma developers +configure_file(startplasmamobile-dev.sh.cmake ${CMAKE_CURRENT_BINARY_DIR}/startplasmamobile-dev.sh) +configure_file(plasma-mobile-dev.desktop.cmake ${CMAKE_CURRENT_BINARY_DIR}/plasma-mobile-dev.desktop) +configure_file(install-sessions.sh.cmake ${CMAKE_CURRENT_BINARY_DIR}/install-sessions.sh) diff --git a/bin/install-sessions.sh.cmake b/bin/install-sessions.sh.cmake new file mode 100755 index 00000000..d8d68f98 --- /dev/null +++ b/bin/install-sessions.sh.cmake @@ -0,0 +1,33 @@ +#!/bin/sh +# SPDX-FileCopyrightText: 2019 Aleix Pol Gonzalez +# SPDX-FileCopyrightText: 2021 Nate Graham +# SPDX-FileCopyrightText: 2022 Devin Lin +# +# SPDX-License-Identifier: GPL-2.0-or-later + +set -e + +# Make built-from-source sessions appear in login screen +sudo install @CMAKE_CURRENT_BINARY_DIR@/plasma-mobile-dev.desktop /usr/share/wayland-sessions/ +install @CMAKE_CURRENT_BINARY_DIR@/startplasmamobile-dev.sh @CMAKE_INSTALL_FULL_LIBEXECDIR@ + +# Make the system DBus able to see any new DBus files that have been added to +# the built-from-source plasma session which are not yet present in the system +# DBus locations. Because some distros have security policies which prevent the +# use of DBus files in a user's homedir, and even symlinks outside, +# we have to copy the files into a system-owned location. +sudo mkdir -p /opt/kde-dbus-scripts/ +sudo cp -r @KDE_INSTALL_FULL_DBUSDIR@/* /opt/kde-dbus-scripts/ +if [ ! -f /etc/dbus-1/session-local.conf ] +then + cat > session-local.conf << EOF + + /opt/kde-dbus-scripts/services + /opt/kde-dbus-scripts/system-services + /opt/kde-dbus-scripts/system.d/ + /opt/kde-dbus-scripts/interfaces/ + +EOF + sudo mv session-local.conf /etc/dbus-1/ +fi + diff --git a/bin/plasma-mobile-dev.desktop.cmake b/bin/plasma-mobile-dev.desktop.cmake new file mode 100644 index 00000000..60347491 --- /dev/null +++ b/bin/plasma-mobile-dev.desktop.cmake @@ -0,0 +1,47 @@ +# SPDX-FileCopyrightText: 2022 Devin Lin +# SPDX-License-Identifier: GPL-2.0-or-later + +[Desktop Entry] +Exec=@CMAKE_INSTALL_FULL_LIBEXECDIR@/plasma-dbus-run-session-if-needed @CMAKE_INSTALL_FULL_LIBEXECDIR@/startplasmamobile-dev.sh +DesktopNames=KDE +Name=Plasma Mobile (Development) +Comment=Plasma Mobile by KDE +Comment[ast]=Plasma Mobile, por KDE +Comment[az]=KDE Plasma Mobil +Comment[ca]=Plasma Mobile, creat per la comunitat KDE +Comment[ca@valencia]=Plasma Mobile, creat per la comunitat KDE +Comment[cs]=Plasma Mobile od KDE +Comment[da]=Plasma Mobile fra KDE +Comment[de]=Plasma Mobile von KDE +Comment[en_GB]=Plasma Mobile by KDE +Comment[es]=Plasma Mobile creado por KDE +Comment[et]=KDE Plasma Mobile +Comment[eu]=Plasma Mugikorra KDEk egina +Comment[fi]=KDE:n Plasma Mobile +Comment[fr]=Plasma Mobile par KDE +Comment[gl]=Plasma Mobile de KDE +Comment[hi]=केडीइ द्वारा प्लाज़्मा मोबाइल +Comment[hu]=Plasma Mobile a KDE-től +Comment[ia]=Plasma Mobile per KDE +Comment[id]=Plasma Mobile oleh KDE +Comment[it]=Plasma Mobile creato da KDE +Comment[ka]=მობილური Plasma, KDE-სგან +Comment[ko]=KDE의 Plasma 모바일 +Comment[lt]=Plasma mobilioji sąsaja pagal KDE +Comment[nl]=Plasma-mobiel door KDE +Comment[nn]=Plasma Mobile frå KDE +Comment[pa]=KDE ਵਲੋਂ ਪਲਾਜ਼ਮਾ ਮੋਬਾਈਲ +Comment[pl]=Plazma Mobile stworzona przez KDE +Comment[pt]=Plasma Mobile do KDE +Comment[pt_BR]=Plasma Mobile do KDE +Comment[ro]=Plasma Mobile, de către KDE +Comment[ru]=KDE Plasma Mobile +Comment[sk]=Plasma Mobile od KDE +Comment[sl]=Plasma Mobile od KDE +Comment[sv]=Plasma mobil av KDE +Comment[tr]=KDE tarafından yapılan Plasma Mobile +Comment[uk]=Мобільна Плазма від KDE +Comment[x-test]=xxPlasma Mobile by KDExx +Comment[zh_CN]=KDE Plasma Mobile +Comment[zh_TW]=來自 KDE 的 Plasma 行動作業系統 +X-KDE-PluginInfo-Version=${PROJECT_VERSION} diff --git a/bin/startplasmamobile-dev.sh.cmake b/bin/startplasmamobile-dev.sh.cmake new file mode 100755 index 00000000..61544a12 --- /dev/null +++ b/bin/startplasmamobile-dev.sh.cmake @@ -0,0 +1,19 @@ +#!/bin/bash +# SPDX-FileCopyrightText: 2019 Aleix Pol Gonzalez +# +# SPDX-License-Identifier: GPL-2.0-or-later + +source @CMAKE_INSTALL_FULL_LIBEXECDIR@/plasma-dev-prefix.sh + +# This is a bit of a hack done because systemd starts in pam, and we only set our dev paths after all that is complete +# This copies everything into a transient runtime directory that systemd reads and reloads the units + +if [ ! -z "$XDG_RUNTIME_DIR" ]; then + mkdir -p "$XDG_RUNTIME_DIR/systemd/user.control" + command cp -r @KDE_INSTALL_FULL_SYSTEMDUSERUNITDIR@/* $XDG_RUNTIME_DIR/systemd/user.control + systemctl --user daemon-reload +fi + + +startplasmamobile$@ +