Re: Help for an extension: Call a function when switch workspace in overview




2012/9/3 Amy <mathematical coffee gmail com>

The above signal fires whenever a workspace is switched, be it via the
overview, keybinding, etc.

If you only want your function to fire when the overview is open you
check whether the overview is visible with `Main.overview.visible`.

global.screen.connect('workspace-switched', function () {
    if (Main.overview.visible) {
        // your function
    }
});

Thanks! (Also @ Jasper St Pierre for correcting the place where to put the connect)
But in fact, now I found out calling the function every time the workspace switches is even more useful... :-)


Is there a way how to find out which connect events are available? I searched /usr/share/gnome-shell/* for a file including "workspace-switched", but found nothing.
Entering global.screen.connect in looking glass didn't help either, and unfortunately, I wasn't successful in finding the source code for global.screen (that's what I tried as a beginner.)

(Specific I would be interested in the events:
 * show overview
 * close a window through the hover x-Button in the overview)



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]