Registered Member
|
I know two ways for locking my KDE 4.2 session from command line:
1) qdbus org.freedesktop.ScreenSaver /ScreenSaver Lock 2) /usr/lib64/kde4/libexec/krunner_lock --blank --forcelock what are + and - of this commands? And how can I lock all sessions from bash script with root permissions? |
Administrator
|
As far as I am aware, there is no way directly to lock accounts from root, however if you can access the users session bus, then you can issue the above dbus command which will lock their systems.
KDE Sysadmin
[img]content/bcooksley_sig.png[/img] |
Registered Member
|
KDE 3.5 has this feature:
/usr/kde/3.5/bin/dcop --all-users --all-sessions kdesktop KScreensaverIface lock Are you sure, that it is not ported to current KDE version? |
Administrator
|
This feature cannot be easily ported because it involves gaining access to the private D-Bus session buses of all users. This is only possible through sockets which have the permissions 500 ( Read / Write for the owner, Deny for all others )
Therefore it appears that the only way is to write a script which connects to each of the users buses in turn and sends the message using qdbus. The environment variable you need to change is: "DBUS_SESSION_BUS_ADDRESS" I have a feeling that the GUID value will also need to be determined. Example:
Last edited by bcooksley on Thu Mar 26, 2009 6:29 am, edited 1 time in total.
KDE Sysadmin
[img]content/bcooksley_sig.png[/img] |
Registered users: Bing [Bot], Evergrowing, Google [Bot], rockscient