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.

I am running Ubuntu in VirtualBox (on a Windows 7 host). Several times now, the top-level menu bar, the task bar — and seemingly every system dialog — have forgotten the out-of-the-box "Ambiance" theme they conform to when I first installed the system. Window captions still preserve the theme, but pretty much nothing else does.

I have searched high and low on Google for assistance with this problem. Everything I've found suggests either running some gconf reset or deleting .gconf* .gnome* and other similar directories. I have followed all this advice and nothing works. I still get a boring Windows-95-style gray 3D look and feel. On previous occasions, after much messing around I've given up and rebooted the VM instance, and been pleasantly suprised to see the original "Ambience" theme restored throughout the UI, but invariably it disappears again some time later, usually after a reboot, so I can never figure out what I did that broke it.

Here's a sample from Ubuntu's site of what I want it to look like.

alt text

And here's a screenshot of my system as it currently looks.

alt text

Also note that my GNOME Terminals normally have a nice purple semi-translucent look, and as can be seen from the screenshot, they are now just a solid matte white.

This last time (just yesterday), trying numerous combinations all the usual tricks and rebooting several times hasn't fixed it, so here I am on SU wondering:

How do I recover the out-of-the-box theme for my Gnome/Ubuntu desktop, noting that blowing away all config files — as suggested in many places online — fails to achieve this?

It might help to know that it seems to fail either after I resize the VM instance, forcing the Ubuntu desktop to resize itself, or after I play around with Compiz settings. I haven't been able to figure out which of these it is, and it could be neither. Given the amount of pain I have had to go through to get things back to normal (and given that I am at a loss as to how to do so), it has proven difficult to definitively isolate the cause.

share|improve this question
add comment

16 Answers 16

Please , try this and reboot ! :)

gconftool-2 --shutdown        
rm -rf ~/.gconf/apps/panel       
pkill gnome-panel        
share|improve this answer
    
Thank you for the suggestion, Iván, but no banana. I entered the above instructions, and rebooted. The system came back with a freshly configured panel, but still with the bland gray color scheme and a white background on my Terminal windows. –  Marcelo Cantos Jan 17 '11 at 1:50
add comment

10.10 has this problem, but normally it happens when you install the proprietary nvidia driver. However, the solution will probably also work on a virtual machine.

Create a text file. Write in it

include "/usr/share/themes/Ambiance/gtk-2.0/gtkrc"
gtk-icon-theme-name = "ubuntu-mono-dark"

and save it in your home folder under the name .gtkrc-2.0. Restart.

If there are still elements wrong (for me it was the font), you need to add this change to the file, google for a gtk tutorial for the possible fine tunings.

share|improve this answer
    
+1, @rumtscho; this answer brings back the full theme. It seems like a work-around, however. Since a pristine Ubuntu 10.10 looks right without it, why is this file needed at all? –  Marcelo Cantos Jan 17 '11 at 2:03
    
A pristine Ubuntu comes with open source video drivers only. The problem you describe is a common bug in the proprietary video drivers. As they are closed source, only nVidia can deliver a fix. You could remove them and revert to an open source driver, but you'll lose Compiz and 3d acceleration. –  rumtscho Jan 17 '11 at 8:28
    
this seems to have fixed this on my 10.10 install... for now –  schwiz Feb 22 '11 at 19:24
    
spoke too soon, on my next reboot settings were lost again –  schwiz Feb 22 '11 at 19:34
    
@schwiz For me, it works every time - but the settings have to be saved in the home folder of the account you are currently logged in with. If you rebooted and logged in as a different user, it doesn't work. If you start a GUI window with sudo, it doesn't work either, as it then has the settings of the root user, and not of the user logged in. –  rumtscho Feb 23 '11 at 17:29
show 1 more comment

I have the same Problem, sudo killall nautilus fixes it. (temporarily)

share|improve this answer
    
Thank you for commenting, @Pit, but this didn't do anything for me. –  Marcelo Cantos Jan 17 '11 at 2:09
    
I had the Problem again today and i had to run gnome-appearance-properties to fix the menu and afterwards killall nautilus to fix nautilus appearance. –  Pit Jan 17 '11 at 12:12
add comment

Press Alt+F2 (Run Application) and run the following:

gksudo gnome-settings-daemon
share|improve this answer
    
+1, @zpletan for giving me a nudge in the right direction. When I run this via sudo gnome-settings-daemon, it recovers the full theme, but I don't want to have to run this every time I restart my system. I'll add the errors I get without sudo to my question. Maybe that will hint at what's going wrong. –  Marcelo Cantos Jan 17 '11 at 2:06
    
Actually, that isn't necessary. @Jorge's comment on my answer leads to a question that shows exactly the output I am seeing. –  Marcelo Cantos Jan 17 '11 at 2:27
    
+1 This corrected my problem in a simple way. OF course the bug still exists as mention in the correct answer. –  Luis Alvarado Jun 16 '11 at 17:40
add comment
up vote 40 down vote accepted

@zpletan's answer lead to a bit of hunting around, which quickly unearthed what seems to be the root cause of my problem. It's detailed in Ubuntu Bug #574296. In summary, my Core i7 system with an SSD starts everything with sufficiently different timings that gnome-settings-daemon runs too early, bails, and leaves me mostly with a stock GTK theme.

A short sleep in /etc/xdg/autostart/gnome-settings-daemon.desktop fixes it:

Exec= bash -c "sleep 2; /usr/lib/gnome-settings-daemon/gnome-settings-daemon"
share|improve this answer
    
@Marco: Thanks for the edit. It didn't occur to me to link to the answer I referenced. –  Marcelo Cantos Jan 17 '11 at 16:40
    
It's fine! I just figured it would better increaser the validity of your answer :D –  Marco Ceppi Jan 17 '11 at 17:25
1  
+1, however I should note that this didn't work all the time for me (was sporadic)... see my answer below on how I got something that seems to work 100% of the time. –  TM. Jun 25 '11 at 21:00
add comment

Sorry but my previous suggestion of using '--sync' isn't a fix. Turns out after some restarts the problem is the same.

But hopefully, I managed to capture the following output from the crashing 'gnome-settings-daemon' process during startups when the theme fails to apply:

** (gnome-settings-daemon:1679): WARNING **: You can only run one xsettings manager at a time; exiting

** (gnome-settings-daemon:1679): WARNING **: Unable to start xsettings manager: Could not initialize xsettings manager.

When the theme is successfully applied, there is no output.

From this, looks like gnome-settings-daemon might be running two times somehow. Apparently, if the first instance completes before the second instance is run the theme will be applied else it will fail.

NOTE: The output capture was done by editing /etc/xdg/autostart/gnome-settings-daemon.desktop's 'Exec=' entry to "bash -c '/usr/lib/gnome-settings-daemon/gnome-settings-daemon --debug --sync &> /home/sanjeev/Desktop/test.txt'" (--sync option was used as recommended by some websites)

PS: Further tests, show that there is indeed two instance running which should run one after another.

Though the 'sleep' method might do, here's a more 'technically correct', if I may, solution to the problem. I have tried with 6 restarts and the following seems to work:

Step 1: Create a script (I called it gnome-settings-daemon-fix.sh) under /etc/xdg/autostart with the following:

#!/bin/bash
# gnome-settings-daemon-fix.sh

pid=`pgrep gnome-settings-`
wait pid

exit 0

Step 2: Edit 'gnome-settings-daemon.desktop' under 'Exec=' entry and replace it with:

Exec=bash -c 'bash /etc/xdg/autostart/gnome-settings-daemon-fix.sh ;/usr/lib/gnome-settings-daemon/gnome-settings-daemon'

Every thing's done. Basically, what we are doing is waiting for the first instance to exit before the second one is launched. Could anyone notify if this fixed their problem?

share|improve this answer
    
This is close, but it doesn't quite work for a couple of reasons. The biggest issue though is that the wait command won't work on another process. –  TM. May 16 '11 at 4:21
add comment

I had the very similar problem too. This was after a (IIRC partial) upgrade of my Natty Narwhal as it was on alpha 3 state. In my case, the ~/michael/.nautilus/browser.xml file seemed to be corrupted. After trying out some of the suggestions of this partial site I simply deleted this file, restarted my pc and all my themes were back and remained stable. I think, you can try to solve your problem like me.

share|improve this answer
add comment

I couldn't fix this problem with any of the suggested answers (the currently accepted answer worked sporadically, but usually did not work for me). I tried increasing the sleep time by a lot and it still wasn't working consistently.

