Added System bars window

This commit is contained in:
soraefir
2023-11-21 19:19:09 +01:00
parent 8a833d1eb6
commit c58f0dceda
29 changed files with 201 additions and 1093 deletions

View File

@ -1,6 +1,6 @@
.calendar-win {
@include window;
background-color: $bg;
background-color: $bg1;
color: $fg;
padding: .2em;
}

View File

@ -19,13 +19,45 @@ color: $base0B;
.gpubar,
.membar,
.batbar {
background-color: $bg;
background-color: $bg0;
margin: $gaps-window 0;
}
.icon-text {
padding: 5pt;
font-size: 5pt;
font-weight: 900;
padding: 5pt;
font-size: 5pt;
font-weight: 900;
}
.cpu-core-usage, .gpu-core-usage {
background-color: $bg0;
border-radius: $border-radius;
padding: 2pt;
margin: 1pt;
}
.cpu-core-usage trough *, .gpu-core-usage trough * {
background-color: $base0C;
border-radius: $border-radius;
padding: 2pt;
}
.spacer {
color: $bg1;
padding: $gaps-window;
}
.sys-win {
margin: $gaps-screen;
}
.sys-win-sub {
@include window;
background-color: $bg1;
color: $fg;
padding: .5em;
margin: $gaps-window;
}

View File

@ -10,7 +10,6 @@
@include rounding;
}
@import 'css/sys';
@import 'css/net';
@import 'css/clock';
@ -48,7 +47,7 @@ tooltip {
}
.focused {
background-color: $bg;
background-color: $bg1;
border-radius: 1rem;
margin: .3rem;
padding: .25rem;
@ -63,7 +62,7 @@ tooltip {
border-right-style: none;
border-bottom-right-radius: 0;
border-top-right-radius: 0;
padding: 0 $gaps-window;
padding: $gaps-screen $gaps-window;
margin: $gaps-screen 0;
}

View File

@ -1,11 +1,11 @@
(include "./modules/workspaces.yuck")
(include "modules/workspaces.yuck")
(include "modules/sys.yuck")
(include "modules/net.yuck")
(include "modules/clock.yuck")
(include "./modules/sys.yuck")
(include "./modules/net.yuck")
(include "./modules/clock.yuck")
(include "./windows/calendar.yuck")
(include "windows/calendar.yuck")
(include "windows/sys.yuck")
(defwidget left []

View File

@ -5,34 +5,37 @@
(deflisten battery "scripts/sys/battery")
(defwidget sys []
(box
:class "module"
:orientation "v"
(circular-progress
:value {EWW_CPU.avg}
:class "cpubar"
:thickness 6
(label :class "icon-text" :text "C"))
(button
:onclick "${EWW_CMD} open --toggle sys"
(box
:class "module"
:orientation "v"
(circular-progress
:value {EWW_CPU.avg}
:class "cpubar"
:thickness 6
(label :class "icon-text" :text "C"))
(circular-progress
:value {gpu.devices[0].GRBM2.CommandProcessor-Graphics.value}
:class "gpubar"
:thickness 6
(label :class "icon-text" :text "G"))
(circular-progress
:value {gpu.devices[0].GRBM2.CommandProcessor-Graphics.value}
:class "gpubar"
:thickness 6
(label :class "icon-text" :text "G"))
(circular-progress
:value {memory.percent}
:class "membar"
:thickness 6
(label :class "icon-text" :text "M"))
(circular-progress
:value {100*memory.used/memory.total}
:class "membar"
:thickness 6
:tooltip "${memory.human.used} / ${memory.human.total}"
(label :class "icon-text" :text "M"))
(circular-progress
:value {battery.percentage}
:class "batbar"
:visible {battery.visible}
:style "color: ${battery.color};"
:thickness 6
(label :class "icon-text" :text "B"))
(circular-progress
:value {battery.percentage}
:class "batbar"
:visible {battery.visible}
:style "color: ${battery.color};"
:thickness 6
(label :class "icon-text" :text "B"))
)
)
)

View File

@ -8,7 +8,5 @@ human() {
free --si -s 3 | rg --line-buffered Mem | while read -r line; do
used=$(echo "$line" | awk '{print $3}')
perc=$(awk -v used="$used" -v total="$total" 'BEGIN{print sprintf("%.f", used/total*100)}')
echo '{"total": "'$(human "$total")'", "used": "'$(human "$used")'", "percent": '$perc'}'
echo '{"human": { "total": "'$(human "$total")'", "used": "'$(human "$used")'"}, "total": "'$total'" , "used": "'$used'"}'
done

View File

@ -0,0 +1,121 @@
(defwidget cpu-sys-win []
(box
:space-evenly false
:class "sys-win-sub"
(box
(for core in {EWW_CPU.cores}
(box
:space-evenly false
:class "cpu-core ${core.core}"
(progress
:value {core.usage}
:orientation "v"
:flipped true
:class "cpu-core-usage"
:tooltip "core${core.core} @ ${core.freq}Mhz"
)
)
)
)
(box :class "spacer" "")
(progress
:value {100*memory.used/memory.total}
:orientation "v"
:flipped true
:class "gpu-core-usage"
:tooltip "RAM"
)
)
)
(defwidget gpu-sys-win []
(box
:space-evenly false
:class "sys-win-sub"
(progress
:value {gpu.devices[0].GRBM2.CommandProcessor-Compute.value}
:orientation "v"
:flipped true
:class "gpu-core-usage"
:tooltip "Compute"
)
(progress
:value {gpu.devices[0].GRBM2.CommandProcessor-Fetcher.value}
:orientation "v"
:flipped true
:class "gpu-core-usage"
:tooltip "Fetcher"
)
(progress
:value {gpu.devices[0].GRBM2.CommandProcessor-Graphics.value}
:orientation "v"
:flipped true
:class "gpu-core-usage"
:tooltip "Graphics"
)
(box :class "spacer" "")
(progress
:value {gpu.devices[0].gpu_activity.GFX.value}
:orientation "v"
:flipped true
:class "gpu-core-usage"
:tooltip "GFX"
)
(progress
:value {gpu.devices[0].gpu_activity.Memory.value}
:orientation "v"
:flipped true
:class "gpu-core-usage"
:tooltip "Memory"
)
(progress
:value {gpu.devices[0].gpu_activity.MediaEngine.value}
:orientation "v"
:flipped true
:class "gpu-core-usage"
:tooltip "Media"
)
(box :class "spacer" "")
(progress
:value {100*gpu.devices[0].VRAM.TotalVRAMUsage.value/gpu.devices[0].VRAM.TotalVRAM.value}
:orientation "v"
:flipped true
:class "gpu-core-usage"
:tooltip "VRAM"
)
)
)
(defwidget ram-sys-win []
(box
:space-evenly false
:class "sys-win-sub"
)
)
(defwidget sys-win []
(box
:class "sys-win"
:space-evenly false
:orientation "v"
(box
:space-evenly false
:orientation "h"
(cpu-sys-win)
(gpu-sys-win)
)
)
)
(defwindow sys
:monitor 0
:geometry (geometry
:x "0%"
:y "0%"
:anchor "bottom right"
:width "0px"
:height "0px")
(sys-win))