Highlight Window with focus even more

Solution 1:

How about changing Unity decoration shadow for active window. This just example for Ambiance theme (same for Radiance).

  1. Change directory for easy tests

    cd /usr/share/themes/Ambiance/
    
  2. Change decoration (example: blue color)

    sudo nano gtk-3.0/apps/unity.css
    

    Original black active shadow

    UnityDecoration {
    ...
        -UnityDecoration-active-shadow-color: rgba (0, 0, 0, 0.75);
        -UnityDecoration-active-shadow-radius: 30px;
        -UnityDecoration-inactive-shadow-color: rgba (0, 0, 0, 0.3);
        -UnityDecoration-inactive-shadow-radius: 25px;
    ...
    }
    

    Now blue active shadow

    UnityDecoration {
    ...
        -UnityDecoration-active-shadow-color: rgba (0, 0, 255, 0.75);
        -UnityDecoration-active-shadow-radius: 30px;
        -UnityDecoration-inactive-shadow-color: rgba (0, 0, 0, 0.3);
        -UnityDecoration-inactive-shadow-radius: 25px;
    ...
    }
    

    You may change size(radius) and transparency too.

  3. Logout login.

    Unity active window with highlight shadow

As Serg commented below, the above method could be fine for limited number of themes as it needs manual change for each theme. Here is a better way using Compiz.

  1. Install Compiz manager

    sudo apt-get install compizconfig-settings-manager
    
  2. Run it ccsm, go Ubuntu Unity Plugin → Decorations tab

  3. Check Override theme settings then change Active window shadow as you like.

    Compiz - override Unity decoration shadow

Solution 2:

Introduction:

There exists accessibility extension for compiz called ADD Helper. The basic premise of that extension is to do the opposite of what you ask - dim inactive windows, while keeping active window normal. Below is the screenshot of ADD Helper in action:

enter image description here

Notice how the window on the right is dimmed, while the one on the left remains the same level of brightness and transparency. NOTE: I have tested this with dual screen setup and having full-screen windows on both monitors. Works perfectly in each case. Combined with user.dz's solution this is perfect combination for focusing active window.


Obtaining ADD Helper:

In order to enable this plugin you will need 2 things.

  1. Enable Universe repository: ADD helper belongs to Universe repository, so make sure it is checked in Software & Updates settings:

enter image description here

  1. Update and install required packages: You will need to have Compiz Config Settings Manager and compiz-plugins-extra. Run the following command to obtain them:

    sudo bash -c 'apt-get update && apt-get install compiz-plugins-extra compizconfig-settings-manager'
    

Configuring ADD Helper:

  1. Find Dim Inactive under Accessibility in CompizConfig Settings Manager. Check the checkbox.

enter image description here

  1. Click on the icon to open the menu. Under Bindings tab, set your desired shortcut ( default one doesn't seem to work properly) . Personally I use Ctrl+Alt+P but feel free to choose something else.

enter image description here

  1. Under Misc. Options tab, configure the amount of brightness and opacity you wish your window to have. Check "enable on startup" checkbox so that it starts every time you login. The setup that you see in my first screenshot is as follows:

    • Brightness 45
    • Saturation 45
    • opacity 75

enter image description here

At this point you can hit the keyboard shortcut that you have set to test it or try to logout/login.

Solution 3:

This delayed answer is intended to simplify the combined solution of @Serg and @user.dz, as well as to explain known issues and the workarounds.

Combined solution simplified

Ensure that main and universe repositories have been enabled (Default). If enabled later, run update by running sudo apt-get update.

  1. Install required packages (without extra plugins)

    sudo apt-get install compizconfig-settings-manager compiz-plugins-main
    
  2. Run CompizConfig Settings Manager (CCSM)

    ccsm
    
  3. Enable colored window border

    In CCSM, go to Desktop > Ubuntu Unity Plugin > Decorations

    Select checkbox for option "Override Theme Settings". For better visibility and matching colour, adjust these options: "Active window shadow radius" (suggested value: 20) and "Active window shadow color" (suggested opacity: 255; hexvalue: #FF3300).

  4. Enable ADD Helper

    In CCSM, go to Accessibility > Dim Inactive > Misc. Options

    First, select checkbox for option "Enable ADD Helper on start", then select checkbox for "Enable Dim Inactive". This way, plugin will be activated immediately without using keyboard shortcut.

  5. Reload Unity (if above steps had no effect when enabled)

    unity
    

Known issues and workarounds

The following are known issues and workarounds that I am aware of.

Matching colour is vivid and great, but all windows are highlighted with same border colour when using window spread feature (keyboard shortcut Super+W or similar).

Proof: BEFORE - Same border colour; AFTER - Replaced with dimmed shadow

This is noticeable when using "coloured window border" only (step 3). Use ADD Helper to replace the highlighted borders for all windows with dimmed shadow (step 4). Changing the border colour may not help much, so user should use both (step 3 and 4) for best experience.

Active window works better with ADD Helper, but the dimming transition is slowing down the system on my machine.

Proof: Self-explanatory for affected users

This is easy to alleviate. In CCSM, go to Effects and deselect plugins for Animation and Fading Windows. Disabling these effects will make the system be more responsive.

Changing theme from Ambiance (default) to Radiance (alternative), vice versa, will cause coloured window border to disappear at all.

Proof: BEFORE - Coloured border shown, AFTER - Coloured border disappeared

This is likely a limitation for overriding the theme settings. The method is not persistent between changes. Therefore, after changing the theme, reload Unity (step 5) to show the coloured window border. Slower machine may need to reload Unity more than one time to take effect properly.

I had purposedly included only links to screenshots for simplicity.

Even without these screenshots, users who followed the solution will understand the issues once they start using. For users who are not having these issues, they likely have good hardware support that allows to run Unity environment without hiccups.

Tested working with Unity 7.4.0 and Compiz 0.9.12.2 in Ubuntu 16.04.