Selenium-H / Animation-Tweaks

A GNOME Shell Extension to Tweak animations and customize them
GNU General Public License v3.0
66 stars 9 forks source link

Notification and OSD Animation #2

Closed fdinardo closed 4 years ago

fdinardo commented 5 years ago

Hi, Thanks for this extension.

I am wondering if there is a way to edit the notification (like a new message received) and the OSD notification (like volume up/down) animations

Thanks

Selenium-H commented 5 years ago

Hi @fdinardo , I can't find any ways to edit them.

JasonLG1979 commented 4 years ago

I am wondering if there is a way to edit the notification (like a new message received) and the OSD notification (like volume up/down) animations

You could monkey patch the method that sends the notification and change it to whatever you want.

Basically:

const originalMethod = stuff.moreStuff.WhatEverMethod;

function enable() {
    // maybe do stuff?
    stuff.moreStuff.WhatEverMethod = monkeyPatch;
    // maybe do more stuff?
}

function disable() {
    // maybe do stuff?
    stuff.moreStuff.WhatEverMethod = originalMethod;
    // maybe do more stuff?   
}

function monkeyPatch(randomArg) {
    // Alter functionality.
    // may be even?
   // originalMethod(randomArg);
}

If the methods that handle the messages are signal handlers (they probably are) you can just disconnect the default handler and connect your own. Even if there's not a reference to the handler id you can find it with a combination of GObject.signal_parse_name and GObject.signal_handler_find. so you can disconnect the stock handler.

Selenium-H commented 4 years ago

Thanks @JasonLG1979 for explaining the process.

Notification and OSD animations are now implemented in new-version branch.

fdinardo commented 4 years ago

Hi, when this will be pushed to the extension website?

Selenium-H commented 4 years ago

@fdinardo, Sorry for the delay. I'll upload once version 10 is done. ( shortly ).