Programatically Starting a New Session for Another User: A Tech Support Guide
In this article, we will discuss how to start a new session for another user on a KDE6/Wayland system, where the running session is locked and the daemon (KDEConnect) is already running. The other user will be running streaming software (Sunshine) and you want to start a new session for Gamescope/Steam.
Prerequisites
Before we begin, make sure that you have the following prerequisites in place:
- A running KDE6/Wayland system with a locked session
- KDEConnect daemon already running
- Another user with streaming software (Sunshine) installed
- Access to the command line
Starting a New Session
To start a new session for another user, you can use the startplasma-x11 command. This command will start a new Plasma session on the X11 server. Here's an example of how to use this command:
startplasma-x11 --desktop <desktop-name> --session <session-name> --display <display-number> --user <username>
Replace the placeholders with the appropriate values:
desktop-name: The name of the desktop where you want to start the new session. For example,:1.session-name: The name of the session you want to start. For example,Gamescope/Steam.display-number: The number of the display where you want to start the new session. For example,:1.username: The username of the other user who will be running the streaming software.
Here's an example of how to use this command:
startplasma-x11 --desktop :1 --session Gamescope/Steam --display :1 --user otheruser
Switching to the New Session
Once you have started the new session, you can switch to it by using the switchdesktop command. Here's an example of how to use this command:
switchdesktop :1
This will switch your current session to the new session on display :1.
In this article, we have discussed how to start a new session for another user on a KDE6/Wayland system, where the running session is locked and the daemon (KDEConnect) is already running. The other user will be running streaming software (Sunshine). To do this, you can use the startplasma-x11 command to start a new Plasma session on the X11 server, and then switch to the new session using the switchdesktop command.