dotfiles/gui/player.sh

34 lines
854 B
Bash
Raw Normal View History

2020-11-02 04:08:18 +00:00
#!/bin/sh
2020-09-17 16:02:24 +00:00
2020-11-21 18:07:26 +00:00
set -e
2020-11-08 16:26:14 +00:00
DIR=$(dirname "$(readlink -f "$0")")
2020-11-02 04:08:18 +00:00
. "$DIR/../env.sh"
2020-09-17 16:02:24 +00:00
2020-11-21 18:07:26 +00:00
log 'Setting up player: mpv mpd'
2020-09-17 16:02:24 +00:00
# install music and video player
case "$PM" in
apt)
sudo apt install -y mpd mpc ncmpcpp mpv
;;
pacman)
2020-11-21 18:07:26 +00:00
sudo pacman -S --noconfirm --needed mpd mpc ncmpcpp mpv
2020-09-17 16:02:24 +00:00
;;
esac
2020-09-19 15:33:13 +00:00
# symlink configuration
2020-11-21 18:07:26 +00:00
lnsf "$DIR/mpd/mpd.conf" "$XDG_CONFIG_HOME/mpd/mpd.conf"
lnsf "$DIR/mpv/mpv.conf" "$XDG_CONFIG_HOME/mpv/mpv.conf"
lnsf "$DIR/mpv/scripts/organize.lua" "$XDG_CONFIG_HOME/mpv/scripts/organize.lua"
lnsf "$DIR/ncmpcpp/bindings" "$XDG_CONFIG_HOME/ncmpcpp/bindings"
lnsf "$DIR/ncmpcpp/config" "$XDG_CONFIG_HOME/ncmpcpp/config"
2020-09-19 15:33:13 +00:00
2020-09-22 10:42:13 +00:00
# prevent system-wide mpd
sudo systemctl disable mpd
sudo systemctl stop mpd
2020-11-02 04:08:18 +00:00
mkdir -p "$HOME/.mpd/playlists"
2020-09-22 10:42:13 +00:00
2020-09-19 01:23:38 +00:00
# enable for current user
systemctl --user enable mpd
systemctl --user start mpd