Documentation
¶
Overview ¶
Package powerprofiles is the power-profiles-daemon client: the active profile, the available set, property-change ticks, and the cycle action.
Index ¶
Constants ¶
const ( ServiceName = "dev.stubbe.lys.PowerProfiles1" ServicePath = dbus.ObjectPath("/dev/stubbe/lys/PowerProfiles") )
lys-shell's own interface over the service, which `lys-shell power` drives (wayle-power-profiles/src/dbus).
const ( ProfilePowerSaver = "power-saver" ProfileBalanced = "balanced" ProfilePerformance = "performance" )
Profile names as the daemon spells them.
Variables ¶
This section is empty.
Functions ¶
func NextProfile ¶
NextProfile is helpers.rs's next_profile: the successor of current in the canonical order restricted to available (empty available means all three), falling back to balanced.
Types ¶
type Daemon ¶
type Daemon struct {
// contains filtered or unexported fields
}
Daemon is the dev.stubbe.lys.PowerProfiles1 object (PowerProfilesDaemon).
func (*Daemon) ListProfiles ¶
ListProfiles names the available profiles.
type Snapshot ¶
type Snapshot struct {
Available bool
Active string
Profiles []string
// PerformanceDegraded is the daemon's degradation reason ("" when
// performance is not degraded).
PerformanceDegraded string
}
Snapshot is one daemon state.
type Source ¶
type Source interface {
// Read collects the snapshot.
Read(ctx context.Context) (Snapshot, error)
// SetActive switches the profile.
SetActive(ctx context.Context, profile string) error
// Subscribe ticks on daemon property changes. The channel closes
// when ctx completes; stop terminates the listener.
Subscribe(ctx context.Context) (<-chan struct{}, func(), error)
}
Source is the module's seam.
type System ¶
type System struct {
// contains filtered or unexported fields
}
System reads the real daemon over the system bus.
func (*System) Read ¶
Read collects the snapshot; an absent daemon reads as unavailable with the canonical cycle available.