Advertisement
Guest User

Untitled

a guest
Jun 25th, 2013
44
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.77 KB | None | 0 0
  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.TextApplet.prototype,
  13.  
  14. _init: function(orientation) {
  15. Applet.TextApplet.prototype._init.call(this, orientation);
  16.  
  17. try {
  18. let [res, out, err, status] = GLib.spawn_command_line_sync('echo Hello World');
  19. this.set_applet_label(out)
  20. }
  21. catch (e) {
  22. global.logError(e);
  23. }
  24. }
  25. };
  26.  
  27. function main(metadata, orientation) {
  28. let myApplet = new MyApplet(orientation);
  29. return myApplet;
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement