Advertisement
callmedante

Cinnamon Cardapio applet

Mar 16th, 2012
247
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. const Lang = imports.lang;
  2. const Applet = imports.ui.applet;
  3. const GLib = imports.gi.GLib;
  4. const Gettext = imports.gettext.domain('cinnamon-applets');
  5. const _ = Gettext.gettext;
  6.  
  7. function MyApplet(orientation) {
  8.     this._init(orientation);
  9. }
  10.  
  11. MyApplet.prototype = {
  12.     __proto__: Applet.IconApplet.prototype,
  13.  
  14.     _init: function(orientation) {
  15.         Applet.IconApplet.prototype._init.call(this, orientation);
  16.  
  17.         try {
  18.             this.set_applet_icon_name("start-here");
  19.             this.set_applet_tooltip(_("Cardapio menu"));
  20.         }
  21.         catch (e) {
  22.             global.logError(e);
  23.         }
  24.      },
  25.  
  26.     on_applet_clicked: function(event) {
  27.         GLib.spawn_command_line_async("cardapio show-near-mouse");
  28.     }
  29. };
  30.  
  31. function main(metadata, orientation) {
  32.     let myApplet = new MyApplet(orientation);
  33.     return myApplet;
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement