gnome-shell-extension-window-session-manager icon indicating copy to clipboard operation
gnome-shell-extension-window-session-manager copied to clipboard

Automatic saving/restoring

Open wizonesolutions opened this issue 5 years ago • 7 comments

It is possible to have this extension detect a shutdown/restart and save the windows prior, then reopen them when the system starts again? Currently, if I forget to save my session, I'm a bit out of luck.

Alternatively, I wonder if it'd be possible to integrate with the reboot dialog and have a checkbox/button for saving the session. That way, people could choose to not do so if they didn't want to. I'm obviously rather inspired by macOS with this request.

wizonesolutions avatar Jul 29 '19 10:07 wizonesolutions

Hey there! Thanks for opening up this issue. This would require continuously saving the current session, which is not ideal, but it should be possible. Currently I don't really have time to implement such a feature, but Pull Requests would be welcome.

johannesjo avatar Jul 29 '19 10:07 johannesjo

Two thoughts:

  1. Would it be possible to be notified of logout, e.g. by catching the SessionOver signal?
  2. Quick-and-dirty hack: copy a logout button extension, and save the session before logging out.

rrthomas avatar Mar 10 '20 18:03 rrthomas

@rrthomas great suggestion! Would you be willing to give it a go yourself?

johannesjo avatar Mar 11 '20 15:03 johannesjo

(I know basically nothing about GNOME Shell extensions, but I presume you don't know much either or you wouldn't've asked me for help!)

I tried the quick-and-dirty hack version first, as being a useful proof of concept. See https://github.com/rrthomas/gnome-shell-extension-window-session-manager

This just copies logout button code from https://gitlab.com/paddatrapper/log-out-button-gnome-extension and makes it additionally save the session "DEFAULT" on logout.

rrthomas avatar Mar 13 '20 16:03 rrthomas

@rrthomas are you running your version of this?

curiousercreative avatar Mar 03 '21 19:03 curiousercreative

@curiousercreative No. I'm not sure what I found at the time with my hack, I'm sorry; but of course someone else is welcome to try it. I must say I've given up in general on GNOME's session management, and I've been trying KDE recently. (I also tried MATE and XFCE and had no luck with them either; to be clear, my aim is specifically to restart with apps on the correct virtual desktops. lwsm doesn't seem to do that reliably, at least for me.)

rrthomas avatar Mar 03 '21 19:03 rrthomas

Extends ui/endSessionDialog.js and add automatic saving and closing code seems very practical in this case.

nlpsuge avatar Dec 13 '21 05:12 nlpsuge