Implement XDG compliance, logging, and improved 401 error handling
- Install to ~/.local/bin/winamp-mpris - Use ~/.local/state/winamp-mpris/bridge.log for logging - Use $XDG_RUNTIME_DIR/winamp-mpris.pid for PID management - Add detailed user notification for 401 Unauthorized errors - Add install.sh for automated, standard-compliant setup - Include Winamp Web Interface source code and installer in repository
This commit is contained in:
39
install.sh
Executable file
39
install.sh
Executable file
@@ -0,0 +1,39 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Winamp MPRIS Bridge Installer (FreeDesktop/XDG compliant)
|
||||
|
||||
set -e
|
||||
|
||||
# Configuration
|
||||
BIN_DIR="$HOME/.local/bin"
|
||||
SERVICE_NAME="winamp-mpris.service"
|
||||
SYSTEMD_USER_DIR="$HOME/.config/systemd/user"
|
||||
|
||||
echo "Installing Winamp MPRIS Bridge..."
|
||||
|
||||
# 1. Create necessary directories
|
||||
echo "Creating directories..."
|
||||
mkdir -p "$BIN_DIR"
|
||||
mkdir -p "$SYSTEMD_USER_DIR"
|
||||
|
||||
# 2. Copy files to the correct locations
|
||||
echo "Copying files..."
|
||||
# Install the script to ~/.local/bin/winamp-mpris (removing .py extension for cleaner usage)
|
||||
cp winamp_mpris.py "$BIN_DIR/winamp-mpris"
|
||||
chmod +x "$BIN_DIR/winamp-mpris"
|
||||
|
||||
# Install the service file
|
||||
cp "$SERVICE_NAME" "$SYSTEMD_USER_DIR/"
|
||||
|
||||
# 3. Reload systemd and enable/start the service
|
||||
echo "Configuring systemd service..."
|
||||
systemctl --user daemon-reload
|
||||
systemctl --user enable "$SERVICE_NAME"
|
||||
systemctl --user restart "$SERVICE_NAME"
|
||||
|
||||
echo "Installation complete!"
|
||||
echo "Script installed to: $BIN_DIR/winamp-mpris"
|
||||
echo "Logs available at: ~/.local/state/winamp-mpris/bridge.log"
|
||||
echo "PID file at: \$XDG_RUNTIME_DIR/winamp-mpris.pid"
|
||||
|
||||
systemctl --user status "$SERVICE_NAME" --no-pager
|
||||
Reference in New Issue
Block a user