forked from QubesOS/qubes-desktop-linux-kde
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathqubes-systray.js
36 lines (33 loc) · 1.06 KB
/
qubes-systray.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
25
26
27
28
29
30
31
32
33
34
35
36
var biggestId = 0;
var tmpBiggestId = 0;
for (var i in activityIds) {
var activity = activityById(activityIds[i]);
if (activity.widgetIds.length > 0) {
tmpBiggestId = Math.max.apply(null, activity.widgetIds);
if (tmpBiggestId > biggestId) {
biggestId = tmpBiggestId;
}
}
}
for (var i in panelIds) {
var panel = panelById(panelIds[i]);
if (panel.widgetIds.length > 0) {
tmpBiggestId = Math.max.apply(null, panel.widgetIds);
if (tmpBiggestId > biggestId) {
biggestId = tmpBiggestId;
}
}
}
for (var i in panelIds) {
var panel = panelById(panelIds[i]);
for (var j in panel.widgetIds) {
var widget = panel.widgetById(panel.widgetIds[j]);
if (widget.type == "systemtray") {
widget.writeConfig('DefaultAppletsAdded', 'true')
widget.currentConfigGroup = new Array('Applets', biggestId+1);
widget.writeConfig('plugin', 'battery');
widget.reloadConfig();
}
}
}
panels()[0].addWidget("org.kde.notifications")