Automates login at the KDE Plasma greeter using ydotool, allowing remote GUI access (e.g. for Sunshine) after reboot or logout.
When using Sunshine for remote streaming, the server cannot access a Wayland session until a user logs in.
This script allows logging into the Plasma greeter remotely via SSH by simulating keyboard input using ydotool.
I've also just recently added support for unlocking kscreenlocker.
- KDE Plasma Login Manager
- Must be run after the system has reached the Plasma login screen
ydotooluinputkernel module enabled- User added to the
inputgroup - SSH access to the machine
- Waits for the Plasma greeter to appear on
seat0. - Starts a temporary
ydotooldinstance. - Waits for the
ydotooldsocket to become ready. - Prompts for your password securely (no terminal echo).
- Clears the password field.
- Types the password using virtual input.
- Presses Enter.
- Stops
ydotoold.
Make executable:
chmod +x greeter-login.shRun via SSH once the system is at the login screen:
./greeter-login.sh- Your password is entered via simulated keyboard input.
- It is read silently and unset immediately after use.
- This script is intended for personal remote access setups.
- Use at your own risk.