grzegorz/README.md

47 lines
1.9 KiB
Markdown
Raw Normal View History

2018-03-04 18:23:45 +01:00
# Grzegorz API
<img align="right" width="250" src="grzegorz/res/logo.png">
2018-03-04 18:23:45 +01:00
2022-02-19 23:04:14 +01:00
`grzegorz` is simple REST API for managing an instance of MPV.
Why "Grzegorz"? [Great taste in humor of course!](https://youtu.be/t-fcrn1Edik)
2018-03-04 18:23:45 +01:00
2022-02-19 23:04:14 +01:00
When `grzegorz` starts, it launches an instance of MPV and maintains it. It is designed to be used as an info screen or HTPC, and supports multiple users to push changes to the MPV instance.
2018-03-04 18:23:45 +01:00
2023-08-27 00:51:10 +02:00
The API is described and can be tested at `http:/localhost:8080/docs/swagger` while the server is running. All API endpoints are available under `/api`
2018-03-04 18:23:45 +01:00
## How install and run it
2018-03-04 18:23:45 +01:00
Gregorz manages a MPV process, meaning you need to have MPV installed on your system. Look for it in your package manager.
2018-03-04 18:23:45 +01:00
sudo pip install git+https://github.com/Programvareverkstedet/grzegorz#master
2022-08-27 22:27:55 +02:00
sanic grzegorz.app --host :: --port 8080
2018-03-04 18:23:45 +01:00
Details are over [here](https://sanic.dev/en/guide/deployment/running.html#running-via-command).
2018-03-04 18:23:45 +01:00
## Development server
2018-03-04 18:23:45 +01:00
Setup local virtual environment and run with auto-reload:
poetry install
poetry run sanic grzegorz.app --host localhost --port 8000 --debug
The server should now be available at `http://localhost:8000/`.
## A word of caution
Grzegors will make a unix socket in the current working directory. Make sure it is somewhere writeable!
2018-03-04 18:23:45 +01:00
2022-02-19 23:04:14 +01:00
## Making `grzegorz` run on boot
<!-- TODO: make this use Cage or xinit -->
2018-03-04 18:23:45 +01:00
2018-03-05 23:11:55 +01:00
When setting up a info screen or HTPC using Grzegors, you may configure it to run automatically on startup.
2018-03-04 18:23:45 +01:00
2022-02-19 23:04:14 +01:00
We recommend installing a headless linux, and create a user for `grzegorz` to run as. (We named ours `grzegorz`, obviously)
Clone this repo into the home directory. Then make systemd automatically spin up a X session to run `grzegorz` in: Copy the files in the folder `dist` into the folder `$HOME/.config/systemd/user` and run the following commands as your user:
2018-03-04 18:23:45 +01:00
2019-03-13 11:23:08 +01:00
$ systemctl --user enable grzegorz@0.service
$ systemctl --user start grzegorz@0.service