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?