♻️ eww(scripts/mediaplayer): handle artUrl type on script instead of yuck

This commit is contained in:
retrozinndev
2025-01-10 20:02:18 -03:00
parent 2ffd3b3551
commit 3edc080e0f
4 changed files with 13 additions and 13 deletions
+2 -2
View File
@@ -1,6 +1,6 @@
(defwidget big-media [ show-album-bg show-album-image ?album-image-size ?style ?visible ]
(box :class "big-media ${ show-album-bg ? 'album-bg' : '' } ${ show-album-image ? 'album-image' : '' }"
:style "${ show-album-bg ? "background-image: url(\"${ json_media.artUrl =~ "^(http(.*)://(.*))$" ? json_media.artUrl : "${ "${ json_media.artUrl =~ "^(file://(.*))$" ? '' : 'file://' }" + json_media.artUrl }" }\")" : "" }; ${style}"
:style "${ show-album-bg ? "background-image: url(\"${ json_media.artUrl != "null" ? json_media.artUrl : '' }\")" : "" }; ${style}"
:visible { visible == false ? false : true }
:space-evenly false
:orientation "vertical"
@@ -12,7 +12,7 @@
(box :class "album-image"
:width { album-image-size != "" ? album-image-size : 98 }
:height { album-image-size != "" ? "${album-image-size - 11}" : 87 }
:style "background-image: url('${ json_media.artUrl =~ "^(http(.*)://(.*))$" ? json_media.artUrl : "${ "${ json_media.artUrl =~ "^(file://(.*))$" ? '' : 'file://' }" + json_media.artUrl }" }');"
:style "background-image: url(\"${ json_media.artUrl != "null" ? json_media.artUrl : "" }\");"
:valign "center"
:visible { json_media.artUrl == "null" || !show-album-image ? false : true })
+5 -5
View File
@@ -5,17 +5,17 @@
(tile :icon '󰤨'
:label "Network"
:enabled { network_status == "full" ? true : false }
:onenable "nmcli n on"
:ondisable "nmcli n off"
:onenable "nmcli n on > /dev/null"
:ondisable "nmcli n off > /dev/null"
:visible true
:class "network")
(tile :icon '󰂯'
:label "Bluetooth"
:enabled { bluetooth_powered == "yes" ? true : false }
:onenable "bluetoothctl power on"
:ondisable "bluetoothctl power off"
:visible true)
:onenable "bluetoothctl power on > /dev/null"
:ondisable "bluetoothctl power off > /dev/null"
:visible { bluetooth_powered == "" ? false : true })
(tile :icon '󰍶'
:label "Do Not Disturb"