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

View File

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