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.

Until 11.10 I used Kubuntu. For some annoying reasons i migrated to Ubuntu from 12.04. Now i really miss some KDE features and i don't have found solution yet.

First big problem: i work with lot of windows ( >20 ) and i set them on different workplaces. I avoid restarting computer, but sometimes it is neccessary. And then is so tedious to set my workspace up again. Is there some cure for that?

I read already some sources: Save Unity Desktop Session and https://bugs.launchpad.net/ubuntu/+source/gnome-session/+bug/771896 and https://lists.ubuntu.com/archives/ubuntu-desktop/2011-January/002734.html.

Is there some change in 12.04? What is the meaning of workplaces, when you need to set them up every time after login?

share|improve this question
    
The general idea is that suspend and hibernate are the way to go. When those work they work well. –  Rinzwind May 7 '12 at 18:42
    
@Rinzwind: AFAIU there is no hibernate in 12.04 by default. It is not rare to my laptop to have uptime more than month, but still there are cases when i need restart computer. For example, last week i tried to add printer and computer hanged totally. No access to console neither through SSH, only way was reboot. And it is tedious to build your workplaces up from scratch every time. –  wk. May 8 '12 at 7:04
add comment

2 Answers 2

Info
The feature to save session has been removed in Ubuntu 12.04 because of a bug.

First
I have made a workaround that is a script that helps to configure your session. Just paste the command below at terminal and press Enter.

This if you are using Metacity (Unity-2d):

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

.

Or this if you are using Compiz (Unity-3d):

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

You can view the code of script (1, 2). There are explanations in each part. It will create a startup script which will move to each viewport (or desktop) and open the specified application.

Removing

To remove any changes made by my script just delete this files (if they exists):

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

Or run this at terminal:

rm ~/session.config ; rm ~/session.meta.config ; rm ~/sessionconf ; rm ~/sessionconf.bak ; rm ~/.config/autostart/sessionconf.desktop  

Second
There are others workarounds like TuxOnIce:

"TuxOnIce is most easily described as the Linux equivalent of Windows' hibernate functionality, but better. It saves the contents of memory to disk and powers down. When the computer is started up again, it reloads the contents and the user can continue from where they left off. No documents need to be reloaded or applications reopened and the process is much faster than a normal shutdown and start up."

See it working here.

You can install it through "tuxonice/ppa":
1) Add the ppa: sudo apt-add-repository ppa:tuxonice/ppa
2) Update: sudo apt-get update
3) Install sudo apt-get install tuxonice-userui linux-generic-tuxonice linux-headers-generic-tuxonice


Third
A third idea is to set Compiz to launch windows in selected viewports:

1) Install CompizConfig-Settings-Manager,

2) Open Alt + F2 and type ccsm and hit Enter,

3) Go to "Place Windows"

enter image description here

4) Select "Fixed Window Placement" > "Window with fixed viewport" > "New"

enter image description here

5) Select the window by class, id, title, name, type or role and set the viewport it should be placed:

enter image description here

enter image description here

6) Now add your apps to "Startup Applications" (press Super and type Startup Applications)

share|improve this answer
    
Your First idea has something in it. If i got nothing else, this is the way to go. Thank you for your efforts! As i use Unity-2d i avoid Compiz too. –  wk. May 11 '12 at 19:35
    
I thought you were using Compiz, I will re write to work in metacity. –  desgua May 11 '12 at 22:22
    
Got it working with metacity! I'm happy :-) –  desgua May 12 '12 at 0:30
    
Does it work with a lot of windows of one app? I mean, most of my windows are Chromium tab-sets. How could i choose, which are on which workplace? –  wk. May 12 '12 at 9:37
    
I will ask a workspace and you choose (example: "2" for the second workspace) and then I will ask which app and you choose for example "chromium-browser askubuntu.com"; –  desgua May 12 '12 at 12:34
show 6 more comments

Another possible workaround? (Enable Hibernate)

sudo gedit /var/lib/polkit/localauthority=50-loc.d/hibernate.pkla

And add the following and save:

[Re-enable Hibernate]

Identity=unix-user:*

Action=org.freedesktop.upower.hibernate

ResultActive=yes

NOTE: USE WITH CAUTION! Hibernate was removed for a reason - you can test if this will work before editing hibernate.pkla by trying this in a terminal with some other windows running at the time.

pm-hibernate

share|improve this answer
    
I can't rely on hibernate (i need something working on computer hangs/restarts too) and on my computer hibernate does not work correctly. –  wk. May 12 '12 at 8:52
add comment

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.