manually reload Dolphin session?

Bug Reporter bugreporter11 at gmail.com
Wed May 9 05:23:22 BST 2018


On Tue, May 8, 2018 at 6:36 PM, Bug Reporter <bugreporter11 at gmail.com>
wrote:

> see reply inline
>
> On Tue, May 8, 2018 at 4:14 PM, Kevin Krammer <krammer at kde.org> wrote:
>
>> On Dienstag, 8. Mai 2018 19:08:19 CEST Bug Reporter wrote:
>> > Thanks for the helpful responses. See comments inline.
>> >
>> > On Tue, May 8, 2018 at 1:23 AM, Duncan <1i5t5.duncan at cox.net> wrote:
>> > > Bug Reporter posted on Mon, 07 May 2018 18:49:16 -0400 as excerpted:
>> > > > I often keep a lot of tabs open in Dolphin and I would like to be
>> able
>> > > > to open all those tabs / locations again. I have seen an old feature
>> > > > request for Dolphin saved sessions. I'm not asking for that. I just
>> want
>> > > > to know if I can do it manually. For example, I see some older
>> session
>> > > > files that seem to belong to Dolphin. Here's an example:
>> > > >
>> > > > /home/myuser/.config/session/
>> > >
>> > > dolphin_10d1d6cd65000151042956000000012150067_1510464775_250905
>> > >
>> > > > Are files like that currently used by Dolphin? If I have one, can I
>> > > > reload it into Dolphin?
>> > >
>> > > AFAIK those are your kde/plasma session restoration files, not dolphin
>> > > session files.
>> >
>> > That could be. See next comment.
>> >
>> > > The default is restore the previous session, and these session files
>> are
>> > > the session-manager's method of tracking what's open, with window
>> sizes
>> > > and locations, virtual desktop, activity, etc.
>> > >
>> > > That dolphin file, therefore, is unlikely to contain specific
>> information
>> > > about the dolphin session, but rather, where your dolphin windows
>> were in
>> > > that particular session when you logged out.
>> >
>> > If I leave Dolphin open when I log out of Plasma desktop, upon logging
>> back
>> > in Dolphin is restored with all my open tabs and each location within
>> the
>> > split views of those tabs remembered as well. It even remembers which
>> tab
>> > was active. So not only is window size and position remembered, but many
>> > details of the Dolphin session are remembered. Since this can be done
>> when
>> > logging out of the desktop, my preferred solution is to find where that
>> > info is stored, make a copy of it with a "session name" and then load it
>> > manually on demand. I assume I might have to use the dbus scripting hint
>> > provided below by stephen to accomplish this. However, I guess the first
>> > obstacle is finding there this Dolphin session info is saved. I have not
>> > been able to find it yet.
>>
>> Saving a session is handled by a component called the session manager.
>> Each of the X11 desktop shells implements one but the interface is
>> standardized so it more or less works with all applications that support
>> it no
>> matter which desktop they are running on.
>>
>> On a KDE Plasma Desktop the session manager KSMServer, D-Bus name
>> org.kde.ksmserver
>>
>> For example to trigger saving the current session the following command
>> should
>> do
>>
>> $ qdbus org.kde.ksmserver /KSMServer \
>>    org.kde.KSMServerInterface.saveCurrentSession
>>
>> It is also possible to activate that in System Settings, i.e. to manually
>> save
>> a session and have that restored on login instead of saving at logout.
>>
>> Might be possible to restore only part of a session, haven't looked too
>> closely at the capabilities.
>>
>>
> Thanks Kevin. With the information you provided I was able to search more
> effectively. I found this interesting answer:
> https://superuser.com/a/958694/69231
>
> However, it states that "Session data is stored in: ~/.kde4/share/config/
> ksmserverrc". On my system that location does not exist. The find command
> does not show any files by that name in any location on my system. What is
> the Plasma5 location where KSMServer saves these session files now? (Is
> there some reference for
>
> Also, is there any difference in the result of running these two commands?
>
>     dbus-send --dest=org.kde.ksmserver /KSMServer
> org.kde.KSMServerInterface.saveCurrentSession
>     qdbus org.kde.ksmserver /KSMServer org.kde.KSMServerInterface.
> saveCurrentSession
>
>

I was able to confirm that files such as
$HOME/.config/session/dolphin_10d1d6cd65000152582669600000014080063_1525833493_964930
contain information about Dolphin tabs, locations opened in those tabs and
even the currently selected file in each file pane. That information would
be very useful to save and restore manually.

I was able to use method "void
org.kde.KSMServerInterface.saveCurrentSessionAs(QString)" to create a named
session within ~/.config/ksmserverrc. It contains the above referenced
Dolphin session.

However, I'm not finding documentation on these methods shown below. Could
these be used to save a Dolphin-only session and then restore that Dolphin
session?

method void org.kde.KSMServerInterface.saveSubSession(QString, QStringList,
QStringList)
method void org.kde.KSMServerInterface.restoreSubSession(QString)

Does anyone have examples of using the above methods?

The KDE reference I found (
https://api.kde.org/4.x-api/kde-workspace-apidocs/plasma-workspace/html/classKSMServerInterface.html)
apparently doesn't list all the methods, and it also doesn't provide
examples that would be helpful to a non-developer as far as I can tell.

Here's one useful reference I found:

https://raetsel.wordpress.com/2008/04/25/kde4-save-current-session-dbus-to-the-rescue/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde/attachments/20180509/a3ef6498/attachment.htm>


More information about the kde mailing list