View Single Post
Old 18th February 2012, 06:42 AM
Mystro256 Offline
Registered User
Join Date: Feb 2012
Location: Canada
Posts: 11
Question Help with gjs (Gnome Extension Development)

It seems I'm having issues with developing a gnome shell extension.

I'm trying to check if there is a battery/power menu, and if so use that menu instead of making a new one for placing extra options.
Unfortunately I don't seem to know a way to check for this. I figure if Main.panel._statusArea.battery._hasPrimary is true, it means there's a primary source, i.e. a power menu
...but the following code never executes the else condition no matter the value of _hasPrimary:
const Main = imports.ui.main;

//Some code

function enable() {
    if(Main.panel._statusArea.battery._hasPrimary == false)
         //If False statements
        //If True statements
Can anyone offer any help?

Last edited by Mystro256; 21st February 2012 at 09:16 PM. Reason: Added missing enable function for clarification
Reply With Quote