Friday, August 5, 2011

Auto-Raise Chat and Other Windows in Ubuntu

It might be of benefit for 'someone', but the default behaviour that windows receiving an action are only highlighted in whatever task manager you use but not raised is quite senseless and annoying for most users.

Two examples:
  • You click on a link in your favorite mail client, and the respective website gets loaded in the web browser you use, but you need to find the blinking or whatever item of it in the task manager and click on it raise the browser window and finally get to the website. Of course, there are also multiple other ways to get to browser window.
  • You receive a message in your favorite instant messenger, but again, you need to find it in your task manager and click on it, or use any of the other ways to finally get to it. Quite annoying and also very easy to miss an incoming message.
So, this is where Compiz' "Window Rules" comes in handy. We can set up a rule where any window that has the "demandsattention" state, thus blinking or whatever in the task manager, is set above all other windows. Unfortunately, this doesn't give the window the focus, at least not per-se. We will come to this later again. And this also, obviously, won't get you automatically to windows that are on other workspaces. And in the case of chat windows, won't unminimize them when you minimized them before.

There we go now.

General

1. Install CompizConfig Settings Manager if not already installed:

sudo apt-get install compizconfig-settings-manager

2. Go to "System > Preferences > CompizConfig Settings Manager" in classic Gnome or search for its name in the Unity Dash and start and click on it.

3. Go to "Window Management > Window Rules" at the lower end of CCSM, click on it, then in the field "Above", type:

state=demandsattention


Obviously, also make sure this plugin is enabled.

4. Go to "Utility > Workarounds" right above of the previous section, click on it, and enable the option "Convert Urgency to Demands Attention". Now close CCSM.



Pidgin

These additional steps are for Pidgin only.

1. In the main Pidgin window, go to "Tools > Plugins" and enable "Message Notification".


2. Select "Message Notification" and click on "Configure Plugin" near the bottom of the window. Then just make sure 'Set window manager "URGENT" hint' is enabled. You may also want to adapt the other options to your needs.


Auto-focus

As promised above, here is a more or less workaround for getting the auto-raised windows the focus as well. And also, this is quite handy for not being rudely interrupted by a popping up chat window, as you are usually doing some other stuff and don't want to get it the focus right away.

For this, we will set Compiz to focus the window above which your mouse is, often called 'focus-follows-mouse'.

Therefore, open CompizConfig Settings Manager once again, go to "General Options" right at the top and click on it. Then under the tab "Focus & Raise Behaviour", disable the option "Click To Focus". That's all, you can close CCSM now.

Related Posts:

Compiz , Usability