power

package
v0.0.0-...-e81e7cf Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 30, 2020 License: GPL-3.0 Imports: 42 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Daemon

type Daemon struct {
	*loader.ModuleBase
	// contains filtered or unexported fields
}

func NewDaemon

func NewDaemon(logger *log.Logger) *Daemon

func (*Daemon) GetDependencies

func (d *Daemon) GetDependencies() []string

func (*Daemon) Start

func (d *Daemon) Start() error

func (*Daemon) Stop

func (d *Daemon) Stop() error

type Helper

type Helper struct {
	Notifications *notifications.Notifications

	Power         *libpower.Power // sig
	LoginManager  *login1.Manager // sig
	SensorProxy   *sensorproxy.SensorProxy
	SysDBusDaemon *ofdbus.DBus

	SessionManager *sessionmanager.SessionManager
	SessionWatcher *sessionwatcher.SessionWatcher
	ScreenSaver    *screensaver.ScreenSaver // sig
	Display        *display.Display
	// contains filtered or unexported fields
}

func (*Helper) Destroy

func (h *Helper) Destroy()

type LidSwitchHandler

type LidSwitchHandler struct {
	// contains filtered or unexported fields
}

func (*LidSwitchHandler) Destroy

func (h *LidSwitchHandler) Destroy()

func (*LidSwitchHandler) Start

func (h *LidSwitchHandler) Start() error

type Manager

type Manager struct {
	PropsMu sync.RWMutex
	// 是否有盖子,一般笔记本电脑才有
	LidIsPresent bool
	// 是否使用电池, 接通电源时为 false, 使用电池时为 true
	OnBattery bool
	//是否使用Wayland
	UseWayland bool
	// 警告级别
	WarnLevel WarnLevel

	// 是否有环境光传感器
	HasAmbientLightSensor bool

	// dbusutil-gen: ignore-below
	// 电池是否可用,是否存在
	BatteryIsPresent map[string]bool
	// 电池电量百分比
	BatteryPercentage map[string]float64
	// 电池状态
	BatteryState map[string]uint32

	// 接通电源时,不做任何操作,到显示屏保的时间
	LinePowerScreensaverDelay gsprop.Int `prop:"access:rw"`
	// 接通电源时,不做任何操作,到关闭屏幕的时间
	LinePowerScreenBlackDelay gsprop.Int `prop:"access:rw"`
	// 接通电源时,不做任何操作,到睡眠的时间
	LinePowerSleepDelay gsprop.Int `prop:"access:rw"`

	// 使用电池时,不做任何操作,到显示屏保的时间
	BatteryScreensaverDelay gsprop.Int `prop:"access:rw"`
	// 使用电池时,不做任何操作,到关闭屏幕的时间
	BatteryScreenBlackDelay gsprop.Int `prop:"access:rw"`
	// 使用电池时,不做任何操作,到睡眠的时间
	BatterySleepDelay gsprop.Int `prop:"access:rw"`

	// 关闭屏幕前是否锁定
	ScreenBlackLock gsprop.Bool `prop:"access:rw"`
	// 睡眠前是否锁定
	SleepLock gsprop.Bool `prop:"access:rw"`

	// 废弃
	LidClosedSleep gsprop.Bool `prop:"access:rw"`
	// 接通电源时,笔记本电脑盖上盖子是否睡眠
	LinePowerLidClosedSleep gsprop.Bool `prop:"access:rw"`
	// 使用电池时,笔记本电脑盖上盖子是否睡眠
	BatteryLidClosedSleep gsprop.Bool `prop:"access:rw"`

	// 接通电源时,不做任何操作,到自动锁屏的时间
	LinePowerLockDelay gsprop.Int `prop:"access:rw"`
	// 使用电池时,不做任何操作,到自动锁屏的时间
	BatteryLockDelay gsprop.Int `prop:"access:rw"`

	AmbientLightAdjustBrightness gsprop.Bool `prop:"access:rw"`
	// contains filtered or unexported fields
}

func (*Manager) GetInterfaceName

func (*Manager) GetInterfaceName() string

func (*Manager) Reset

func (m *Manager) Reset() *dbus.Error

type WarnLevel

type WarnLevel uint32
const (
	WarnLevelNone WarnLevel = iota
	WarnLevelLow
	WarnLevelCritical
	WarnLevelAction
)

func (WarnLevel) String

func (lv WarnLevel) String() string

type WarnLevelConfigManager

type WarnLevelConfigManager struct {
	UsePercentageForPolicy gsprop.Bool `prop:"access:rw"`

	LowTime      gsprop.Int `prop:"access:rw"`
	CriticalTime gsprop.Int `prop:"access:rw"`
	ActionTime   gsprop.Int `prop:"access:rw"`

	LowPercentage      gsprop.Int `prop:"access:rw"`
	CriticalPercentage gsprop.Int `prop:"access:rw"`
	ActionPercentage   gsprop.Int `prop:"access:rw"`
	// contains filtered or unexported fields
}

func NewWarnLevelConfigManager

func NewWarnLevelConfigManager(gs *gio.Settings) *WarnLevelConfigManager

func (*WarnLevelConfigManager) GetInterfaceName

func (*WarnLevelConfigManager) GetInterfaceName() string

func (*WarnLevelConfigManager) Reset

func (m *WarnLevelConfigManager) Reset() *dbus.Error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL