- restore geometries of existing windows – restores the window angles and position (including workspace) for many running windows;
- restore matching windows – restores the window angles and position (including workspace) meant for both apps that are still working as well as those that were restarted;
- restore running programs : restores all application home windows that were running (even if they are right now closed) when the session was conserved, along with their position (including workspace) plus window geometry;
Important note: The particular script can only restore app home windows that were open when the session has been saved and can’t restore programs that were running in the background (so in order to restore an app, that application needs to have at least one open window once the session is saved).
Arnon’s original session save and regain script doesn’t work properly in Oneness, but I was able to get it to utilize some very simple fixes.
- it doesn’t work for every single application. For example, it can’t restore an open Nemo window because Nemo lacks the particular “–new-window” command line option (which does exist in Nautilus);
- when using “restore 2” (so the apps that aren’t operating are restored along with their window placement and size): there’s a delay among launching the app and resizing / positioning its window — that’s because the script waits a couple of seconds to make sure the app actually begins before trying to manipulate its home window.
Unity session save plus restore script installation and use
1 ) The script demands perl, xprop (available in the x11-utils package), wmctrl and xdotool. To set up these in Ubuntu, use the order below:
sudo apt-get install perl x11-utils wmctrl xdotool
2 . In order to download my modified script, set it up in /usr/local/bin and make it executable, make use of the following commands:
wget http://raw.githubusercontent.com/hotice/webupd8/master/session -O /tmp/session sudo install /tmp/session /usr/local/bin/ sudo chmod +x /usr/local/bin/session
In order to save the current session , simply utilize the following command:
Then, when you want in order to restore the program , use:
session restore X
where X is:
- two – Restore geometries of lacking windows (opens any previously operating app windows and restores each windows positions and geometries);
- 1 – Restore geometries of matching windows (restores screen geometry and position for all working apps, even if they were restarted because the session was saved);
- 0 – Restore geometries associated with existing windows (restores window angles and position for apps that will weren’t closed since the session had been saved).
For instance “session restore 2” to bring back geometries of missing windows, and so forth
( direct video link )