### Start the KRdp example server Source: https://github.com/kde/krdp/blob/master/README.md Launch the server with specified credentials to enable RDP connections. ```bash krdpserver -u user -p test ``` -------------------------------- ### Install Executable Source: https://github.com/kde/krdp/blob/master/server/CMakeLists.txt Installs the krdpserver executable to the binary directory. ```cmake install(TARGETS krdpserver DESTINATION ${KDE_INSTALL_BINDIR}) ``` -------------------------------- ### Install Desktop Entry Source: https://github.com/kde/krdp/blob/master/server/CMakeLists.txt Installs the Krdp server desktop entry file. ```cmake install(FILES ${CMAKE_CURRENT_BINARY_DIR}/org.kde.krdpserver.desktop DESTINATION ${KDE_INSTALL_APPDIR}) ``` -------------------------------- ### Install Systemd Preset Source: https://github.com/kde/krdp/blob/master/server/CMakeLists.txt Installs the Krdp server systemd preset file. ```cmake install(FILES 00-krdp.preset DESTINATION ${KDE_INSTALL_SYSTEMDUNITDIR}/user-preset) ``` -------------------------------- ### Install Systemd Service Source: https://github.com/kde/krdp/blob/master/server/CMakeLists.txt Installs the Krdp server systemd user service file. ```cmake install(FILES ${CMAKE_CURRENT_BINARY_DIR}/app-org.kde.krdpserver.service DESTINATION ${KDE_INSTALL_SYSTEMDUNITDIR}) ``` -------------------------------- ### Add GNU GPL License Header to Source Files Source: https://github.com/kde/krdp/blob/master/LICENSES/LGPL-3.0-only.txt Attach this notice to the start of each source file to state the exclusion of warranty and provide license details. ```text Copyright (C) This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . ``` -------------------------------- ### Add Interactive Mode License Notice Source: https://github.com/kde/krdp/blob/master/LICENSES/LGPL-3.0-only.txt Display this short notice when a program starts in interactive mode to inform users of the license terms. ```text Copyright (C) This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. ``` -------------------------------- ### Configure KRdp via CLI Source: https://github.com/kde/krdp/blob/master/README.md Use these commands to authorize the server, generate certificates, and enable the systemd service for remote access. ```bash # Authorize the krdpserver for remote desktop access flatpak permission-set kde-authorized remote-desktop org.kde.krdpserver yes # Generate a server certificate mkdir --parents "$HOME/.local/share/krdpserver" certificatePath="$HOME/.local/share/krdpserver/krdp.crt" certificateKeyPath="$HOME/.local/share/krdpserver/krdp.key" openssl req -nodes -new -x509 -keyout "$certificateKeyPath" -out "$certificatePath" -days 1 -batch # Configure the certificate and enable system user authentication kwriteconfig6 --file krdpserverrc --group General --key Certificate "$certificatePath" kwriteconfig6 --file krdpserverrc --group General --key CertificateKey "$certificateKeyPath" kwriteconfig6 --file krdpserverrc --group General --key SystemUserEnabled true # Enable/restart the systemd service systemctl --user enable --now app-org.kde.krdpserver.service systemctl --user restart app-org.kde.krdpserver.service ``` -------------------------------- ### Configure KConfig File Source: https://github.com/kde/krdp/blob/master/server/CMakeLists.txt Integrates a KConfig file for server settings, creating a singleton class. ```cmake kconfig_target_kcfg_file(krdpserver FILE krdpserversettings.kcfg CLASS_NAME ServerConfig SINGLETON) ``` -------------------------------- ### Configure Desktop Entry File Source: https://github.com/kde/krdp/blob/master/server/CMakeLists.txt Configures the desktop entry file for the Krdp server. ```cmake configure_file(org.kde.krdpserver.desktop.cmake ${CMAKE_CURRENT_BINARY_DIR}/org.kde.krdpserver.desktop @ONLY) ``` -------------------------------- ### Connect to the KRdp server using FreeRDP Source: https://github.com/kde/krdp/blob/master/README.md Use the xfreerdp client to establish a connection to the running server. ```bash xfreerdp /u: /p: -clipboard /v::3389 ``` -------------------------------- ### Configure Service File Source: https://github.com/kde/krdp/blob/master/server/CMakeLists.txt Configures the systemd service file for the Krdp server. ```cmake configure_file(app-org.kde.krdpserver.service.in ${CMAKE_CURRENT_BINARY_DIR}/app-org.kde.krdpserver.service @ONLY) ``` -------------------------------- ### Specify Source Files Source: https://github.com/kde/krdp/blob/master/server/CMakeLists.txt Lists the source files to be compiled for the krdpserver executable. ```cmake target_sources(krdpserver PRIVATE main.cpp SessionController.cpp) ``` -------------------------------- ### Link Libraries Source: https://github.com/kde/krdp/blob/master/server/CMakeLists.txt Links the krdpserver executable against necessary Qt6 and KF6 libraries. ```cmake target_link_libraries(krdpserver PRIVATE Qt6::Gui KF6::CoreAddons KF6::ConfigGui KF6::DBusAddons KF6::Crash KRdp qt6keychain KF6::StatusNotifierItem KF6::I18n) ``` -------------------------------- ### Configure KRDP Server Smoke Test Source: https://github.com/kde/krdp/blob/master/autotests/CMakeLists.txt Adds a test named 'kcm_smoketest' that runs the kcm_krdpserver smoke test using kcmshell6. It also sets the QT_PLUGIN_PATH environment variable for the test. ```cmake add_test(NAME kcm_smoketest COMMAND kcmshell6 --smoke-test kcm_krdpserver) set_tests_properties(kcm_smoketest PROPERTIES ENVIRONMENT_MODIFICATION QT_PLUGIN_PATH=path_list_prepend:${CMAKE_BINARY_DIR}/bin ) ``` -------------------------------- ### Add Include Directories Source: https://github.com/kde/krdp/blob/master/server/CMakeLists.txt Specifies private include directories for the krdpserver target. ```cmake target_include_directories(krdpserver PRIVATE ${CMAKE_BINARY_DIR}) ``` -------------------------------- ### Configure krdpstreamer executable in CMake Source: https://github.com/kde/krdp/blob/master/examples/streamer/CMakeLists.txt Defines the executable target, source files, and library dependencies for the krdpstreamer project. ```cmake # SPDX-FileCopyrightText: 2023 Arjen Hiemstra # SPDX-License-Identifier: BSD-2-Clause add_executable(krdpstreamer) target_sources(krdpstreamer PRIVATE main.cpp) target_link_libraries(krdpstreamer Qt${QT_MAJOR_VERSION}::Gui KRdp) ``` -------------------------------- ### Add Executable Target Source: https://github.com/kde/krdp/blob/master/server/CMakeLists.txt Defines the main executable target for the Krdp server. ```cmake add_executable(krdpserver) ``` -------------------------------- ### Configure SDDM Autologin Source: https://github.com/kde/krdp/blob/master/README.md Configure SDDM to automatically log in a user for RDP access. Note that this leaves the physical session unlocked. ```bash # Configure autologin for your current user user=$(whoami) sudo kwriteconfig6 --file /etc/sddm.conf.d/kde_settings.conf --group Autologin --key User $user # Enable automatic relogin on logout to avoid scenarios where the system is stuck on sddm sudo kwriteconfig6 --file /etc/sddm.conf.d/kde_settings.conf --group Autologin --key Relogin true # Restart sddm to force an autologin (don't run this if you are already logged in :D) ## systemctl restart sddm.service ``` -------------------------------- ### Define Translation Domain Source: https://github.com/kde/krdp/blob/master/server/CMakeLists.txt Sets the translation domain for the project, used for internationalization. ```cmake add_definitions(-DTRANSLATION_DOMAIN="krdpserver") ``` -------------------------------- ### Conditional Compilation for Plasma Session Source: https://github.com/kde/krdp/blob/master/server/CMakeLists.txt Conditionally defines WITH_PLASMA_SESSION if BUILD_PLASMA_SESSION is enabled. ```cmake if (BUILD_PLASMA_SESSION) target_compile_definitions(krdpserver PRIVATE -DWITH_PLASMA_SESSION) endif() ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.