3

I quite Unity but it seems like odd behaviour that clicking on the icon "focusses" the application instead of minimising it when it's already focussed.

htorque
  • 64,798
davbren
  • 609

2 Answers2

4

I've made a script to workaround this issue.
See this working here.

Instructions

1) We will need XDoTool and Compiz.

You can install these from the Ubuntu Software Center or by clicking here (xdotool) and here (Compiz)

2) Open Compiz (Alt + F2 and type ccsm and hit Enter)

3) Go to Commands and add ~/.minimize to one command:

enter image description here

4) Then go to Button Binding and make a shortcut for it.

enter image description here

5) Make a file named .minimize at your home folder (gedit ~/.minimize). Paste this and save:

#!/usr/bin/env python
# by desgua
# version 0.1.3 - May 06 2011
# To minimize with unity Launcher
##################################
import os
import wnck
import gtk
stream = os.popen("xdotool click --clearmodifiers 1")
screen = wnck.screen_get_default()

while gtk.events_pending():
    gtk.main_iteration()

windows = screen.get_windows()
active_app = screen.get_active_window().get_application()

for w in windows:
    if w.get_application() == active_app:
        w.minimize()

6) Make it executable (Here's how to do that).

7) Enjoy! ;-)

desgua
  • 32,917
2

No, it is not possible to minimize a focused application by clicking on the launcher icon in the launcher bar (= panel on the left).

When you do this, you initiate the "app expose" function, which will give you an overview of all running instances of the focused application. Eg., when a terminal is focused and you have four terminals opened, then clicking on the launcher would give you this:

This also happens with only one instance open - seems odd, but changing the click behavior for one use case would introduce (unwanted) inconsistency. However, I do not know if it's planned to fundamentally change all of this for Ubuntu 11.04.

htorque
  • 64,798