diff --git a/tree/.config/eww/eww.yuck.tpl b/tree/.config/eww/eww.yuck similarity index 91% rename from tree/.config/eww/eww.yuck.tpl rename to tree/.config/eww/eww.yuck index 29ec6a7..6dc8376 100644 --- a/tree/.config/eww/eww.yuck.tpl +++ b/tree/.config/eww/eww.yuck @@ -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,15 +140,16 @@ (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" : - "battery-gauge" + 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 %}