How can I move all the window controls to the right (or left)?

Solution 1:

14.04

Short answer:

It seems that Canonical went the totalitarian way and ordered that users should not be allowed to change the buttons position (you can find more technical details of this change on the bottom of this post).

As for now the only way to have windows buttons on the right side in 14.04 is to switch from Unity to the Gnome Flashback session (what I personally recommend). More details on how to do that are presented below.

Switching to Gnome Flashback:

Open terminal and run the following commands:

sudo add-apt-repository universe
sudo apt-get update
sudo apt-get install gnome-session-flashback

Next logout and select Gnome Flashback session in login manager.

enter image description here

You can select between Metacity and Compiz managers. Metacity is more lightweight, however it lacks some effects. With Compiz you will get more similar experience to Unity. You can speed up Compiz by turning off animations plugin (use compizconfig-settings-manager).

While in Gnome Flashback session, to move buttons to the right open a terminal and enter this command:

gsettings set org.gnome.desktop.wm.preferences button-layout 'menu:minimize,maximize,close'

But I want to still use Unity:

As I wrote in technical details, Canonical hardcoded buttons position in their Unity plugin. Changing of this needs this plugin to be patched by some third-party programmers. As for now such a patch is not available. (When such a patch will be published, please edit this answer and post it here.)

Technical details of the change:

Unity uses Compiz as its window manager. They used Compiz plugin called GTK Window Decorator to draw window borders and titlebars. This plugin draws borders basing on the Metacity theme, which itself is highly configurable. That is why until 14.04 we had been changing Metacity settings in order to change buttons position [1].

Now they have resigned from using gtk-window-decorator and implemented window decoration right in their Unity Compiz plugin. They deliberately hardcoded buttons position on the left side and do not expose any position switch to the user, in order to maintain "consistent user experience", as they call it [2].

Solution 2:

12.04 until 13.10

from 12.04 and newer gconfeditor wont work use this:

gsettings set org.gnome.desktop.wm.preferences button-layout ':minimize,maximize,close'

14.04

@Piotr Jurkiewicz answer

Solution 3:

For Ubuntu 12.10 and lower.

  1. Open terminal
  2. Type: gconf-editor
  3. Go to Apps -> Metacity -> General
  4. Find: button_layout
  5. Change value to: menu:minimize,maximize,close

For Ubuntu 10.10 the string needs to be menu:minimize,maximize,close, with a comma in the end of the string.

Solution 4:

For 12.04 and 12.10

Unity

Run this command in a terminal:

gsettings set org.gnome.desktop.wm.preferences button-layout ":minimize,maximize,close"

Note that this will only change the position of the window controls of non-maximized windows. The maximized windows will continue to have their window controls on the left in title bar. To set the controls back to being on the left side:

gsettings set org.gnome.desktop.wm.preferences button-layout "close,minimize,maximize:"

GNOME-shell

gsettings set org.gnome.shell.overrides button-layout ":minimize,maximize,close"