Linux desktop notifier for MOC (Music-on-console) written in python.
- Clone this repo
- Create virtual environment (
python -m venv .venv) - Start virtual environment (
source .venv/bin/activate) - Install dependencies (
pip install -r requirements.txt)
While moc server is running, you can run ./moc_notify.py and it will
produce notifications when playing tracks change.
You can run it without activating the virtual environment, by running it with the full path to the installed venv.
#!/usr/bin/env bash
INSTALL_PATH=/full/path/to/where/install/moc-notify
"$INSTALL_PATH/.venv/bin/python" "$INSTALL_PATH/moc_notify.py"
You could use the following script to create a bash script to run it. First make sure the virtual environment is activated, then run this:
echo '#!/usr/bin/env bash' > moc_notify
echo -n "PYTHON_BIN=" >> moc_notify
which python >> moc_notify
echo -n "INSTALL_DIR=" >> moc_notify
pwd >> moc_notify
echo '"$PYTHON_BIN" "$INSTALL_DIR/moc_notify.py"' >> moc_notify
chmod a+x moc_notify
That will create a file moc_notify that is executable and will run the python
version that has the required depedencies, even when the virtual environment is
not activated.