The best way to Save And Restore The Oneness Session In Ubuntu (Using The Script)

Unity doesn’t support saving the present session and restoring it on login for quite some time however , you can do this with the aid of a script.

Arnon Weinberg created a script which allows saving and restoring a desktop computer session . The script turn up useful info exactly like the GNOME session conserve and restore feature, but it really does the job and gives some control over what you need to restore and when.
This how the script works: you must personally save a session using a simple order, and then choose when to restore this, with three different options:
  • 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).

Obviously, if you don’t want to recover the session manually, you can add the particular script to startup so it brings back your last saved session in login, but you’ll still have in order to save the session manually.

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.  

The script is not really perfect and there are a few things you ought to know before using it:
  • 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.

Despite this, the script does the work pretty well and it’s probably the best solution designed for saving and restoring the Oneness session.
It’s important to mention the fact that script is not Unity or even Ubuntu specific! In fact , Arnon created this for Fedora and GNOME Covering however , I’ve only tested this in Ubuntu with Unity (and thus, I’ve only included adjustments for it).

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  

You can check out the screenplay code RIGHT HERE . Or, if you want to download Arnon’s script (without my Unity fixes), see his post HERE .

Gowns it!

In order to save the current session , simply utilize the following command:

  session conserve  

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

Below you can view a quick demo video, which displays using the script to save the program and restore window geometries associated with missing windows (opens any formerly running app windows and brings back both windows positions and geometries), equivalent to the command “session bring back 2”:


( direct video link )

Original script through thewebsitepeople. org

Furthermore see:

Leave a Reply

Your email address will not be published. Required fields are marked *

3 × three =