Attached is a Python script to deal with the fact that minimized windows aren't shown in Compiz's Scale plugin. The script unminimizes these windows, launches Scale, and (when Scale is finished) returns the windows to their previously minimized state.
It can be initiated via a hot corner using the CompizConfig Settings Manager or via a launcher. You're on your own to set up a hot corner or launcher; I won't explain these options here. (But see post #9 below from hamidoo for some help on hot corners.) These options are relatively simple, but I don't use hot corners and the process of setting up a launcher is a little different in each of Gnome, KDE, and XFCE.
This script is an imperfect hack, largely due to the processor-intensive task of unminimizing multiple windows at once. Window contents are discarded when windows are minimized and it takes time to recreate the contents when windows are unminimized, so the script can be a bit slow. On the other hand, on my middle-of-the-road desktop I was able to listen to Pandora skip-free even when unminimizing a couple dozen windows at once, though it took a while.
Prerequisites
Make sure you have Scale and Dbus as enabled Compiz plugins (and optionally Scale Addons as well). One way to do so is through ccsm, the CompizConfig Settings Manager. Fire up a terminal window and type the following:
Code:
sudo apt-get install compizconfig-settings-manager
Then start ccsm to see what's enabled (you can use the "Filter" search box to help locate plugins):
Oh, and make sure Compiz is actually running, not some other window manager. (This has happened to me more than once.)
That out of the way, there are some dependencies that need to be met. To install them, type the following in a terminal:
Code:
sudo apt-get install wmctrl xwit python-wnck
Setup
Download the "scale.py" file attached below.
Make it executable. Make sure to do this! If the script doesn't work, the most likely cause is that permissions were not set properly. If you have saved it to your home directory as scale.py, type in a terminal:
Try it out:
Code:
If it works, consider hooking it up using a hot corner or a launcher, as mentioned above.
Configuration
Hot Corner Options--If you set this script up with a hot corner and attempt to activate the script using the hot corner while a previously activated instance of the script is already running, you have several possible behaviors to choose from. Look for the first use of the "hotCornerOption" variable in the script to configure your preference.
[0] (Default) First instance runs Scale with unminimizing windows. Second instance does nothing. (In other words, it continues to wait for user action to exit the first instance of Scale w/unminimized windows.)
[1] The instances alternate between Scale both with and without unminimizing windows, the first instance being Scale without unminimizing windows. (However, if there are no previously unminimized windows to choose from, the script unminimizes all windows.)
[2] The instances alternate between Scale both with and without unminimizing windows, the first instance being Scale with unminimizing windows.
Viewport Options--Scale can show the windows in the current viewport (the default) or all viewports; this script can be adjusted for either option. To change this, look for the command near the end of this script that begins 'org/freedesktop/compiz...', as follows:
Code:
'/org/freedesktop/compiz/scale/allscreens/initiate_key'
To have Scale show windows from all viewports, change the command as follows:
Code:
'/org/freedesktop/compiz/scale/allscreens/initiate_all_key'
Regardless of which approach you use, only the windows in the current viewport are (un)minimized. To (un)minimize windows from all viewports would be a dizzying experience due to the rapid viewport changing it would require.
Bugs
In addition to being a bit slow in general, on occasion if a window unminimizes well before its screen contents are drawn (i.e., it's initially a gray box and later gets filled in), the script may begin re-minimizing windows prematurely. The script's re-minimization functionality is triggered when it detects a window activation event that occurs after Scale has started; in some rare cases, the late-breaking screen-drawing is interpreted as this event, rather than a user selection of a window. The behavior manifests itself shortly after Scale launches: windows will begin rearranging and disappearing spontaneously. The script includes a short timer to help catch and stop this problem, but it's not foolproof. If you have problems, you can adjust the timer. Look for the first instance of "pluginDelay" variable in the script to address this if it's an issue for you.
This bug is most likely to occur when there are a large number of minimized windows running on a slow system. For instance, I encountered considerable problems on a fresh install of Kubuntu 8.10 beta, which suffered from some particularly bad nvidia performance issues. On a well-functioning install, I rarely if ever encounter this bug on a day-to-day basis, even on a low-powered eee 1000.
One other bug: If you escape out of Scale without choosing or closing (using the Scale Addon plugin) any windows or selecting the desktop, window re-minimization still will be pending. Reminimization is dependent upon some window being selected or closed before you exit Scale, or the desktop being selected; if you do none of these, reminimization will occur after Scale exits, when you click on an inactive window.
Finally, some Netbook Remix users may be unable to use this script out of the box. For these users, triggerring the script will often cause all windows to be immediately minimized. These users will need to uncomment the 'blackList' variable listed below. They may also need to 'sticky' a window (and preferrably make it reside under other windows) to achieve full functionality. Use of a screenlet such as ClockScreenlet can do the trick. See post #18 and subsequent posts for more.
Bookmarks