This repository has been archived on 2024-03-28. You can view files and clone it, but cannot push or open issues or pull requests.
dotfiles/os/linux/eww/eww.yuck

54 lines
1.5 KiB
Plaintext
Raw Normal View History

2023-05-09 20:19:26 -05:00
(defwidget bar []
(centerbox :orientation "h"
(sidestuff)
(box)
2023-05-11 10:32:36 -05:00
(music)))
(defwindow bar
2023-05-12 01:08:14 -05:00
:monitor 0
2023-05-11 10:32:36 -05:00
:stacking "fg"
:exclusive true
:geometry
(geometry
:x "0%"
:y "0%"
:width "100%"
:height "31px"
:anchor "bottom center")
(bar))
2023-05-09 20:19:26 -05:00
(defwidget sidestuff []
2023-05-11 10:32:36 -05:00
(box :class "sidestuff" :orientation "h" :space-evenly false :halign "start" :spacing 20
2023-05-09 20:19:26 -05:00
time
2023-05-11 10:32:36 -05:00
; TODO: idle inhibitor?
; TODO: get these to align properly?
2023-05-11 14:07:39 -05:00
(box :class "mic" (box :class {micMuted == "false" ? "live" : "muted"} {micMuted == "false" ? " " : " "}))
2023-05-11 10:32:36 -05:00
{"󰕾 " + volume}
2023-05-12 01:08:14 -05:00
{" " + round(EWW_CPU["avg"], 0) + "%"}
{" " + round(EWW_RAM["used_mem_perc"], 0) + "%"}
{" " + brightness + "%"}
{"󱊣 " + EWW_BATTERY["BAT0"]["capacity"] + "%"}
2023-05-11 10:32:36 -05:00
))
2023-05-09 20:19:26 -05:00
(defwidget music []
(box :class "music"
:orientation "h"
:halign "end"
:space-evenly false
{music != "" ? "${music}" : ""}))
(deflisten music :initial ""
"playerctl --follow metadata --format '{{ title }} by {{ artist }}' || true")
2023-05-11 14:07:39 -05:00
(deflisten volume :initial "0"
"pamixer --get-volume; pactl subscribe | grep sink --line-buffered | while read i; do pamixer --get-volume; done")
2023-05-09 20:19:26 -05:00
2023-05-11 14:07:39 -05:00
(deflisten micMuted :initial "false"
"pamixer --default-source --get-mute; pactl subscribe | grep source --line-buffered | while read i; do pamixer --default-source --get-mute; done")
2023-05-09 20:19:26 -05:00
2023-05-11 10:32:36 -05:00
(defpoll time :interval "1s"
"date '+%a %b %d %H:%M:%S'")
2023-05-12 01:08:14 -05:00
(defpoll brightness :interval "5s"
"echo $((100 * ($(brightnessctl get) / $(brightnessctl max))))")