Created
May 15, 2017 01:04
-
-
Save naddeoa/8cdad4f7fbca869906ac81deee1c3fed to your computer and use it in GitHub Desktop.
Minimal example of a gnome extension that just shows some text in the menu bar
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const St = imports.gi.St; | |
const Lang = imports.lang; | |
// UI specific components | |
const Main = imports.ui.main; | |
const PanelMenu = imports.ui.panelMenu; | |
const Indicator = new Lang.Class({ | |
Name: 'GnomeBitBarIndicator', // does this even matter? | |
Extends: PanelMenu.Button, | |
_init: function() { | |
this.parent(0.0, "GnomeBitBar", false); // does this even matter? | |
let text = new St.Label({ | |
text: "Foo" | |
}); | |
this.actor.add_actor(text); | |
} | |
}); | |
let menu; | |
function init() { | |
// One time startup initialization | |
} | |
function enable() { | |
menu = new Indicator(); | |
Main.panel.addToStatusArea('indicator', menu); | |
} | |
function disable() { | |
menu.destroy(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment