diff --git a/.gitignore b/.gitignore index 4028752..4193d91 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ node_modules _youtube +cyp.service diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..4954759 --- /dev/null +++ b/Makefile @@ -0,0 +1,32 @@ +LESS := $(shell npm bin)/lessc +APP := app +CSS := $(APP)/app.css +ICONS := $(APP)/js/lib/icons.js +SYSD_USER := ~/.config/systemd/user +SERVICE := cyp.service + +all: $(CSS) + +icons: $(ICONS) + +$(ICONS): $(APP)/icons/* + $(APP)/svg2js.sh $(APP)/icons > $@ + +$(CSS): $(APP)/css/* + $(LESS) $(APP)/css/app.less > $@ + +service: $(SERVICE) + mkdir -p $(SYSD_USER) + ln -fs $(realpath $^) $(SYSD_USER)/$^ + systemctl --user daemon-reload + +$(SERVICE): misc/cyp.service.template + cat $^ | envsubst > $@ + +watch: all + while inotifywait -e MODIFY -r $(APP)/css $(APP)/js ; do make $^ ; done + +clean: + rm -f $(SERVICE) $(CSS) + +.PHONY: all watch icons service clean diff --git a/README.md b/README.md index 08efd58..aad7915 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ CYP is a web-based frontend for [MPD](https://www.musicpd.org/), the Music Playe ## Screenshots -![](screen1.png) ![](screen2.png) +![](misc/screen1.png) ![](misc/screen2.png) ## Features diff --git a/app/Makefile b/app/Makefile deleted file mode 100644 index 819f958..0000000 --- a/app/Makefile +++ /dev/null @@ -1,18 +0,0 @@ -LESS := $(shell npm bin)/lessc -APP := app.css -ICONS := js/lib/icons.js - -all: $(APP) - -icons: $(ICONS) - -$(ICONS): icons/* - ./svg2js.sh icons > $@ - -$(APP): css/* - $(LESS) css/app.less > $@ - -watch: all - while inotifywait -e MODIFY -r css js ; do make $^ ; done - -.PHONY: all watch icons diff --git a/misc/cyp.service.template b/misc/cyp.service.template new file mode 100644 index 0000000..ef3ab6c --- /dev/null +++ b/misc/cyp.service.template @@ -0,0 +1,9 @@ +[Unit] +Description=Control Your Player + +[Service] +WorkingDirectory=$PWD +ExecStart=node . + +[Install] +WantedBy=multi-user.target diff --git a/screen1.png b/misc/screen1.png similarity index 100% rename from screen1.png rename to misc/screen1.png diff --git a/screen2.png b/misc/screen2.png similarity index 100% rename from screen2.png rename to misc/screen2.png