View Single Post
  #1  
Old 18th February 2012, 05:42 AM
Mystro256 Offline
Registered User
 
Join Date: Feb 2012
Location: Canada
Posts: 6
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:
Code:
const Main = imports.ui.main;

//Some code

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

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