johannesjo / gnome-shell-extension-window-session-manager

An indicator that let's you save and restore your open apps and the window positions and arrangements over multiple real and virtual displays.
MIT License
91 stars 18 forks source link

Automatic saving/restoring #17

Open wizonesolutions opened 5 years ago

wizonesolutions commented 5 years ago

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.

johannesjo commented 5 years ago

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.

rrthomas commented 4 years ago

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.
johannesjo commented 4 years ago

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

rrthomas commented 4 years ago

(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.

curiousercreative commented 3 years ago

@rrthomas are you running your version of this?

rrthomas commented 3 years ago

@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.)

nlpsuge commented 2 years ago

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