Ubuntu – How to enable ‘minimize on click’ on Ubuntu dock in 17.10 and later

gnome-shellminimizeubuntu-dock

I am talking about when you click on the icons in the dock

This command

gsettings set org.compiz.unityshell:/org/compiz/profiles/unity/plugins/unityshell/ launcher-minimize-window true

which works for Unity Launcher, (obviously) does not work.


Related to: Switching between windows with scroll wheel on Ubuntu Dock

Best Answer

It seems as Ubuntu Dock is a fork of the popular and highly customisable Dash to Dock, Ubuntu Dock obeys (some) preferences set by Dash to Dock.

See Solution 2 (CLI method) for the simplest fix.


Solution 1 (GUI method)

Follow the steps below.

  1. Go to Dash to Dock's homepage at extensions.gnome.org.
  2. Turn the extension on by clicking on the toggle button.
  3. Reload the page. It should look like this:
    enter image description here
  4. Click on the "settings" symbol next to the toggle button which now says "ON". A window should pop up.
  5. Navigate to the "Behaviour" tab and select "Minimise" in "Click action".
    enter image description here
  6. Close this window and come back to Dash to Dock's homepage.
  7. Click on the toggle button to deactivate Dash to Dock.
    enter image description here

Now clicking on the icons of running applications in Ubuntu Dock should minimise/restore the focussed application window.


Solution 2 (CLI method)

Open Terminal and run

gsettings set org.gnome.shell.extensions.dash-to-dock click-action 'minimize'

To revert to the default option, simply run

gsettings reset org.gnome.shell.extensions.dash-to-dock click-action

Alternative options: (may work only on newer Ubuntu Dock or Ubuntu versions)

  • To minimise when there is a single window of the application and show thumbnail previews if there more than one, run:

    gsettings set org.gnome.shell.extensions.dash-to-dock click-action 'minimize-or-previews'
    
  • To minimise when there is a single window of the application and show the Activities overview if there more than one, follow the answer by V T.

In general, run the following to see all possible permitted values

gsettings range org.gnome.shell.extensions.dash-to-dock click-action