12

I know that Ubuntu has a file hidden somewhere deep inside it that holds the old metacity values for changing the position of the menu buttons. My question is how can I do this WITHOUT Ubuntu Tweak in Ubuntu Classic?

"Why not use the thing that's already done?"

  • That thing was written by finding this file once then making a mental note of it to create a GUI to solve the problem, which is all fine and dandy.
  • I want to learn where this stuff is for myself because I like knowing how to do things from the command line. (Also, come on, how many times have you seen a dude in a coffee shop using the command line interface to mess with stuff?)
  • It could be helpful to note the directory for others because of installing other themes to gnome-classic (cough new macbuntu port cough)

I would also like to know if this is a text file that I may be able to change with vim, emacs, gedit, etc.

  • Canonical refuses to implement any option for this in 16.04, see this bug: "The window controls in Unity are on the left. It is not a setting, it's where the designers chose to place them. This will not change.". I personally find this incredibly obtuse, but, you get what you pay for. – Dan Dascalescu Sep 20 '16 at 23:11

2 Answers2

29

You can move buttons to the right with:

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

or, maybe better to twitch "close" button with "maximize" button:

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

And move them back to the left with:

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

To get the current settings, use:

gsettings get org.gnome.desktop.wm.preferences button-layout

See man gsettings for more info, and, as a bonus:

dconf Editor

In this case the changes are made in ~/.config/dconf/user file which is expected to be in the binary dconf (GVDB) database format. Only programs like dconf Editor or gsettings can safely edit this file.

More about:

Radu Rădeanu
  • 169,590
1

I found this question searching for a way to move buttons from left to right using for the whole system. I am using autologin-guess. So everyting the system get restarted this setting got lost.

Create a file /usr/share/glib-2.0/schemas/60_our-own.gschema.override with this content:

[org.gnome.desktop.wm.preferences]
button-layout=':minimize,maximize,close'

Then execute this command:

glib-compile-schemas /usr/share/glib-2.0/schemas/

Reboot your system.

cheche
  • 356
  • 2
  • 9