#!/usr/bin/env bash run_directory=$(dirname $(readlink -f "$0")) user=$(whoami) if [[ $user != 'root' ]]; then sudo="sudo" else sudo="" fi echo "Setting custom upmpdcli service unit" $sudo mkdir /etc/systemd/system/upmpdcli.service.d $sudo cp $run_directory/exec.conf /etc/systemd/system/upmpdcli.service.d/exec.conf echo "Setting custom upmpdcli-restart service unit" $sudo cp $run_directory/restart-upmpdcli.service /etc/systemd/system/ $sudo cp $run_directory/restart-upmpdcli.timer /etc/systemd/system/ $sudo systemctl daemon-reload $sudo systemctl enable restart-upmpdcli.timer echo "Setting ALSA configuration" $sudo cp $run_directory/asound.conf /etc/asound.conf exit 0