dotfiles/.config/eww/battery.yuck
2023-12-11 10:20:45 -06:00

45 lines
1.3 KiB
Plaintext

(defvar batt_close_hover false)
(defwindow battery
:geometry (geometry :x "0px"
:y "40px"
:width "200px"
:height "60px"
:anchor "bottom center")
:stacking "fg"
:monitor "0"
(battery))
(defwidget battery []
(box
:class "battery-container"
:orientation "h"
:vexpand "false"
:hexpand "false"
:space-evenly "false"
:spacing 5
(button
:class "battery-icon"
:onclick "" "󰂂")
(box
:orientation "v"
:space-evenly "false"
:vexpand "false"
:hexpand "false"
:spacing 5
(label
:class "battery-label"
:halign "start"
:text "Battery is at ${round(EWW_BATTERY['BAT1'].capacity, 0)}%, plug it in you dope.")
(scale
:class "battery-value"
:value {EWW_BATTERY["BAT1"].capacity}
:orientation "h"
:max 100
:min 0))
(button
:class "close-icon"
:onclick "echo \"killed\" > /tmp/ewwbattery && eww close battery"
"󰅖")))