Skip to content

Commit

Permalink
Smoother automatic installation
Browse files Browse the repository at this point in the history
  • Loading branch information
fff0x committed Aug 14, 2022
1 parent 5534055 commit 9df66dd
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions work-in-progress/audiocontrol2/install.sh
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
#!/bin/bash

AC_CONTROL_FILE="/opt/audiocontrol2/audiocontrol2.py"
DST_PLAYER_FILE=/opt/audiocontrol2/ac2/players/tidalcontrol.py

rm ${DST_PLAYER_FILE}
ln -s ${PWD}/tidalcontrol.py ${DST_PLAYER_FILE}
rm -f "$DST_PLAYER_FILE"
ln -s "${PWD}/tidalcontrol.py" "$DST_PLAYER_FILE"

sed -i '/^from ac2\.players\.vollibrespot import MYNAME as SPOTIFYNAME$/a from ac2.players.tidalcontrol import TidalControl' "$AC_CONTROL_FILE"

PLACEHOLDER="$(sed -nE 's/^(.*)mpris\.register_nonmpris_player\(SPOTIFYNAME,vlrctl\)$/\1/p' "$AC_CONTROL_FILE")"
sed -i "/mpris.register_nonmpris_player(SPOTIFYNAME,vlrctl)/a \\\n${PLACEHOLDER}# TidalControl\n${PLACEHOLDER}tdctl = \
TidalControl()\n${PLACEHOLDER}tdctl.start()\n${PLACEHOLDER}mpris.register_nonmpris_player(tdctl.playername,tdctl)" "$AC_CONTROL_FILE"

systemctl restart audiocontrol2

echo "NOTE - THIS IS STILL WORK IN PROGRESS"
echo ""
echo "You will need to manually setup /opt/audiocontrol2/audiocontrol2.py"
echo ""
echo "* PLEASE CHECK THE README FOR FURTHER INSTRUCTIONS *"

0 comments on commit 9df66dd

Please sign in to comment.