50

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

3
  • 2
    I'd say Ubuntu user interface was designed with the idea that clicking on a launcher icon manages multiple windows of that kind. So if you have for example multiple Terminal windows open, there is only one icon in the launcher, so it makes no sense to "minimize on click" because it is ambiguous which window should be minimized. Furthermore, clicking on this icon manages which window of that type to switch to, so that functionality gets lost if it is used for minimizing windows only.
    – darksky
    Oct 19, 2017 at 23:00
  • This is a matter of getting used to clicking the minimize icon in the top-left corner of windows.
    – darksky
    Oct 19, 2017 at 23:01
  • 1
    @darksky Dash to Dock has many customisations to deal this scenario. For example in my set up, left clicking minimises/restores the focussed window and mouse wheel cycles through all the windows.
    – pomsky
    Oct 19, 2017 at 23:17

7 Answers 7

104

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
4
  • I had to first do Solition 1 before be able to execute the command in Solution 2 as before that it was not working. Thanks!
    – Dimitar
    Jun 25, 2020 at 15:44
  • standart Ubuntu 20.04, fresh install, just installed yesterday, but I installed with minimum software, without video playes, audio playes and open office I don't know if that matters
    – Dimitar
    Jun 26, 2020 at 7:12
  • Unfortunately, the keyboard shortcut Super+number is not affected.
    – aviator
    May 25, 2022 at 17:28
  • 1
    Solution 2 should be the Solution 1. Sep 6, 2023 at 20:20
20

use this command. it will show preview if multiple windows are opened and minimize if single window open.

gsettings set org.gnome.shell.extensions.dash-to-dock click-action 'minimize-or-overview'
0
6

Most of the answers are valid but I found out that enabling click to minimize will result in no preview of the open instances of the app.

Alternatively you can use Shift+Mouse middle click to minimize a window.

Tested this on ubuntu 18.04.1

1
  • 1
    There is a "minimize or preview" options in dash-to-dock. With this setting, if there are multiple windows, it will show a preview and not minimize the window.
    – SaTa
    Sep 1, 2020 at 13:37
4

For UBUNTU 18.04:

  1. Install gnome tweak tool:

    sudo apt install gnome-tweak-tool
    
  2. Open Application centre

  3. Type "Dash to Dock"
  4. Install
  5. Open the tool and select behaviour > click action > minimize
1
  • 1
    Just to confirm, what is the need for installing gnome-tweak-tool?
    – Milan
    Feb 2, 2021 at 0:41
3

I will say that the best way is not to change the action to minimize. Just live it as it is. Instead, if you look at this Navigate to the "Behavior" tab and select "Minimize" in "Click action". Next to the click to action you will see a gear icon.

A new window should popup (Customize middle-click behavior) there you can see on the first option that Shift+Click already is set to minimize the window. So you can leave all default and when you want to minimize the do Shift+Click.

I recommend this because there are other post where people gets annoyed with the result after they change this behavior and then want to reverse it because this does not work properly when you have multiple windows open.

Here is a screenshot of the screen that I am referring to:https://i.stack.imgur.com/LqHzs.jpg

Step one Click on the settings next to the on button enter image description here

Step two click on the Behavior tab enter image description here

Step three click on the gear icon next to the Cycle through windows

enter image description here

Step four look at the first option that indicates to use Shift+Click enter image description here

Using this will allow you to get the functionality you desire without having the issue that other are complaining about when it come to multiple browser windows open.

Here is one of the comments that I found around the internet of issues when changing that behavior How to turn off on click minimize on dock option on Ubuntu 18.04?

1

For Ubuntu 23.04, this solution works:

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'

0

If anyone ends up here as I did looking for the answer for this for the Unity dock, what worked for me was: install Unity-tweak-tool, and then Launcher>Minimize single window applications on click

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .