feat: eww system status component

This commit is contained in:
hesam-init 2024-07-02 21:08:46 +03:30
parent 0323554224
commit d2c7b40f3c
5 changed files with 52 additions and 49 deletions

View file

@ -61,3 +61,20 @@
margin-bottom: 16px;
}
}
.system-status {
.progress {
color: $accent;
background-color: $surface1;
}
.icon {
border-radius: 100%;
background-color: $surface0;
label {
font-family: "Symbols Nerd Font";
font-size: get-token(font-sizes, extra);
}
}
}

View file

@ -68,25 +68,6 @@
margin: 5px;
}
.circiconcontain {
border-radius: 70px;
background-color: $surface0;
}
.circiconcontain label {
font-family: "Symbols Nerd Font";
font-size: 30px;
min-width: 1em;
min-height: 1em;
border-radius: 70px;
color: $white0;
}
.circsys {
color: $accent;
background-color: $surface1;
}
.revcal {
font-size: 13px;
}

View file

@ -3,6 +3,7 @@
(include "./src/-components/_helpers.yuck")
(include "./src/-components/_separator.yuck")
(include "./src/-components/_sliders.yuck")
(include "./src/-components/_stats.yuck")
(include "./src/-modules/_language.yuck")
(include "./src/-modules/_system-tray.yuck")

View file

@ -0,0 +1,21 @@
(defwidget SystemStatus [icon val]
(box
:class "system-status"
(overlay
(circular-progress
:halign "center"
:valign "center"
:class "progress"
:thickness 40
:value val)
(box
:class "icon"
:halign "center"
:valign "center"
:height 55
:width 55
(label :text icon)))
)
)

View file

@ -7,7 +7,7 @@
:vexpand true
(User)
(chooser)
(SystemMonitor)
; (weather)
; (MediaPlayer :h 160 :permashow true)
@ -144,18 +144,16 @@
))
))))
(defwidget sysinfo []
(revealer
:reveal reveal5
:transition "slideup"
(defwidget SystemMonitor []
(box
:orientation "h"
:class "panel-widget"
:height 140
(systat :icon "󰻠" :val { EWW_CPU.avg })
(systat :icon "󰍛" :val { EWW_RAM.used_mem_perc })
(systat :icon "󰈐" :val { gpu })
(systat :icon "" :val { EWW_BATTERY.BAT0.capacity })
)))
(SystemStatus :icon "󰻠" :val { EWW_CPU.avg })
(SystemStatus :icon "󰍛" :val { EWW_RAM.used_mem_perc })
(SystemStatus :icon "󰈐" :val { gpu })
(SystemStatus :icon "" :val { EWW_BATTERY.BAT0.capacity })
))
(defwidget wmslider [name val onchange max reset]
(box
@ -180,22 +178,7 @@
:style "padding: 0px 8px 0px 3px;"
"")))
(defwidget systat [icon val]
(overlay
(circular-progress
:halign "center"
:valign "center"
:class "circsys"
:thickness 40
:value val)
(box
:class "circiconcontain"
:halign "center"
:valign "center"
:height 55
:width 55
(label :text icon))))
(defwidget User []
(revealer