Advertisement
Guest User

really basic notification daemon

a guest
Jun 20th, 2014
293
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Vala 0.76 KB | None | 0 0
  1. [DBus (name="org.freedesktop.Notifications")]
  2. public class NotifyServer : Object {
  3.  
  4.     public NotifyServer() {
  5.     }
  6.    
  7.     public uint32 Notify(string app_name, uint32 replaces_id, string app_icon, string summary, string body, string[] actions, HashTable<string, Variant> hints, int32 expire_timeout) {
  8.        
  9.         return 0;
  10.     }
  11.  
  12. }
  13.  
  14.  
  15. int main(string[] args) {
  16.  
  17.     Bus.own_name(
  18.         BusType.SESSION,
  19.         "org.freedesktop.Notifications",
  20.         BusNameOwnerFlags.NONE,
  21.         (connection) => {
  22.             try {
  23.                 connection.register_object("/org/freedesktop/Notifications", new NotifyServer());
  24.             } catch (Error e) {
  25.                 warning(e.message);
  26.             }
  27.         },
  28.         () => {},
  29.         (connection, name) => {warning("Unable to acquire bus %s", name);}
  30.     );
  31.    
  32.     new MainLoop().run();
  33.    
  34.     return 0;
  35.  
  36. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement