summaryrefslogtreecommitdiff
path: root/.config/eww
diff options
context:
space:
mode:
authorbd <bdunahu@operationnull.com>2025-10-18 16:49:18 -0400
committerbd <bdunahu@operationnull.com>2025-10-18 16:49:18 -0400
commit4d6171844a8b6971c76be8054aa56b65685317fd (patch)
treeadbea5f22b8c6f6c3392cac5c049d5424f9ba770 /.config/eww
parentb5eaf56936b0620e0fb0f2f0d4bb12936f7f2445 (diff)
move tab-bar-global info to dedicated eww panel
Diffstat (limited to '.config/eww')
-rw-r--r--.config/eww/assets/raven.pngbin0 -> 5178 bytes
-rw-r--r--.config/eww/eww.scss102
-rw-r--r--.config/eww/eww.yuck18
-rw-r--r--.config/eww/pollers.yuck12
-rwxr-xr-x.config/eww/scripts/getvol9
-rwxr-xr-x.config/eww/scripts/update_workspaces34
-rw-r--r--.config/eww/widgets.yuck82
7 files changed, 257 insertions, 0 deletions
diff --git a/.config/eww/assets/raven.png b/.config/eww/assets/raven.png
new file mode 100644
index 0000000..6366d8a
--- /dev/null
+++ b/.config/eww/assets/raven.png
Binary files differ
diff --git a/.config/eww/eww.scss b/.config/eww/eww.scss
new file mode 100644
index 0000000..57568aa
--- /dev/null
+++ b/.config/eww/eww.scss
@@ -0,0 +1,102 @@
+*
+{
+ all: unset;
+}
+
+/* separator */
+
+.sepbar
+{
+ color: #D9E0EE;
+ font-family: Iosevka;
+ font-size: 12px;
+ margin-right: 5px;
+ margin-left: 5px;
+}
+
+/* bar */
+.bar
+{
+ background-color: rgba(#090011, 0.48);
+}
+
+/* time*/
+.time-cpu-mem
+{
+ margin-right: 15px;
+}
+.time-label
+{
+ color: #91d7e3;
+ font-family: Iosevka;
+ font-size: 12px;
+}
+
+/* mem cpu */
+.vol
+{
+ color: #6434ff;
+ background-color: rgba(#232323, 1.0);
+ border-radius: 0px;
+ margin-right: 6px;
+}
+.mem
+{
+ color: #ed8dff;
+ background-color: rgba(#232323, 1.0);
+ border-radius: 0px;
+}
+.cpu
+{
+ color: #606060;
+ background-color: rgba(#232323, 1.0);
+ border-radius: 0px;
+ margin-right: 6px;
+}
+.cpu-and-mem
+{
+ background-color: #181926;
+ border-radius: 0px;
+ margin-right: 0px;
+}
+
+/* workspaces */
+
+.active
+{
+ color: #ed8dff;
+}
+
+.workspaces
+{
+ padding-top: 5px;
+ font-size: 12px;
+}
+
+.mail
+{
+ color: #ed8dff;
+ font-family: Iosevka;
+ font-size: 12px;
+}
+
+.t1
+{
+ color: #c6a0f6;
+ font-family: Iosevka;
+ font-size: 12px;
+}
+
+.battery
+{
+ color: #a0a0a0;
+ font-family: Iosevka;
+ font-size: 12px;
+}
+
+
+.icon
+{
+ margin-left: -600px;
+ color: #7dc4e4;
+}
diff --git a/.config/eww/eww.yuck b/.config/eww/eww.yuck
new file mode 100644
index 0000000..f5011b6
--- /dev/null
+++ b/.config/eww/eww.yuck
@@ -0,0 +1,18 @@
+(include "pollers.yuck")
+(include "widgets.yuck")
+
+(defwindow bar
+ :monitor 0
+ :windowtype "dock"
+ :geometry (geometry :x "0%"
+ :y "0%"
+ :width "100%"
+ :height "25px"
+ :anchor "top center")
+ :reserve (struts :side "top" :distance "2.4%")
+ (bar))
+
+;; Local Variables:
+;; mode: scheme
+;; compile-command: "eww daemon --restart; eww open bar"
+;; End:
diff --git a/.config/eww/pollers.yuck b/.config/eww/pollers.yuck
new file mode 100644
index 0000000..bb5d521
--- /dev/null
+++ b/.config/eww/pollers.yuck
@@ -0,0 +1,12 @@
+(defpoll volume :interval "2s" "scripts/getvol")
+(defpoll time :interval "30s" "date '+%H:%M'")
+(defpoll date :interval "30s" "date '+%b %d'")
+(defpoll ws :interval "0.1s" "scripts/update_workspaces")
+(defpoll mail :interval "60s" "$HOME/.local/bin/mail-string")
+(defpoll t1 :interval "60s" "$HOME/.local/bin/t1-string")
+(defpoll batperc :interval "60s" "echo \"$(cat /sys/class/power_supply/BAT0/capacity)%\"")
+
+;; Local Variables:
+;; mode: scheme
+;; compile-command: "eww daemon --restart; eww open bar"
+;; End:
diff --git a/.config/eww/scripts/getvol b/.config/eww/scripts/getvol
new file mode 100755
index 0000000..9fbe60f
--- /dev/null
+++ b/.config/eww/scripts/getvol
@@ -0,0 +1,9 @@
+#!/bin/sh
+
+RUNNING_SINK=$(pactl list sinks | awk '
+ /^Sink #/ {sink=$2}
+ /State: RUNNING/ {print sink}
+' | head -n1)
+
+pactl list sinks | grep -A 20 "^Sink $RUNNING_SINK" | grep '^[[:space:]]Volume:' | \
+ head -n $(( $SINK + 1 )) | tail -n 1 | sed -e 's,.* \([0-9][0-9]*\)%.*,\1,'
diff --git a/.config/eww/scripts/update_workspaces b/.config/eww/scripts/update_workspaces
new file mode 100755
index 0000000..4fb1b1c
--- /dev/null
+++ b/.config/eww/scripts/update_workspaces
@@ -0,0 +1,34 @@
+#!/bin/sh
+
+gib_workspace_names() {
+ wmctrl -d \
+ | awk '{ print $1 " " $2 " " $9 }' \
+ | grep -v NSP
+}
+
+gib_workspace_yuck() {
+ buffered=""
+ gib_workspace_names | while read -r id active name; do
+ name="${name#*_}"
+ if [ "$active" == '*' ]; then
+ active_class="active"
+ else
+ active_class="inactive"
+ fi
+
+ if wmctrl -l | grep --regexp '.*\s\+'"$id"'\s\+.*' >/dev/null; then
+ button_class="occupied"
+ button_name="●"
+ else
+ button_class="empty"
+ button_name="○"
+ fi
+ buffered+="(button :class \"$button_class $active_class\" :onclick \"wmctrl -s $id\" \"$button_name\")"
+ echo -n "$buffered"
+ buffered=""
+ done
+}
+
+box_attrs=':orientation "h" :class "workspaces" :space-evenly false :halign "center" :valign "center" :vexpand false :spacing 8 '
+
+echo "(box $box_attrs $(gib_workspace_yuck))"
diff --git a/.config/eww/widgets.yuck b/.config/eww/widgets.yuck
new file mode 100644
index 0000000..2459550
--- /dev/null
+++ b/.config/eww/widgets.yuck
@@ -0,0 +1,82 @@
+(defwidget bar []
+ (box :class "bar"
+ :orientation "h"
+ (iconwidget)
+ (workspaces)
+ (power-time-cpu-mem)))
+
+(defwidget power-time-cpu-mem []
+ (box :class "time-cpu-mem"
+ :halign "end"
+ :valign "center"
+ :space-evenly "false"
+ :orientation "h"
+ (cpu-and-mem)
+ (sep)
+ (mailwidget)
+ (sep)
+ (t1widget)
+ (sep)
+ (batterywidget)
+ (sep)
+ (label :text "${date}, "
+ :class "time-label"
+ :halign "end"
+ :valign "center"
+ :tooltip "time")
+ (label :text time
+ :class "time-label"
+ :halign "end"
+ :valign "center"
+ :tooltip "time")))
+
+(defwidget cpu-and-mem []
+ (box :class "cpu-and-mem"
+ :orientation "h"
+ :halign "end"
+ :valign "center"
+ :space-evenly "false"
+ (circular-progress :class "vol"
+ :value volume
+ :thickness 6)
+ (circular-progress :class "cpu"
+ :value {EWW_CPU.avg}
+ :thickness 6)
+ (circular-progress :class "mem"
+ :value {EWW_RAM.used_mem_perc}
+ :thickness 6)))
+
+(defwidget batterywidget []
+ (label
+ :class "battery"
+ :text batperc))
+
+(defwidget t1widget []
+ (label
+ :class "t1"
+ :text "${t1}"))
+
+(defwidget mailwidget []
+ (label
+ :class "mail"
+ :text "${mail}"))
+
+(defwidget iconwidget []
+ (image
+ :path "assets/raven.png"
+ :class "icon"
+ :image-height 20
+ :preserve-aspect-ratio true))
+
+(defwidget workspaces []
+ (literal :content ws))
+
+(defwidget sep []
+ (box :orientation "h"
+ :valign "center"
+ (label :class "sepbar" :text "|")))
+
+;; Local Variables:
+;; mode: scheme
+;; compile-command: "eww daemon --restart; eww open bar"
+;; End: