added more styling to sysmon

This commit is contained in:
2025-03-08 19:20:25 +01:00
parent e04868b5d0
commit 49987610cf
3 changed files with 52 additions and 29 deletions

View File

@@ -43,7 +43,7 @@
(box (box
:orientation 'h' :orientation 'h'
:class 'left' :class 'left'
:space-evenly true :space-evenly false
:spacing 5 :spacing 5
:halign 'start' :halign 'start'
(hypr_workspaces) (hypr_workspaces)

View File

@@ -1,19 +1,42 @@
.sysmon{ .sysmon{
* {
border-radius: 0;
}
$border-middle: 1px solid black;
background: transparent; background: transparent;
color: black; color: black;
.first {
border-radius: 1.5rem 0 0 1rem;
border-right: $border-middle;
}
.middle {
border-right: $border-middle;
}
.last {
border-radius: 0 1rem 1.5rem 0;
} }
.danger{ .danger{
color: red color: red
} }
.ram{ .ram{
background: tan; background: tan;
} }
.disk{ .disk{
background: mediumturquoise; background: mediumturquoise;
} }
.cpu{ .cpu{
background: lightgreen; background: lightgreen;
} }
.net{ .net{
background: plum; background: plum;
} }
}

View File

@@ -4,27 +4,27 @@
(box (box
:class 'sysmon' :class 'sysmon'
:space-evenly false :space-evenly false
:spacing 1 :spacing 0
(cpu) (cpu :class "first")
(ram) (ram :class "middle")
(disk) (disk :class "middle")
(net))) (net :class "last")))
(defwidget ram [] (defwidget ram [class]
(tooltip (tooltip
:class 'ram ${EWW_RAM.used_mem_perc > 90 ? 'danger' : ''}' :class 'ram ${EWW_RAM.used_mem_perc > 90 ? 'danger' : ''} ${class}'
(label :text " ${round(EWW_RAM.free_swap/1000000000, 2)} GB/${round(EWW_RAM.total_swap/1000000000, 2)} GB") (label :text " ${round(EWW_RAM.free_swap/1000000000, 2)} GB/${round(EWW_RAM.total_swap/1000000000, 2)} GB")
(label :text " ${round(EWW_RAM.used_mem/1000000000, 2)} GB/${round(EWW_RAM.total_mem/1000000000, 2)} GB"))) (label :text " ${round(EWW_RAM.used_mem/1000000000, 2)} GB/${round(EWW_RAM.total_mem/1000000000, 2)} GB")))
(defwidget disk [] (defwidget disk [class]
(tooltip (tooltip
:class 'disk ${EWW_DISK["/"].used_perc > 90 ? 'danger' : ''}' :class 'disk ${EWW_DISK["/"].used_perc > 90 ? 'danger' : ''} ${class}'
(label :text " ${round(EWW_DISK["/"].free/1000000000, 2)} GB /${round(EWW_DISK["/"].total/1000000000, 2)} GB") (label :text " ${round(EWW_DISK["/"].free/1000000000, 2)} GB /${round(EWW_DISK["/"].total/1000000000, 2)} GB")
(label :text " ${round(EWW_DISK["/"].used_perc,2)}%"))) (label :text " ${round(EWW_DISK["/"].used_perc,2)}%")))
(defwidget cpu [] (defwidget cpu [class]
(tooltip (tooltip
:class 'cpu' :class 'cpu ${class}'
(box :orientation "vertical" (box :orientation "vertical"
(for cpu in {EWW_CPU.cores} (for cpu in {EWW_CPU.cores}
(box (box
@@ -42,9 +42,9 @@
(label :text "${cpu.freq} Hz ${cpu.usage}%")))) (label :text "${cpu.freq} Hz ${cpu.usage}%"))))
(label :text " ${round(EWW_CPU.avg, 2)}%"))) (label :text " ${round(EWW_CPU.avg, 2)}%")))
(defwidget net [] (defwidget net [class]
(box (box
:class 'net' :class 'net ${class}'
:space-evenly false :space-evenly false
(label :text "") (label :text "")
(label :text " ${round(EWW_NET[netiface].NET_UP * 8 / 1000000, 2)} Mbit") (label :text " ${round(EWW_NET[netiface].NET_UP * 8 / 1000000, 2)} Mbit")