desktop notifications

主要範例

程式碼

#!/usr/bin/gjs

const Notify = imports.gi.Notify;

Notify.init('Hello world');

let notify = new Notify.Notification({
    summary: 'Hello world!',
    body: 'This is an example of notifications.',
    'icon-name': 'dialog-information'
});

notify.show();

Api

更多參考