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

@ -4,6 +4,7 @@ $highlight2: #679a8b;
$background: #23231b;
$lowlight1: black;
$lowlight2: #1d1f21;
$transparent: rgba(#000000, 0.0);
*{
all: unset;
@ -40,16 +41,23 @@ window {
margin-bottom: 10px;
}
.boxed {
.bottom {
background-image: linear-gradient(to right, $transparent 40%, $highlight1 40%, $highlight1 60%, $transparent 60% );
margin-bottom: 2px;
}
.thingy {
border: solid $highlight1 2px;
border-top: solid $highlight1 1px;
border-bottom: dotted $highlight1 6px;
border-bottom: solid $highlight2 3px;
//border-bottom: dotted $highlight1 6px;
color: $highlight1;
background: $lowlight1;
border-radius: 30px;
padding-top: 0.5em;
padding-bottom: 0.3em;
margin-top: 20px;
padding-bottom: 0.4em;
margin-top: 10px;
min-height: 20px;
}
scale trough {
@ -79,17 +87,12 @@ scale trough {
border-radius: 10px;
}
.battery {
margin-top: 20px;
padding-bottom: 0.6em;
}
.vpn {
font-size: 40px;
color: $highlight1;
border-color: green;
margin: 2px;
margin-top: 20px;
margin-top: -10px;
transition: all 0.2s;
}
@ -118,12 +121,21 @@ scale trough {
background: $lowlight2;
}
.date {
transition: all 0.2s;
}
.date:hover {
background-color: $lowlight2;
}
.date:active {
background-color: $highlight1;
}
.clock {
font-size: 30px;
font-weight: 400;
color: $highlight1;
margin-top: 20px;
margin-bottom: 20px;
margin-bottom: -1px;
}
.clock label {
padding: 0;

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")