Improve ewwbar

This commit is contained in:
2024-05-09 12:58:52 +02:00
parent 3ceaf2c0ca
commit 8d88dc5cd8
2 changed files with 45 additions and 29 deletions

View File

@ -2,7 +2,7 @@
:monitor 0
:geometry (geometry :y "0%"
:x "3px"
:height "70%"
:height "90%"
:width "50px"
:anchor "center left")
:stacking "fg"
@ -17,7 +17,7 @@
:monitor 1
:geometry (geometry :y "0%"
:x "3px"
:height "70%"
:height "90%"
:width "50px"
:anchor "center left")
:stacking "fg"
@ -29,19 +29,20 @@
(defwidget middle []
(box :orientation "v"
:space-evenly false
:valign "center"
:space-evenly false
))
(defwidget bottom []
(box :orientation "v"
:space-evenly false
:valign "end"
:class "bottom"
:space-evenly false
(vpn)
(speaker)
(temperature)
(battery)
(box :class "boxed" (systray :orientation "v"))
(box :class "thingy" (systray :orientation "v"))
(date)
(clock)
))
@ -60,7 +61,7 @@
:onhover "${EWW_CMD} update show_volume=true"
:onhoverlost "${EWW_CMD} update show_volume=false"
(box :orientation "v"
:class "boxed volbox ${show_volume ? "active" : ""}"
:class "thingy volbox ${show_volume ? "active" : ""}"
:space-evenly false
(revealer :transition "slidedown"
:reveal show_volume
@ -81,7 +82,7 @@
(defwidget vpn []
(button :valign "end"
:class "vpn boxed ${vpn_status.class}"
:class "vpn thingy ${vpn_status.class}"
:onclick "${vpn_status.on_click}"
:tooltip "${vpn_status.tooltip}"
(label :text "${vpn_status.icon}")
@ -90,33 +91,35 @@
(defwidget temperature []
(box :orientation "v"
:valign "end"
:class "battery boxed"
:class "battery thingy"
(label :text "TMP")
(label :text "99C")
(label :text "${current_temp / 1000}C")
))
(defwidget battery []
(box :orientation "v"
:valign "end"
:class "battery boxed"
:class "thingy"
:visible {current_battery != ""}
(label :text "BAT")
(label :text "${current_battery}%")
))
(defwidget date []
(tooltip :class "boxed date" :halign "fill"
(tooltip :halign "fill"
(calendar :class "calendar")
(box :orientation "v" :hexpand true
(label :text current_month)
(label :text current_day)
)))
(button :onclick "ba gnome-calendar"
:hexpand true
:class "thingy date"
(box :orientation "v"
(label :text current_month)
(label :text current_day)
))))
(defwidget clock []
(box :orientation "v"
:valign "end"
:class "clock boxed"
:class "clock thingy"
(label :text current_hour)
(label :text current_minute)
))
@ -130,3 +133,4 @@
(defpoll current_day :interval "60s" "date +%d")
(defpoll current_month :interval "60s" "date +%b")
(defpoll current_battery :interval "15s" "cat /sys/class/power_supply/BAT0/capacity")
(defpoll current_temp :interval "5s" "cat /sys/class/thermal/thermal_zone*/temp")