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
:orientation 'h'
:class 'left'
:space-evenly true
:space-evenly false
:spacing 5
:halign 'start'
(hypr_workspaces)

View File

@@ -1,19 +1,42 @@
.sysmon{
* {
border-radius: 0;
}
$border-middle: 1px solid black;
background: transparent;
color: black;
}
.danger{
.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{
color: red
}
.ram{
}
.ram{
background: tan;
}
.disk{
}
.disk{
background: mediumturquoise;
}
.cpu{
}
.cpu{
background: lightgreen;
}
.net{
}
.net{
background: plum;
}
}

View File

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