awesome-wm-widgets/_widgets/batteryarc-widget.md

77 lines
3.6 KiB
Markdown
Raw Normal View History

2018-09-15 23:33:42 +02:00
---
layout: page
---
# Batteryarc widget
2020-11-15 03:26:34 +01:00
[![GitHub issues by-label](https://img.shields.io/github/issues-raw/streetturtle/awesome-wm-widgets/batteryarc)](https://github.com/streetturtle/awesome-wm-widgets/labels/batteryarc)
This widget is more informative version of [battery widget](https://github.com/streetturtle/awesome-wm-widgets/tree/master/battery-widget).
2018-09-15 23:33:42 +02:00
2019-12-15 21:38:54 +01:00
Depending of the battery status it could look following ways:
2018-09-16 03:19:46 +02:00
2022-01-24 03:05:55 +01:00
- ![10_d](../awesome-wm-widgets/assets/img/widgets/screenshots/batteryarc-widget/10_d.png) - less than 15 percent
- ![10_c](../awesome-wm-widgets/assets/img/widgets/screenshots/batteryarc-widget/10_c.png) - less than 15 percent, charging
- ![20_d](../awesome-wm-widgets/assets/img/widgets/screenshots/batteryarc-widget/20_d.png) - between 15 and 40 percent
- ![20_c](../awesome-wm-widgets/assets/img/widgets/screenshots/batteryarc-widget/20_c.png) - between 15 and 40 percent, charging
- ![80_d](../awesome-wm-widgets/assets/img/widgets/screenshots/batteryarc-widget/80_d.png) - more than 40 percent
- ![80_c](../awesome-wm-widgets/assets/img/widgets/screenshots/batteryarc-widget/80_c.png) - more than 40 percent, charging
2018-09-15 23:33:42 +02:00
2019-12-15 21:38:54 +01:00
If a battery level is low then warning popup will show up:
2018-09-15 23:33:42 +02:00
2022-01-24 03:05:55 +01:00
![warning](../awesome-wm-widgets/assets/img/widgets/screenshots/batteryarc-widget/warning.png)
2018-09-15 23:33:42 +02:00
2019-12-15 21:38:54 +01:00
## Customization
It is possible to customize widget by providing a table with all or some of the following config parameters:
| Name | Default | Description |
|---|---|---|
2023-09-21 14:46:25 +02:00
| `font` | `Play 6` | Font |
2019-12-15 21:38:54 +01:00
| `arc_thickness` | 2 | Thickness of the arc |
| `show_current_level`| false | Show current charge level |
2020-05-24 20:16:06 +02:00
| `size`| 18 | Size of the widget |
2020-11-15 03:26:34 +01:00
| `timeout` | 10 | How often in seconds the widget refreshes |
2019-12-15 21:38:54 +01:00
| `main_color` | `beautiful.fg_color` | Color of the text with the current charge level and the arc |
2020-03-02 03:40:04 +01:00
| `bg_color` | `#ffffff11` | Color of the charge level background |
2020-05-24 20:16:06 +02:00
| `low_level_color` | `#e53935` | Arc color when battery charge is less that 15% |
| `medium_level_color` | `#c0ca33` | Arc color when battery charge is between 15% and 40% |
2020-06-12 21:52:51 +02:00
| `charging_color` | `#43a047` | Color of the circle inside the arc when charging |
2023-09-21 14:46:25 +02:00
| `warning_msg_title` | `Huston, we have a problem_` | Title of the warning popup |
| `warning_msg_text` | `Battery is dying` | Text of the warning popup |
2019-12-15 21:38:54 +01:00
| `warning_msg_position` | `bottom_right` | Position of the warning popup |
2023-09-21 14:46:25 +02:00
| `warning_msg_icon` | `~/.config/awesome/awesome-wm-widgets/batteryarc-widget/spaceman.jpg` | Icon of the warning popup |
| `enable_battery_warning` | true | Display low battery warning |
2020-12-01 15:03:04 +01:00
| `show_notification_mode` | `on_hover` | How to trigger a notification with the battery status: `on_hover`, `on_click` or `off` |
2022-04-15 23:19:56 +02:00
| `notification_position` | `top_left` | Where to show she notification when triggered. Values: `top_right`, `top_left`, `bottom_left`, `bottom_right`, `top_middle`, `bottom_middle`. (default `top_right`) |
2018-09-15 23:33:42 +02:00
2020-04-03 04:23:07 +02:00
## Requirements
This widget requires the `acpi` command to be available to retrieve battery and
power information.
2018-09-15 23:33:42 +02:00
## Installation
Clone repo, include widget and use it in **rc.lua**:
```lua
local batteryarc_widget = require("awesome-wm-widgets.batteryarc-widget.batteryarc")
...
s.mytasklist, -- Middle widget
{ -- Right widgets
layout = wibox.layout.fixed.horizontal,
...
2019-12-15 21:38:54 +01:00
--[[default]]
batteryarc_widget(),
--[[or customized]]
batteryarc_widget({
show_current_level = true,
2020-02-21 20:53:38 +01:00
arc_thickness = 1,
2019-12-15 21:38:54 +01:00
}),
}
...
2018-09-15 23:33:42 +02:00
```
## Troubleshooting
2020-11-15 03:26:34 +01:00
In case of any doubts or questions please raise an [issue](https://github.com/streetturtle/awesome-wm-widgets/issues/new).