forked from ro-ka/gnome-shell-permanent-notifications
-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathextension.js
24 lines (19 loc) · 831 Bytes
/
extension.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
/* -*- mode: js2; js2-basic-offset: 4; indent-tabs-mode: nil -*- */
import { Extension } from "resource:///org/gnome/shell/extensions/extension.js";
import * as MessageTray from "resource:///org/gnome/shell/ui/messageTray.js";
export default class PermanentNotificationExtension extends Extension {
constructor(metadata) {
super(metadata);
let tray = MessageTray.MessageTray.prototype;
tray.oldUpdateNotificationTimeout = tray._updateNotificationTimeout;
}
enable() {
MessageTray.MessageTray.prototype._updateNotificationTimeout = function(timeout) {
this._notificationTimeoutId = timeout ? 1 : 0;
};
}
disable() {
let tray = MessageTray.MessageTray.prototype;
tray._updateNotificationTimeout = tray.oldUpdateNotificationTimeout;
}
}