added new widget "alhp"

This commit is contained in:
2025-03-23 16:40:30 +01:00
parent e95ed69a09
commit 2a6ae8fabc
5 changed files with 29 additions and 0 deletions

View File

@@ -69,6 +69,7 @@
:space-evenly false
:spacing 5
:halign 'end'
(alhp)
(hyprsunset)
(volume)
(datetime)

View File

@@ -8,3 +8,4 @@
@import 'widgets/sysmon.scss';
@import 'widgets/swaync.scss';
@import 'widgets/volume.scss';
@import 'widgets/alhp.scss';

View File

@@ -8,3 +8,4 @@
(include "widgets/sysmon.yuck")
(include "widgets/swaync.yuck")
(include "widgets/volume.yuck")
(include "widgets/alhp.yuck")

View File

@@ -0,0 +1,11 @@
.alhp{
&--good {
background: olivedrab;
color: white;
}
&--bad {
background: maroon;
color: white;
}
}

View File

@@ -0,0 +1,15 @@
(deflisten alhpNogo :initial '{"total": 0, "packages": []}' "alhp.utils -j")
(defwidget alhp []
(box
:class '${alhpNogo.total == 0 ? "alhp--good" : "alhp--bad"}'
:space-evenly false
:spacing 0
(tooltip
(box :orientation "vertical"
(for package in {alhpNogo.packages}
(box
:orientation "horizontal"
:space-evenly false
(label :text {package}))))
(label :text "${alhpNogo.total} "))))