feat(ags systray): add way to block systray items

This commit is contained in:
matt1432 2023-11-01 23:20:09 -04:00
parent 68962df0b8
commit 9e0841fff3

View file

@ -7,7 +7,11 @@ import Gtk from 'gi://Gtk';
import Separator from '../misc/separator.js';
const SysTrayItem = item => MenuItem({
const SysTrayItem = item => {
if (item.id === 'spotify-client')
return;
return MenuItem({
child: Revealer({
transition: 'slide_right',
child: Icon({
@ -19,7 +23,8 @@ const SysTrayItem = item => MenuItem({
btn.child.child.icon = item.icon;
btn.tooltipMarkup = item.tooltipMarkup;
}]],
});
});
};
const SysTray = () => {
const widget = Gtk.MenuBar.new();
@ -33,6 +38,10 @@ const SysTray = () => {
return;
const w = SysTrayItem(item);
// Early return if item is in blocklist
if (!w)
return;
widget._items.set(id, w);
widget.add(w);
widget.show_all();