-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Notification support? #5
Comments
I prototyped a bit of the implementation of the System Tray Protocol Specification in 47dfad7, but it seems like any app I tried is not actually using this protocol. It may be that this specification is more commonly used. |
You must register bond-wm as a notification service with dbus. Alternatively, I was able to perform notification using xfce4-notifyd. But first it was necessary to run
Tested with ubuntu 22.04 xorg |
Maybe this can help: const dbus = require('dbus-native');
// Connection to the D-Bus system message
const systemBus = dbus.systemBus();
if (!systemBus) {
throw new Error('Could not connect to the DBus session bus.');
}
// Service name for the notify-daemon
const serviceName = 'org.freedesktop.Notifications';
// Object path for notifications
const objectPath = '/org/freedesktop/Notifications';
// Interface name for notifications
const interfaceName = 'org.freedesktop.Notifications';
// Getting a proxy to interact with the notifications service
const notifications = systemBus.getService(serviceName).getInterface(objectPath, interfaceName);
// Function to handle new notifications
function handleNotification(appName, summary, body) {
console.log('New notification:');
console.log('Application:', appName);
console.log('Summary:', summary);
console.log('Body:', body);
console.log('---');
}
// Subscribe to receive notifications
notifications.on('Notification', handleNotification);
// Define the error handling function
notifications.on('error', function(err) {
console.error('Error receiving notification:', err);
});
console.log('Waiting for notifications...');
// Keeps the process running
process.stdin.resume(); |
I believe that now with ChildWindow used in the Start Menu it is better to implement the notification UI |
Hello!
Do you intend to add notification support?
The text was updated successfully, but these errors were encountered: