WIP eww smarts

This commit is contained in:
Daniel Flanagan 2024-03-27 12:10:51 -05:00
parent 57f9e3deba
commit f514f5addc
2 changed files with 11 additions and 7 deletions

View file

@ -13,7 +13,7 @@
:x "0%" :x "0%"
:y "0%" :y "0%"
:width "100%" :width "100%"
:height "31px" :height "32px"
:anchor "bottom center") :anchor "bottom center")
(bar)) (bar))
@ -26,7 +26,7 @@
:x "0%" :x "0%"
:y "0%" :y "0%"
:width "100%" :width "100%"
:height "31px" :height "32px"
:anchor "bottom center") :anchor "bottom center")
(bar)) (bar))
@ -50,8 +50,8 @@
) )
{" " + round(EWW_CPU["avg"], 0) + "%"} {" " + round(EWW_CPU["avg"], 0) + "%"}
{" " + round(EWW_RAM["used_mem_perc"], 0) + "%"} {" " + round(EWW_RAM["used_mem_perc"], 0) + "%"}
{isDesktop == "true" ? "" : " " + brightness + "%"} {showBrightness == "true" ? "" : " " + brightness + "%"}
{isDesktop == "true" ? "" : "󱊣 " + EWW_BATTERY["BAT1"]["capacity"] + "%"} {showBattery == "true" ? "" : "󱊣 " + EWW_BATTERY["BAT1"]["capacity"] + "%"}
)) ))
(defwidget music [] (defwidget music []
@ -79,8 +79,13 @@
(defpoll time :interval "1s" (defpoll time :interval "1s"
"date '+%a %b %d %H:%M:%S'") "date '+%a %b %d %H:%M:%S'")
(defpoll isDesktop :interval "24h" (defpoll showBrightness :interval "24h"
"if [ -d \"$HOME/.config/lytedev-env/host-desktop\" ]; then echo true; else echo false; fi") ; if we have at least one file in /sys/class/backlight, we should try and show brightness
"if [ \"$(find /sys/class/backlight -mindepth 1 -maxdepth 1 | head -n 1 | wc -l)\" == \"1\" ]; then echo true; else echo false; fi")
(defpoll showBattery :interval "24h"
; if we have at least one battery in /sys/class/power_supply, we should try and show battery levels
"if [ \"$(find /sys/class/power_supply* -mindepth 1 -maxdepth 1 | grep '^BAT' | head -n 1 | wc -l)\" == \"1\" ]; then echo true; else echo false; fi")
(defpoll brightness :interval "10s" (defpoll brightness :interval "10s"
"echo $(((100 * $(brightnessctl get)) / $(brightnessctl max)))") "echo $(((100 * $(brightnessctl get)) / $(brightnessctl max)))")

View file

@ -79,7 +79,6 @@
env = [ env = [
"XCURSOR_SIZE,24" "XCURSOR_SIZE,24"
"EWW_BAR_MON,0"
]; ];
input = { input = {