OpenSuse Leap 42.1 and I would like to remap my Keyboard. Now, I want to remap one key (The Sleep key) to lock the screen instead of sending the entire PC to sleep. For that reason, I need the
Konsole-Command to lock the screen. I Googled and only found commands that works for
Ubuntu/Debian/Fedora/KDE4, but I was unable to find anything that worked for my
OpenSuse Version. Would you please provide any suggestions?
This works on Unity or GNOME.
On Unity or GNOME, you can lock the screen using the command
dbus-send as follows:
dbus-send --type=method_call --dest=org.gnome.ScreenSaver /org/gnome/ScreenSaver org.gnome.ScreenSaver.Lock
The --type=method_call tells dbus-send to call a method. The --dest=org.gnome.ScreenSaver tells it the command is in org.gnome.ScreenSaver. The org.gnome.ScreenSaver.Lock tells it to lock the screen.