systemd service
This commit is contained in:
parent
6fc62a2599
commit
6b0c513427
7 changed files with 43 additions and 19 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -1,2 +1,3 @@
|
|||
node_modules
|
||||
_youtube
|
||||
cyp.service
|
||||
|
|
32
Makefile
Normal file
32
Makefile
Normal file
|
@ -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
|
|
@ -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
|
||||
|
|
18
app/Makefile
18
app/Makefile
|
@ -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
|
9
misc/cyp.service.template
Normal file
9
misc/cyp.service.template
Normal file
|
@ -0,0 +1,9 @@
|
|||
[Unit]
|
||||
Description=Control Your Player
|
||||
|
||||
[Service]
|
||||
WorkingDirectory=$PWD
|
||||
ExecStart=node .
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
Before Width: | Height: | Size: 111 KiB After Width: | Height: | Size: 111 KiB |
Before Width: | Height: | Size: 130 KiB After Width: | Height: | Size: 130 KiB |
Loading…
Reference in a new issue