Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

Is there a way to save current session (the applications + the organization of windows in desktops) in Unity and load it when needed?

share|improve this question

5 Answers 5

up vote 4 down vote accepted

No - as you've described it is not currently possible on Ubuntu versions 11.04 and up.

You may read this bug report, comment 24 in particular

https://bugs.launchpad.net/ubuntu/+source/gnome-session/+bug/771896

or here is a more complete explanation (too long to copy here)?

https://lists.ubuntu.com/archives/ubuntu-desktop/2011-January/002734.html

share|improve this answer

I have made a workaround that is a script that helps to configure your session. Just paste this at terminal:

cd ~/ && wget -c http://dl.dropbox.com/u/4098082/session.config && chmod +x ~/session.config && ~/session.config

You can view the code of script ( http://dl.dropbox.com/u/4098082/session.config ), there are explanations in each part. It will create a startup script which will move to each viewport and open the specified application.

Also you can run it whenever you want just press Alt + F2 and paste ~/.sessionconf.

Removing

To remove any changes made by my script just delete this files:

  • ~/session.config
  • ~/sessionconf
  • ~/sessionconf.bak
  • ~/.config/autostart/sessionconf.desktop

Or run this at terminal:

rm ~/session.config ; rm ~/sessionconf ; rm ~/sessionconf.bak ; rm ~/.config/autostart/sessionconf.desktop  
share|improve this answer

You can do this: killall gnome-session. As we know that entering the command sudo gnome-session-save --logout will log out the system. This will save the current session on Unity. I have tried this.

Or may be you can read about how to make a program auto-start everytime you log in.

Or you can try this gconf-editor key:

/apps/gnome-session/options/auto_save_session = true
share|improve this answer
    
What is gnome-session-save? I get "command not found". And I can't find it in repository. "Unable to locate package gnome-session-save". –  Sanjay Manohar Mar 27 at 22:23

dconf write /org/gnome/gnome-session/auto-save-session true Should enable this for you.

share|improve this answer
1  
Not working on 14.04 :( –  AlikElzin-kilaka Jan 29 at 23:20
    
I also cannot get it to work on 14.04. The property is changed correctly, but nothing gets restored. Do you know where the session data is stored? That way I could find out if it's actually being saved. –  Sanjay Manohar Mar 27 at 22:22

This script works great for me on Xubuntu. It's more or less desktop-agnostic and in theory should also support Unity. From the original blog post by Arnon Weinberg:

GNOME session save and restore

This script is used to save and restore a desktop session.

Why this script?

Some desktop managers do offer some session management features. Under GNOME it may be possible to run gnome-session-properties manually and turn on “Automatically remember running applications when logging out”. However, some GNOME implementations (notably Ubuntu’s) appear to be deemphasizing or deprecating this feature in favour of the Suspend or Hibernate feature.

Both the automated session save and suspend feature however are limited to saving/restoring sessions only on clean logout/login.

I use this script because sometimes I just need to reboot, and sometimes I like to restore my session to a previous state.

How to use:

Download the script, place it on your PATH, and be sure to give it executable permissions.

To save the current session:

session save

To restore the saved session:

session restore

Installation on Ubuntu

The installation instructions provided in the blog post are valid for Fedora. On Ubuntu you will have to install the following dependencies:

sudo apt-get install perl wmctrl xdotool x11-utils

Please make sure to check out the 'Details' section of the original blog post to find out more about the different session restore levels.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.