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



>>> Aha, what you want to do is connect to the screen's workspace-switched
>>> signal.
>>>
>>> global.screen.connect('workspace-switched', function() {
>>>      log('workspace switched!');
>>> });

Hi,

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
    }
});


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