How do I make a Theme from scratch for Unity?
10.04 to 11.04
To avoid problems with a theme I create I start with another theme and then copy it over to a new name and use theme Equinox Evolution Midnight to create a new theme that I name Rinzwind. This avoids errors, crashes and notices about things not being present for this theme.
- create a new theme based of another theme
Themes are stored in /usr/share/themes/
:
Steps taken in this image:
- Open terminal and
cd /usr/share/themes/
sudo mkdir Rinzwind
cd Rinzwind
sudo cp -R /usr/share/themes/Equinox\ Evolution\ Midnight/* .
Inside the new directory is a file named index.theme
that needs to be changed to the new theme name. So after entering sudo gedit index.theme
change all the old theme names to the new one:
String, search and replace Equinox Evolution Midnight -> Rinzwind
IconTheme and CursorTheme I will keep for now but editing these 2 is almost the same as for this theme.
And now we have a new name for an old theme:
- Creating a new theme
Inside our new directory are 2 sets of images:
With an image editor (Gimp) you can change the colors or do various things on the images. Make sure to keep the same size of the image and of course use sane colors (stick to one color and 1 or 2 shades of this color to make a theme and not something that gives people instant headaches).
Recreate these 2 directories in your Pictures
folder by copying the theme to your Pictures
. I copied the 2 directories inside the theme and removed all directories that are not images with this as a result:
Open all the images inside gimp and start editing them and when you are satisfied copy them over with to your theme's directory and check if it works. Remark: since the theme is owned by root you need to use sudo to copy it over.
- What GIMP tutorials are available?
11.10 and above
Creating a theme for 11.10 and above (GTK+3) is fortunately very similar to 11.04 and previous versions of Ubuntu that used GTK+2. This answer is based on the already excellent answer from Rinzwind.
Its easier to amend an existing theme rather than to tackle a theme from scratch. In addition - its easier to edit a theme in your own local home folder - this avoids permissions issues etc.
Lets create a new theme that called foss based upon the Ambiance theme. Obviously - if you have any other GTK+3 themes installed, use those (see linked Q&A for where to get themes)
Install themes are stored in /usr/share/themes/
- local themes are stored in your home folder under the folder-name .themes
- Open terminal
- Create a local foss theme folder
mkdir -p ~/.themes/foss
cp -R /usr/share/themes/Ambiance/* ~/.themes/foss
Inside the new folder is a file named index.theme
that needs to be changed to the new theme name.
gedit ~/.themes/foss/index.theme
change all the old theme names to the new one.
And now we have a new name called foss:
Editing the new theme
Inside our new directory are two key folders - Unity and gtk-3.0:
With an image editor such as Pinta or Gimp you can change the colours or do various things on the images within those folders.
Make sure to keep the same size of the image and of course use sane colors (stick to one color and 1 or 2 shades of this color to make a theme).
Open all the images inside Pinta/Gimp and start editing them and when you are satisfied copy them over with to your theme's directory.
However - the main part of theme editing is changing the various .css files in those folders (and the subfolder Apps).
Cascading-Style-Sheets is a well-defined stylesheet language that changes the look and feel of associated objects - in our case a theme - but equally applies to HTML web pages and documents.
It isn't for the uninitiated to edit these - fortunately there are some very good tools to allow you to edit & preview CSS changes - see the linked Q&A below.
Once you are happy with your theme - set your theme via Ubuntu-Tweak
Unfortunately you cannot change themes via the standard Appearance screen - the themes there are hard-coded in 11.10 & 12.04.
Linked Questions:
- CSS editor with real-time preview and selector localization
- How do I install Ubuntu-Tweak?
- What GIMP tutorials are available?
- Is there a program like Microsoft Paint?
- Where to find great themes?