You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@jhcloos I noticed you've watched this repository. Would you be willing to try the new branch out: https://github.com/bonelifer/mpd-scripts/tree/mpd_webserver/mpd-notifier Not being a coder I used ChatGPT and Googles Bard. I understand if you can't help. If you do there are some places where paths need to be altered to your environment. I've fixed this in the installer. Now it will do sed replacement, so it should just install. Below is an overview of what this new branch does. I removed the BASE64 image code and just included the file mostly because it was confusing the AI's and also because it was a bad idea to begin with.
Scripts Overview
mpd-notifier.sh
This Bash script retrieves album cover art for the currently playing track in MPD and displays a notification using notify-send. Here's a rundown of what it does:
Retrieves track information using mpc (MPD client) commands.
Determines the status of the MPD player (playing, paused, stopped).
Manages the retrieval of album cover art:
Checks whether MPD is being access over the network or local mode.
Retrieves the cover art either locally or via a web server.
Constructs and displays notifications using notify-send with the album cover art if available or a fallback image.
mpd-webserver.py
This Python script sets up a simple HTTP server to serve album cover images stored in a specified directory. It utilizes the http.server module to handle requests for image files and restricts access to only image files.
image-server.service
This service configuration file (image-server.service) defines how the mpd-webserver.py script should run as a service using systemd. It specifies the command to execute (ExecStart) and restart behavior.
mpd-install.sh
The installation script (mpd-install.sh) automates the installation process for the MPD web server components:
Checks for Python 3.x installation and installs it if absent.
Creates a directory for the web server files if it doesn't exist.
Copies the necessary Python files (image_server.py) and service configuration (image_server.service) to the appropriate locations.
Enables and starts the image_server service using systemctl.
Overall Flow
Notifier Script (mpd-notifier.sh): Retrieves MPD track info and album art, displays notifications.
Web Server (mpd-webserver.py): Serves album cover images via a simple HTTP server.
Installer Script (mpd-install.sh): Automates installation of web server components.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
@jhcloos I noticed you've watched this repository. Would you be willing to try the new branch out: https://github.com/bonelifer/mpd-scripts/tree/mpd_webserver/mpd-notifier Not being a coder I used ChatGPT and Googles Bard. I understand if you can't help.
If you do there are some places where paths need to be altered to your environment.I've fixed this in the installer. Now it will do sed replacement, so it should just install. Below is an overview of what this new branch does. I removed the BASE64 image code and just included the file mostly because it was confusing the AI's and also because it was a bad idea to begin with.Scripts Overview
mpd-notifier.sh
This Bash script retrieves album cover art for the currently playing track in MPD and displays a notification using
notify-send. Here's a rundown of what it does:mpc(MPD client) commands.notify-sendwith the album cover art if available or a fallback image.mpd-webserver.py
This Python script sets up a simple HTTP server to serve album cover images stored in a specified directory. It utilizes the
http.servermodule to handle requests for image files and restricts access to only image files.image-server.service
This service configuration file (
image-server.service) defines how thempd-webserver.pyscript should run as a service usingsystemd. It specifies the command to execute (ExecStart) and restart behavior.mpd-install.sh
The installation script (
mpd-install.sh) automates the installation process for the MPD web server components:image_server.py) and service configuration (image_server.service) to the appropriate locations.image_serverservice usingsystemctl.Overall Flow
Beta Was this translation helpful? Give feedback.
All reactions