Giter VIP home page Giter VIP logo

ewwxml's Introduction

EWW XML -> YUCK Converter

A tool to convert eww's legacy xml configuration to its new yuck config language. Please do make issues if you encounter any compatability problems. So far I think I've got the major ones but there will always be edge-cases NOTE: Things will be supported based on how much pain they are to implement.

Installation & Usage

You'll need node & its package manager (npm) installed.

git clone https://github.com/undefinedDarkness/ewwxml
cd ewwxml
npm install # To install dependencies
npm run build # Build typescript
node out/main.js <PATH-TO-EWW-XML-FILE> <PATH-TO-YUCK-FILE> 

TODO:

  • Fix inline strings
  • Make output not garbage
  • Make it easier to use
  • Fix minor differences
  • Test more throughly (on Axarva & adi's configs)

ewwxml's People

Contributors

axarva avatar undefineddarkness avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

axarva wigsinator

ewwxml's Issues

Incomplete translation to object within <definitions> block

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

npx support

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>

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.