This forum has been archived. All content is frozen. Please use KDE Discuss instead.

save/restore KDE session from the command line?

Tags: None
(comma "," separated)
agostonbejo
Registered Member
Posts
3
Karma
0
Hi!

Is there a way to save/restore the KDE session (e.g., what files were opened with KWrite, Krusader's/Konsole's current position --i.e., tabs, paths--, etc.) from the command line?

I did try with something like "dbus-send --dest=org.kde.ksmserver /KSMServer org.kde.KSMServerInterface.saveCurrentSession", but I couldn't find out how to restore the session after that or if the KDE session was saved by that at all.

(I have to admit that I have committed the unforgivable herecy of trying out Xfce and one thing I'm missing in it a lot is the ability to restore the state of my KDE applications.)




Does anyone have an idea?

Thanks,
Agoston
User avatar
bcooksley
Administrator
Posts
19765
Karma
87
OS
KSMServer will automatically restore the session next time it is started.


KDE Sysadmin
[img]content/bcooksley_sig.png[/img]
agostonbejo
Registered Member
Posts
3
Karma
0
Thanks!

So far so good! How can I start KSMServer from the command line?
(Apparently Xfce doesn't do it by itself...)
User avatar
bcooksley
Administrator
Posts
19765
Karma
87
OS
Simply running "ksmserver &" should be enough. Be aware that it may try to bring up a full KDE session.


KDE Sysadmin
[img]content/bcooksley_sig.png[/img]
agostonbejo
Registered Member
Posts
3
Karma
0
Yes, I've noticed that. It also replaced e.g. my taskbar, system tray, desktop background... quite a lot more than what I want.

Is there any way to tell it only to restore the application windows? (Like e.g. just by sending it a message with that dbus-send thingy...?)
User avatar
bcooksley
Administrator
Posts
19765
Karma
87
OS
As far as I am aware, there is no way to manually, through D-Bus, initiate a session restore.
The only way you can initiate a session restore is by freshly starting KSMServer.


KDE Sysadmin
[img]content/bcooksley_sig.png[/img]


Bookmarks



Who is online

Registered users: Bing [Bot], Evergrowing, Google [Bot]