Skip to content
This repository has been archived by the owner on Dec 9, 2021. It is now read-only.

Incomplete translation to object within <definitions> block #5

Open
Lazerbeak12345 opened this issue Dec 5, 2021 · 0 comments
Open

Comments

@Lazerbeak12345
Copy link

Lazerbeak12345 commented Dec 5, 2021

Before:

...
	<definitions>
...
		<def name="slider-vol">
			<box>
				
				<scale min="0" max="101" value="{{volume}}" onchange="amixer -D pulse sset Master {}%"/>
				{{volume}}%
			</box>
		</def>
		<def name="slider-bat">
			<box class="{{if 15 > battery-level && battery-status == 'Discharging'
				then 'red'
				else if battery-level > 80 && battery-status == 'Charging'
				then 'green'
				else ''}}">
				{{if battery-level > 99
					then ''
					else if battery-level > 90
					then ''
					else if battery-level > 80
					then ''
					else if battery-level > 70
					then ''
					else if battery-level > 60
					then ''
					else if battery-level > 50
					then ''
					else if battery-level > 40
					then ''
					else if battery-level > 30
					then ''
					else if battery-level > 20
					then ''
					else if battery-level > 10
					then ''
					else ''
				}}{{if battery-status == 'Charging'
					then ' '
					else ''
				}}{{if battery-level > 80 && battery-status == 'Charging'
					then ' '
					else ''
				}} {{battery-level}}% 
			</box>
		</def>

...
	</definitions>
...

After:

...
		(defwidget slider-vol [] 
			(box>""<scale :min 0 :max 101 :value volume :onchange "amixer -D pulse sset Master {}%")"
				${volume}%
			"</box>)
		(defwidget slider-bat [if 15 > battery-level && battery-status == 'Discharging'
				then 'red'
				else if battery-level > 80 && battery-status == 'Charging'
				then 'green'
				else ''] 
			(box :15  :class  :{{if   battery-level && battery-status == 'Discharging'
				then 'red'
				else if battery-level > 80 && battery-status == 'Charging'
				then 'green'
				else ''}}">
				{{if battery-level > 99
					then ''
					else if battery-level > 90
					then ''
					else if battery-level > 80
					then ''
					else if battery-level > 70
					then ''
					else if battery-level > 60
					then ''
					else if battery-level > 50
					then ''
					else if battery-level > 40
					then ''
					else if battery-level > 30
					then ''
					else if battery-level > 20
					then ''
					else if battery-level > 10
					then ''
					else ''
				}}{{if battery-status == 'Charging'
					then ' '
					else ''
				}}{{if battery-level >" 80 && battery-status == 'Charging'
					then ' '
					else ''
				} ${battery-level}% 			"))
...

There's partial XML in the first, and the && is invalid in yuck

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant