updated alhp-scripts for eww

This commit is contained in:
2025-07-09 15:22:40 +02:00
parent 1e6ef2cd31
commit e421005de7
3 changed files with 12 additions and 13 deletions

View File

@@ -1,4 +1,7 @@
.alhp{ .alhp{
background: olivedrab;
color: white;
&--good { &--good {
background: olivedrab; background: olivedrab;
color: white; color: white;

View File

@@ -1,17 +1,14 @@
(defpoll alhpNogo (deflisten alhpNogo :interval "60s" "$HOME/.config/waybar/scripts/alhp.sh")
:interval "60s"
:initial '{"total": 0, "packages": []}' "alhp.utils -j")
(defwidget alhp [] (defwidget alhp []
(box (box
:class '${alhpNogo.total == 0 ? "alhp--good" : "alhp--bad"}' :class 'alhp--${alhpNogo.class}'
:space-evenly false :space-evenly false
:spacing 0 :spacing 0
(tooltip (tooltip
(box :orientation "vertical" (box :orientation "vertical"
(for package in {alhpNogo.packages}
(box (box
:orientation "horizontal" :orientation "horizontal"
:space-evenly false :space-evenly false
(label :text {package})))) (label :text {alhpNogo.tooltip})))
(label :text "${alhpNogo.total} ")))) (label :text "${alhpNogo.text} "))))

View File

@@ -10,15 +10,14 @@
(box (box
:class "workspaces" :class "workspaces"
:space-evenly false :space-evenly false
:height 20
:spacing 0 :spacing 0
(for workspace in workspaces (for workspace in workspaces
(eventbox (eventbox
:width 35 :width 40
:onclick "hyprctl dispatch workspace ${workspace.id}" :onclick "hyprctl dispatch workspace ${workspace.id}"
:cursor "pointer" :cursor "pointer"
:tooltip "${workspace.name}" :tooltip "${workspace.name}"
:class "workspaces--ws ${workspace.active == true ? 'workspaces--ws--active' : 'workspaces--ws--inactive'} ${workspace.name == 1 ? 'first' : workspace.name == 10 ? 'last' : 'middle'}" :class "workspaces--ws ${workspace.active == true ? 'workspaces--ws--active' : 'workspaces--ws--inactive'} ${workspace.name == 1 ? 'first' : workspace.name == 10 ? 'last' : 'middle'}"
(label (label
:class "workspaces--ws--label" :class "workspaces--ws--label"
:text "${workspace.name}${workspace.windows > 0 ? '+' : ''}"))))) :text "${workspace.windows > 0 ? ' ${workspace.windows}' : ''}")))))