dotfiles/gui/player.sh

43 lines
1.1 KiB
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
;;
2022-05-03 15:20:26 +00:00
xbps)
sudo xbps-install -y 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"
2020-12-07 08:55:12 +00:00
lnsf "$DIR/mpv/input.conf" "$XDG_CONFIG_HOME/mpv/input.conf"
2020-11-21 18:07:26 +00:00
lnsf "$DIR/mpv/scripts/organize.lua" "$XDG_CONFIG_HOME/mpv/scripts/organize.lua"
2020-12-07 08:55:12 +00:00
lnsf "$DIR/mpv/scripts/cut.lua" "$XDG_CONFIG_HOME/mpv/scripts/cut.lua"
2020-11-21 18:07:26 +00:00
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
2022-05-03 15:20:26 +00:00
if has_cmd systemctl; then
sudo systemctl disable mpd
sudo systemctl stop mpd
# enable for current user
systemctl --user enable mpd
systemctl --user start mpd
fi
2020-11-02 04:08:18 +00:00
mkdir -p "$HOME/.mpd/playlists"
2020-09-22 10:42:13 +00:00
2021-08-27 04:30:31 +00:00
# command to update your database: mpc update