Name

sources, power.sources, kPMRPCPowerSources, kPMObservePowerSources — Known sources of power.

Synopsis

array of power source structures power.sources( );

Description

Known sources of power.

A computer may have multiple sources of power. Not all need be connected at any one time. Only major changes to power source state will trigger an observable update. This is a deliberate decision in order to reduce network traffic and avoid battery drain.

Returns

sources is an array of power source structures.

Observable

Changes to sources can be observed, without polling, using power.sources, kPMObservePowerSources.

Security

sources can be requested by any authenticated client.

Unauthenticated clients are authorized using the uk.co.dssw.powermanager.power.sources right. By default, any local process can request sources.

Availablility

pmdctl

Examples

Example 103. C: power.sources

CFMutableDictionaryRef myRequest = PMRequestCreate(kCFAllocatorDefault,kPMRPCPowerSources);


Example 104. Objective-C: power.sources

DSSWPMRequest* myRequest = [DSSWPMRequest requestWithRequest:kPMRPCPowerSources];


Example 105. AppleScript: power.sources

tell application "Power Manager Scripting"
    set myResult to sources of Power
end tell


Example 106. Shell: power.sources

./pmctl power.sources