aboutsummaryrefslogtreecommitdiff
path: root/.config/awesome/ui/statusbar/panel/widgets/battery_bar.lua
diff options
context:
space:
mode:
Diffstat (limited to '.config/awesome/ui/statusbar/panel/widgets/battery_bar.lua')
-rw-r--r--.config/awesome/ui/statusbar/panel/widgets/battery_bar.lua60
1 files changed, 0 insertions, 60 deletions
diff --git a/.config/awesome/ui/statusbar/panel/widgets/battery_bar.lua b/.config/awesome/ui/statusbar/panel/widgets/battery_bar.lua
deleted file mode 100644
index c1466f4..0000000
--- a/.config/awesome/ui/statusbar/panel/widgets/battery_bar.lua
+++ /dev/null
@@ -1,60 +0,0 @@
-local qmath = require "quarrel.math"
-local qvars = require "quarrel.vars"
-local wibox = require "wibox"
-
-local battery_bar = wibox.widget {
- widget = wibox.container.place,
- forced_height = qvars.char_height,
- {
- {
- widget = wibox.container.constraint,
- width = qvars.char_width * 4,
- strategy = "exact",
- {
- widget = wibox.widget.textbox,
- text = "0%"
- },
- id = "text"
- },
- nil,
- {
- widget = wibox.container.margin,
- margins = {
- left = qvars.padding
- },
- {
- widget = wibox.container.place,
- {
- widget = wibox.widget.progressbar,
- max_value = 100,
- value = 0,
- forced_height = qvars.char_height / 4,
- shape = qvars.shape,
- background_color = qvars.colors.black,
- color = qvars.colors.red,
- }
- },
- id = "bar"
- },
- layout = wibox.layout.align.horizontal,
- -- expand = "outside"
- }
-}
-
-awesome.connect_signal("services::battery", function(capacity)
- local color = qmath.step_value(capacity, {
- { 0, "red" },
- { 20, "red" },
- { 40, "yellow" },
- { 60, "green" },
- { 80, "green" },
- { 100 }
- })
-
- battery_bar.widget.bar.widget.widget.color = qvars.colors[color]
- battery_bar.widget.bar.widget.widget.value = capacity
-
- battery_bar.widget.text.widget.text = capacity .. "%"
-end)
-
-return battery_bar