feat(ags notifs): add blocked apps list
This commit is contained in:
parent
bbf96b34c5
commit
d5a9b24de1
3 changed files with 107 additions and 89 deletions
|
@ -73,7 +73,17 @@ const NotificationIcon = ({ appEntry, appIcon, image }) => {
|
|||
});
|
||||
};
|
||||
|
||||
export default ({ id, summary, body, actions, urgency, time, command = i => {}, ...icon }) => Draggable({
|
||||
export default ({ id, summary, body, actions, urgency, time, command = i => {}, ...icon }) => {
|
||||
const BlockedApps = [
|
||||
'Spotify',
|
||||
];
|
||||
|
||||
if (BlockedApps.find(app => app == Notifications.getNotification(id).appName)) {
|
||||
Notifications.close(id);
|
||||
return;
|
||||
}
|
||||
|
||||
return Draggable({
|
||||
maxOffset: 200,
|
||||
command: () => command(id),
|
||||
properties: [
|
||||
|
@ -163,3 +173,4 @@ export default ({ id, summary, body, actions, urgency, time, command = i => {},
|
|||
}),
|
||||
}),
|
||||
});
|
||||
};
|
||||
|
|
|
@ -61,12 +61,16 @@ const NotificationList = () => Box({
|
|||
.map(n => Notification({ ...n, command: i => Notifications.close(i), }));
|
||||
}
|
||||
else if (id) {
|
||||
box.add(Notification({
|
||||
const NewNotif = Notification({
|
||||
...Notifications.getNotification(id),
|
||||
command: i => Notifications.close(i),
|
||||
}));
|
||||
});
|
||||
|
||||
if (NewNotif) {
|
||||
box.add(NewNotif);
|
||||
box.show_all();
|
||||
}
|
||||
}
|
||||
|
||||
}, 'notified'],
|
||||
|
||||
|
|
|
@ -31,6 +31,9 @@ const Popups = () => Box({
|
|||
if (!id || Notifications.dnd)
|
||||
return;
|
||||
|
||||
if (! Notifications.getNotification(id))
|
||||
return;
|
||||
|
||||
box._map.delete(id);
|
||||
|
||||
box._map.set(id, Notification({
|
||||
|
|
Loading…
Reference in a new issue