@@ -31,13 +31,13 @@ writeText "widgets.yuck" ''
3131 :space-evenly false
3232 (box
3333 :hexpand true
34- :visible { header-left != "" ? "true" : "false" }
34+ :visible { header-left != "" }
3535 :orientation "h"
3636 :spacing 5
3737 :halign "fill"
3838 :space-evenly false
3939 (label :class "header"
40- :visible { header-left != "" && header-left != "null" ? "true" : "false" }
40+ :visible { header-left != "" && header-left != "null" }
4141 :text header-left
4242 :halign "start")
4343 (eventbox
@@ -53,7 +53,7 @@ writeText "widgets.yuck" ''
5353 )
5454 )
5555 (label :class "header"
56- :visible { header-right != "" && header-right != "null" ? "true" : "false" }
56+ :visible { header-right != "" && header-right != "null" }
5757 :text header-right
5858 :hexpand "true"
5959 :limit-width 35
@@ -64,7 +64,7 @@ writeText "widgets.yuck" ''
6464 :spacing 5
6565 :space-evenly false
6666 (eventbox
67- :active { icon-onclick != "" && icon-onclick != "null" ? "true" : "false" }
67+ :active { icon-onclick != "" && icon-onclick != "null" }
6868 :visible {image != "" || icon != "" || app_icon != ""}
6969 :onclick icon-onclick
7070 :height 24
@@ -75,8 +75,7 @@ writeText "widgets.yuck" ''
7575 (image
7676 :class "icon"
7777 :visible { image == "" }
78- :path {image ?: ""}
79- :icon {icon != "" ? icon : app_icon != "" ? app_icon : "" }
78+ :icon {icon != "" ? icon : app_icon != "" ? app_icon : "icon-missing" }
8079 :image-height 24
8180 :image-width 24
8281 :style {app_icon != "" ? "opacity: '' ${level == 0 || level == min ? "0.5" : "1"}" : ""}
@@ -94,7 +93,7 @@ writeText "widgets.yuck" ''
9493 :max 100
9594 :min { min ?: 0 }))
9695 (eventbox
97- :visible { settings-onclick != "" && settings-onclick != "null" ? "true" : "false" }
96+ :visible { settings-onclick != "" && settings-onclick != "null" }
9897 :onclick settings-onclick
9998 :height 24
10099 :width 24
@@ -110,7 +109,7 @@ writeText "widgets.yuck" ''
110109 (box :orientation "v" :space-evenly "false" :spacing 0
111110 (box
112111 :hexpand true
113- :visible { header-left != "" ? "true" : "false" }
112+ :visible { header-left != "" }
114113 :orientation "h"
115114 :spacing 5
116115 :halign "fill"
@@ -119,14 +118,14 @@ writeText "widgets.yuck" ''
119118 :halign "start"
120119 :hexpand true
121120 :active { header-onclick != "" && header-onclick != "null" }
122- :visible { header-left != "" ? "true" : "false" }
121+ :visible { header-left != "" }
123122 :onclick header-onclick
124123 :height 24
125124 :width 24
126125 :class "default_button"
127126 (box :orientation "h" :space-evenly "false" :spacing 5 :halign "fill"
128127 (label :class "header"
129- :visible { header-left != "" && header-left != "null" ? "true" : "false" }
128+ :visible { header-left != "" && header-left != "null" }
130129 :text header-left
131130 :halign "start")
132131 (image
@@ -136,7 +135,7 @@ writeText "widgets.yuck" ''
136135 )
137136
138137 (label :class "header"
139- :visible { header-right != "" && header-right != "null" ? "true" : "false" }
138+ :visible { header-right != "" && header-right != "null" }
140139 :text header-right
141140 :hexpand "true"
142141 :limit-width 35
@@ -155,7 +154,7 @@ writeText "widgets.yuck" ''
155154 :spacing 5
156155 :space-evenly false
157156 (eventbox
158- :active { icon-onclick != "" && icon-onclick != "null" ? "true" : "false" }
157+ :active { icon-onclick != "" && icon-onclick != "null" }
159158 :visible {image != "" || icon != "" || app_icon != ""}
160159 :onclick icon-onclick
161160 :height 24
@@ -166,8 +165,7 @@ writeText "widgets.yuck" ''
166165 (image
167166 :class "icon"
168167 :visible { image == "" }
169- :path {image ?: ""}
170- :icon {icon != "" ? icon : app_icon != "" ? app_icon : "" }
168+ :icon {icon != "" ? icon : app_icon != "" ? app_icon : "icon-missing" }
171169 :image-height 24
172170 :image-width 24
173171 :style {app_icon != "" ? "opacity: '' ${level == 0 || level == min ? "0.5" : "1"}" : ""}
@@ -185,7 +183,7 @@ writeText "widgets.yuck" ''
185183 :max 100
186184 :min { min ?: 0 }))
187185 (eventbox
188- :visible { settings-onclick != "" && settings-onclick != "null" ? "true" : "false" }
186+ :visible { settings-onclick != "" && settings-onclick != "null" }
189187 :onclick settings-onclick
190188 :height 24
191189 :width 24
@@ -206,6 +204,7 @@ writeText "widgets.yuck" ''
206204 :hexpand false
207205 :space-evenly false
208206 (slider_with_children
207+ :visible { audio_output != "" }
209208 :class "qs-slider"
210209 :header-left {audio_output.friendly_name =~ '.*sof-hda-dsp.*' ? "Built-in '' ${audio_output.device_type}" :
211210 audio_output.friendly_name}
@@ -225,7 +224,7 @@ writeText "widgets.yuck" ''
225224 (volume_mixer :visible {arraylength(audio_streams) > 0})
226225 ))
227226 (slider_with_children
228- :visible { audio_input.state == "RUNNING" }
227+ :visible { audio_input != "" && audio_input .state == "RUNNING" }
229228 :class "qs-slider"
230229 :header-left {audio_input.friendly_name =~ '.*sof-hda-dsp.*' ? "Built-in '' ${audio_input.device_type}" :
231230 audio_input.friendly_name }
@@ -238,6 +237,7 @@ writeText "widgets.yuck" ''
238237 :level { audio_input.is_muted == "true" ? "0" : audio_input.volume_percentage }
239238 :onchange "${ ewwScripts . eww-audio } /bin/eww-audio set_source_volume '' ${audio_input.device_index} {} &"
240239 (audio_input_selector)
240+ (label :text "Placeholder" :visible false)
241241 )
242242
243243 (slider
@@ -316,7 +316,7 @@ writeText "widgets.yuck" ''
316316 :class "qs-slider"
317317 :header-left {entry.name}
318318 :level {entry.muted == "true" ? "0" : entry.level}
319- :app_icon {entry.icon_name != "" ? entry.icon_name : ""}
319+ :app_icon {entry.icon_name != "" ? entry.icon_name : "icon-missing "}
320320 :image { entry.muted == "true" || entry.level == 0 ? "${ pkgs . ghaf-artwork } /icons/volume-0.svg" :
321321 entry.level <= 25 ? "${ pkgs . ghaf-artwork } /icons/volume-1.svg" :
322322 entry.level <= 75 ? "${ pkgs . ghaf-artwork } /icons/volume-2.svg" : "${ pkgs . ghaf-artwork } /icons/volume-3.svg" }
@@ -336,7 +336,7 @@ writeText "widgets.yuck" ''
336336 :spacing 6
337337 :space-evenly false
338338 (label :class "header"
339- :visible { header != "" && header != "null" ? "true" : "false" }
339+ :visible { header != "" && header != "null" }
340340 :text header
341341 :hexpand true
342342 :vexpand true
@@ -363,7 +363,7 @@ writeText "widgets.yuck" ''
363363 :halign "start"
364364 :hexpand true
365365 (label :halign "start" :class "title" :text title)
366- (label :visible {subtitle != "" ? "true" : "false" } :halign "start" :class "subtitle" :text subtitle :limit-width 13))))))
366+ (label :visible {subtitle != ""} :halign "start" :class "subtitle" :text subtitle :limit-width 13))))))
367367
368368 ;; Power Menu Buttons ;;
369369 (defwidget power_menu []
@@ -422,7 +422,7 @@ writeText "widgets.yuck" ''
422422 :space-evenly true
423423 :spacing 10
424424 (widget_button
425- :visible { EWW_BATTERY != "" ? "true" : "false" }
425+ :visible { EWW_BATTERY != "" }
426426 :header "Battery"
427427 :title {EWW_BATTERY != "" ? "'' ${battery.capacity}%" : "100%"}
428428 :subtitle { battery.status == 'Charging' ? "Charging" :
@@ -503,17 +503,20 @@ writeText "widgets.yuck" ''
503503 :space-evenly "false"
504504 :spacing 14
505505 :valign "center"
506- (image :class "icon"
506+ (image :visible { bright-icon != "" }
507+ :class "icon"
507508 :path bright-icon
508509 :image-height 24
509510 :image-width 24)
510- (image :class "icon"
511+ (image :visible { vol-icon != "" && audio_output != "" }
512+ :class "icon"
511513 :path vol-icon
512514 :image-height 24
513515 :image-width 24)
514- (image :visible { audio_input.state == "RUNNING" }
516+ (image :visible { audio_input != "" && audio_input .state == "RUNNING" }
515517 :icon "microphone-sensitivity-high")
516- (image :class "icon"
518+ (image :visible { bat-icon != "" }
519+ :class "icon"
517520 :path bat-icon
518521 :image-height 24
519522 :image-width 24))))
@@ -587,10 +590,7 @@ writeText "widgets.yuck" ''
587590 (defwidget cal []
588591 (desktop-widget
589592 (calendar :class "cal"
590- :show-week-numbers false
591- :day calendar_day
592- :month calendar_month
593- :year calendar_year)))
593+ :show-week-numbers false)))
594594
595595 ;; Left Widgets ;;
596596 (defwidget workspaces []
0 commit comments