eww: Fix errors and warnings

This commit is contained in:
2024-07-26 11:21:24 +02:00
parent fce4839256
commit dcbdc4203c

View File

@ -70,7 +70,7 @@
(defwidget workspace [monitor n]
(button :visible {jq(workspaces, '.["${n}"] != null')}
:class 'workspace ${workspaces[n].active && monitor == workspaces[n].monitor ? "active" : ""}'
:class 'workspace ${workspaces?.[n]?.active == true && monitor == workspaces?.[n]?.monitor ? "active" : ""}'
:onclick 'wmutils switch-workspace ${n}'
(label :text n))
)
@ -140,14 +140,15 @@
(box :orientation "v"
:valign "end"
:class "thingy"
:visible {EWW_BATTERY != "" && EWW_BATTERY.BAT0.capacity != ""}
:visible {EWW_BATTERY != "" && EWW_BATTERY?.BAT0?.capacity != ""}
(label :text "BAT")
(circular-progress
:thickness 4.0
:value {EWW_BATTERY.BAT0.capacity}
:value {EWW_BATTERY != "" ? EWW_BATTERY?.BAT0?.capacity : 100.0}
:class {
EWW_BATTERY.BAT0.status == "Charging" ? "battery-gauge charging" :
EWW_BATTERY.BAT0.capacity < 15 ? "battery-gauge low" :
EWW_BATTERY == "" ? "" :
EWW_BATTERY?.BAT0?.status == "Charging" ? "battery-gauge charging" :
EWW_BATTERY?.BAT0?.capacity < 15 ? "battery-gauge low" :
"battery-gauge"
}
)
@ -229,16 +230,14 @@
(defpoll workspaces :interval "1s" "wmutils workspaces")
(defpoll volume_out :interval "1s" "pamixer --get-volume")
(defpoll is_muted :interval "1s" "pamixer --get-mute")
(defpoll color_scheme :interval "5s" "get-color-scheme")
(defpoll is_muted :interval "1s" :initial false "pamixer --get-mute")
(defpoll current_minute :interval "1s" "date +%M")
(defpoll current_hour :interval "1s" "date +%H")
(defpoll current_day :interval "60s" "date +%d")
(defpoll current_month :interval "60s" "date +%b")
(defpoll current_temp :interval "5s" "cat /sys/class/thermal/thermal_zone*/temp")
(defpoll color_scheme :interval "5s" "get-color-scheme")
{% if disablemullvad %}
(defvar vpn_status "{'icon': '-', 'class': 'disconnected'}" )
{% else %}
(defpoll vpn_status :interval "1s" "mullvad-status")
{% end %}