undefineddarkness / ewwxml Goto Github PK
View Code? Open in Web Editor NEWA eww -> yuck configuration converter, written in Typescript
License: MIT License
A eww -> yuck configuration converter, written in Typescript
License: MIT License
see: https://gist.github.com/tripleo1/114a261c9a0ffb2da7fe1d7381efecd2
From: https://github.com/Paladin1991/Last-Xmonad
https://github.com/Paladin1991/Last-Xmonad/blob/main/eww/eww.xml
See: https://gist.github.com/tripleo1/d9acc571c27ad2fa5da77b4e698ee4b5
From: https://github.com/adi1090x/widgets
https://github.com/adi1090x/widgets/nordic/eww.xml
This tool is great. Can it be added to npm so that you can run this command instead of what is in your readme?
npx ewwxml <PATH-TO-EWW-XML-FILE> <PATH-TO-YUCK-FILE>
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
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.