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 use a Metacity theme in my Ubuntu installation. Unfortunately it isn't activated for programs with Gui that are started as root user and some other other certain programs like gufw (when i start gufw by commandline not as root)? It uses an old not very eyecandy Theme.

For example for Gufw is gives the following output on commandline:

/usr/share/themes/Finery/gtk-2.0/gtkrc:365: error: unexpected number `0', expected number (float)
/usr/share/themes/Finery/gtk-2.0/gtkrc:365: error: unexpected number `0', expected number (float)

What could be the reason, is there a way how to enable this theme also for these programs?

share|improve this question
add comment

4 Answers

up vote 6 down vote accepted

Themes you install via GNOME Appearance Settings reside in ~/.themes - your own home directory, where root won't be looking for them. You'll notice that themes that are installed system-wide (like ambiance/radiance) work fine, since those live in /usr/share/themes

To fix the issue, open your terminal and type

sudo ln -s ~/.themes /root/.themes

That way, root and your normal user will share the theme directory and everything will look the same.

share|improve this answer
    
does this covers also the theme customizations that you can change with GTK-Chtheme? –  NES Dec 29 '10 at 21:34
    
@NES: Probably not, since the customizations are stored in gconf2 settings database, and that is per-user storage. But at least all themes installed by user would be avaliable to root as well. And root can customize them (just open Appearance as root) –  MestreLion Jun 27 '11 at 13:57
add comment

Do a

$ sudo ln -s ~/.themes /root

This symlinks your theme directory so it can be used by the superuser account. Now any application run as root (or sudo/gksudo) will use your selected theme.

share|improve this answer
    
does this covers also the theme customizations that you can change with GTK-Chtheme? –  NES Dec 29 '10 at 21:33
    
that command will link your theme folder to root's home folder. That will NOT work! –  MestreLion Jun 27 '11 at 13:58
    
Also, when you are creating symlinks you should provide full paths. A good tip is to use ln -s 'readlink -f ./relative/path' /desired/symlink/path where the single quotes around the readlink command should be backticks (couldn't find a way to override them). The readlink -f command gets the absolute path of a given reachable relative path. –  Wolter Hellmund Oct 29 '11 at 8:50
add comment

Found a solution.

  1. Open HOME folder
  2. Show hidden files
  3. Make a link for the .theme folder
  4. Open Nautilus as root - ALT + F2 then enter GKSU NAUTILUS
  5. Navigate to Root Home folder
  6. Show hidden files
  7. Move link to .theme folder into Root Home folder
  8. Rename folder to .theme

close Root Nautilus and re-open

Or

Open terminal:

sudo ln -s ~/.fonts /root/.fonts  

sudo ln -s ~/.icons /root/.icons

sudo ln -s ~/.themes /root/.themes
share|improve this answer
add comment

First you have to make sure your theme and icon theme is in the "/usr/share/themes/" and "/usr/share/icons/" directory. You can do this by:

sudo cp -r /home/jeroen/.themes/YOURTHEME/ /usr/share/themes/
sudo cp -r /home/jeroen/.icons/YOURICONTHEME/ /usr/share/icons/


Change YOURTHEME/YOURICONTHEME to the theme/icontheme you want root programs to use. If you want to make all icons/themes availlable for root use:

sudo cp -r /home/jeroen/.themes/*/ /usr/share/themes/
sudo cp -r /home/jeroen/.icons/*/ /usr/share/icons/


Then open gnome-appereance manager as root. Type in terminal:

sudo gnome-appearance-properties

Choose the theme of your choosing and from now on all programs excecuted as root will use that theme.

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.