However, one of the answers did point to a bug that tracks this issue, and I found a comment on the bug that solved it for me.

Here are the key bits:

First, create a bash script (I named it /etc/xdg/autostart/gnomesettingsdaemonfix.sh)

#!/bin/bash

pid=$(pgrep gnome-settings-)

while [ -n "$pid" ];
do
  pid=$(pgrep gnome-settings-)
  sleep 0
done

exit 0

Make sure it is executable (run chmod +x).

Then edit /etc/xdg/autostart/gnome-settings-daemon.desktop

Change the Exec line to:

Exec=bash -c '/etc/xdg/autostart/gnomesettingsdaemonfix.sh;/usr/lib/gnome-settings-daemon/gnome-settings-daemon'

That seems to have fixed it so far for me.

share|improve this answer
3  
+1 This seems like the better solution where instead of tweaking the sleep time, the race condition is actually addressed. –  mindless.panda Sep 15 '11 at 12:26
1  
Why has this bug not been fixed? If this simple check can fix the issue, why hasn't a patch been made? –  Luke has no name Nov 7 '11 at 22:29
add comment

This just worked for me in a terminal window:

echo "PATH=\"/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games\"" | tee -a ~/.profile
share|improve this answer
add comment

This happens to me occasionally with 11.04 Unity 3D and each time I cleared it by opening Appearance, Customize button, Icon tab and clicking on my chosen Icon set even though it was indicated as in use. In my case that would be Faenza-Dark. It happens so infrequently that I've yet to identify any sequence of events that causes this.

share|improve this answer
add comment

I had the same problem and I was getting an error in the begging: Could not apply the stored configuration for monitors.

Removed the file: ~/.config/monitors.xml re-logged and worked like a glove.

share|improve this answer
2  
This worked for me too! For readers, I think you should pay attention to this solution if you have recently modified (or modified and restored) your xconfig (/etc/X11/xorg.conf[.d]). –  Wolter Hellmund May 25 at 15:25
add comment

Here is one quick solution, go to your virtual console, stop gdm, start X server

  1. press "Right Ctrl + F1" (Ctrl + Alt + F1 is combination for non virtualised installations)
  2. log in
  3. type: sudo /etc/init.d/gdm stop
  4. type: startx

since this is my first post, i had to put images like this:

http://imgur.com/a/bi0xm#0

share|improve this answer
add comment

This happened to me as well and in my case, I had to nuke my entire home directory and then restore bits and pieces back in, per the answer here. If you are doing the timing scripts for gnome-settings-daemon, see if you can make it work properly by creating another account and logging in as that account. In my case, the 2nd account didn't have the non-start issue, and hence, I applied the fix in the link.

share|improve this answer
add comment

I have been looking for a fix for this issue for months. Apparently no one knows what causes it. This bug has existed for years and no one has fixed it.

Sometimes it happens during boot with a race condition between the first and second instances of gnome-settings-daemon, and sometimes it happens in the middle of a working desktop session when gnome-settings-daemon either stops functioning or crashes.

The only workaround I have found that seems to fix it is to type

killall gnome-settings-daemon
gnome-settings-daemon &

in a running terminal that I leave open.

Closing the terminal kills the background instance of gnome-settings-daemon and the desktop reverts to the default theme (not Ubuntu default but gnome default). Therefore I run the daemon it in the background and leave the terminal running too because the process needs its parent.

share|improve this answer
    
You can avoid keeping a terminal opening by running Run Application (Alt + F2), and giving it gksudo gnome-settings-daemon as its argument. –  vemv Jan 2 '13 at 20:56
add comment

I think there are quite a few people with the right idea.

My guess is that after certain updates (new kernels, etc) that ureadahead gets reprofiled. This is where I think the problem happens. gnome-settings-daemon gets called too soon.

I deleted all the files with 'pack' (pack, home.pack, boot.pack, run.pack) in the name in /var/lib/ureadahead/ folder to force a reprofile. Everything looked great after that.

When reprofiling, delete above files, reboot, and log in quickly as soon as you see the login screen. Wait about 30 seconds, or when the drive stops spinning before doing anything. Let it finish its business. Your nautilus window should look okay now.

Maybe a bug should be filed with ureadahead for putting gnome-settings-daemon out of order.

share|improve this answer
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.