Module src.awesome-battery_widget
A battery widget based on the UPower daemon.
Info:
- Copyright: 2020 Aire-One
- Author: Aire-One
Static functions
| battery_widget.has_upower | Check if the UPowerGlib module is available. |
| battery_widget.list_devices | Helper to get the path of all connected power devices. |
| battery_widget.get_device | Helper function to get a device instance from its path. |
| battery_widget.get_BAT0_device_path | Helper function to easily get the default BAT0 device path without. |
| battery_widget.to_clock | Helper function to convert seconds into a human readable clock string. |
Constructor
| battery_widget.new | battery_widget constructor. |
Object properties
| device | The device monitored by the widget. |
Signals
| upower::update | Emitted when the UPower device notify an update. |
Static functions
- battery_widget.has_upower line 32
- Check if the UPowerGlib module is available.
- battery_widget.list_devices line 39
- Helper to get the path of all connected power devices.
- battery_widget.get_device line 54
-
Helper function to get a device instance from its path.
Parameters:
- path string The path of the device to get.
- battery_widget.get_BAT0_device_path line 69
- Helper function to easily get the default BAT0 device path without.
- battery_widget.to_clock line 82
-
Helper function to convert seconds into a human readable clock string.
This translates the given seconds parameter into a human readable string following the notation
HH:MM(where HH is the number of hours and MM the number of minutes).Parameters:
- seconds number The umber of seconds to translate.
Constructor
- battery_widget.new line 122
-
battery_widget constructor.
This function creates a new
battery_widgetinstance. This widget watches thedisplay_devicestatus and report.Parameters:
- args The arguments table.
- widget_template widget The widget template to use to create the widget instance. (optional)
- device_path string Path of the device to monitor. (optional)
- use_display_device boolean Should the widget monitor the display device? (default false)
- instant_update boolean Call an update cycle right after the widget creation. (optional)
- args The arguments table.
Object properties
- device line 103
-
The device monitored by the widget.
Type:
- device UPowerGlib.Device
Signals
- upower::update line 108
-
Emitted when the UPower device notify an update.
Arguments:
- widget battery_widget The widget.
- device UPowerGlib.Device The Upower device.