How do I configure Unity 2D?

There are several options to configure Unity 3D via "CompizConfig Settings Manager" respectively its "Ubuntu Unity Plugin".

But how do I access Unity 2D's settings?


If you are looking to configure Unity 3D see this question: How can I configure Unity?


Solution 1:

11.10 & above

Unity-3D and Unity-2D are visually very similar.

Unity 3D enter image description hereUnity 2D enter image description here

However, the underlying technology used to configure are very different.

Unity 3D uses a compiz plugin and you can use ccsm to configure.

Unity-2D configuration options are unfortunately not as advanced and involves tweaking a limited number of options in tools such as dconf & gconf-editor as well as changing the actual code base itself.

Note - you can use alternate compositing options - thus configuration options will change:

  • compiz
  • mutter
  • xfwm4

Changing Themes

Using the stock Appearance screen you can change the theme to the hard-coded themes.

enter image description here

If you want to use other GTK+ 3 (metacity) themes via a GUI you will need to use either MyUnity or gnome-tweak-tool Install gnome-tweak-tool.

How do I change to a theme not listed in the Appearance screen?

Alternatively - install the metacity theme and change the theme name using gconf-editor as described below.

changing fonts

By using MyUnity (installation instructions in the above theme link*) you can change fonts using:

enter image description here

desktop icons

By using MyUnity you can use the options shown in the image to add desktop icons

enter image description here

Form Factor

precise only

Unity-2D is used for computers that do not have 3D acceleration capabilities and/or have limited CPU/screen size etc.

You can configure Unity-2D to use by default desktop type settings or netbook type settings through dconf-editor

  • /com/canonical/unity-2d/form-factor: by default this value is desktop - by changing this to any value other than this (e.g. netbook), Unity-2D will default to non-desktop type values. An immediate visual indication of this is the Dash - any value other than desktop will open the dash full-screen.

Launcher configuration

  • Launcher hide action

precise

In 12.04 - the launcher is not hidden by default. You can set the autohide capability through the stock appearance screen.

enter image description here

From this tab you can configure where the launcher-hot spot is and thus how to invoke the launcher via the mouse.

For 11.10 and above, dconf can be used to modify the hiding action of the launcher.

dcom write /com/canonical/unity-2d/launcher/hide-mode [foo] where [foo] is the following values

  • 0: never hide, launcher always visible. dcom write /com/canonical/unity-2d/launcher/use-strut true must be used with this value

  • 1: auto hide; the launcher will disappear after a short time if the user is not interacting with it

  • 2: intellihide; the launcher will disappear if a window is placed on top of it and if the user is not interacting with it

  • Launcher Icon size

The launcher icon size can be changed by changing the launcher code.

  • moving icons - click and hold the icons to move launcher icons.

Dash

precise

The Dash can be now be easily maximised using the standard maximise/minimise window buttons.

The Dash opening configuration can be configured through a dconf-editor value: - /com/canonical/unity-2d/dash/fullscreen: ticking this value will open the dash fullscreen (default value is false)

oneiric By default the Dash opens half-screen. By changing the code-base you can configure the Dash to always open full-screen.

gconf-editor

Unity-2D uses metacity for its compositing manager - thus the options available to configure metacity through gconf-editor can be used to configure Unity-2D

Below is a summary of the values used to configure Unity-2D specifically. Other metacity options are also available to be changed through gconf-editor

  • /apps/metacity/general/auto_maximize_windows: Determines if windows should be automatically maximized when shown if they already cover most of the screen (default true)
  • /apps/metacity/general/num_workspaces: Number of workspaces. Must be more than zero, and has a fixed maximum to prevent making the desktop unusable by accidentally asking for too many workspaces.
  • /apps/metacity/general/theme: The theme determines the appearance of window borders, titlebar, and so forth (Default value Ambiance)
  • /apps/metacity/general/titlebar_font: A font description string describing a font for window titlebars (Default value Ubuntu Bold 11
  • /apps/metacity/global_keybindings/: various keyboard shortcuts can be defined. Pressing ALT+F2 and searching for keyboard and you can change most of these shortcuts via this GUI.
  • /apps/metacity/keybinding_commands/: various keyboard shortcuts can invoke applications such as gnome-screenshot
  • /apps/metacity/window_keybindings/: various keyboard shortcuts to control and manipulate windows and their movement. For example, moving windows from one workspace to another.

Solution 2:

For 12.04

Unity 2D supports quite a few options already. Having said that tweaking is (sadly) still a power user process. Here is a list of things you can do:

  • A) Change launcher colour, backlit mode and hiding mode
  • B) Rearrange the icons in the launcher and the indicators order at the panel
  • C) Enable opengl
  • D) More

The first thing you need to to is install dconf-editor. You can easily do that by starting a terminal and pasting the following command in it:

sudo apt-get install dconf-tools

After that, press ENTER, insert your password and wait for it to install. After it is installed open it. Now navigate to com => canonical => unity-2d: Unity-2D in Dconf-editor

Changing the value of form-factor will change the Dash mode. "desktop" means that the Dash will be on small screen mode and "netbook" means Dash will be on full screen mode. Ticking the checkbox "use-opengl" will allow unity-2d to use render graphics in opengl and not in raster engine. Navigating to "Dash" is useless, cuz that there is only one checkbox there - "Full screen" and you can already determine if you want the dash in small or full screen via "from-factor". Navgating to "Launcher" will allow you to choose select the launcher hide mode and also to select whether or not to use the super key. Switching the variable of "hide mode" allow you to select if you want the launcher to be:

  1. 0: Always Visible
  2. 1: Autohide
  3. 2: Intellhide (dodge windows)

You can easily rearrange the icons by clicking on icon holdoing, holding that and moving it :)

Altering the launcher colour and opacity requires editing the "Launcher.qml", however the file is located in different folders in Oneiric and Precise. If you are using oneiric: Hit ALT+F2 (or open a Terminal) and execute:

gksu gedit /usr/share/unity-2d/launcher/Launcher.qml

A text editor window will open with the file ready to edit. Navigate to section headed ‘rectangle‘ and change:

color: “#190318″

to

color: “$COLOUR”

where $COLOUR is whatever colour you like – fox example: pink оr green or #00ffcc.

If you are using Precise the Launcher.qml is located in /usr/share/unity-2d/shell/launcher so to edit it, you have to execute:

gksu gedit /usr/share/unity-2d/shell/launcher/Launcher.qml

Once it it you will have to navigate to chnage both "rectangle" and "Gnome Background" sections (Gnome Background) is just above rectangle. Here is a screenshot of a light yellow coloured launcher: enter image description here

Solution 3:

As of September 2011 - in 11.10, the "simple GUI for Unity-2D Settings" doesn't allow configuring most of the parameters - particularly the "Launcher Preferences" (dodge settings) are greyed out.

It seems the latest unity-2d doesn't use gconf, it uses "dconf":

sudo apt-get install dconf-tools
dconf list /com/canonical/unity-2d/launcher/

returns:

hide-mode
super-key-enable
use-strut

You can fix the launcher in place (and obstruct maximised windows from impinging on it by using):

dconf write /com/canonical/unity-2d/launcher/hide-mode 0
dconf write /com/canonical/unity-2d/launcher/use-strut true