Lock desktop screen from android - GSConnect/gnome-shell-extension-gsconnect GitHub Wiki

On your desktop go to Mobile Settings select your device and add a new command

1st input box Name: Lock Screen

2nd input box Command Line: dbus-send --type=method_call --dest=org.gnome.ScreenSaver /org/gnome/ScreenSaver org.gnome.ScreenSaver.Lock

Now go to you KDEConnect app on Andoid and select your Desktop, select the burger menu on the top right ⋮ then Plugin settings and enable Run Command. You should see new a new option for you device Run Command where you can select the Lock Screen command you just created.