forked from MunifTanjim/scripts.sh
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup-cmus
executable file
·35 lines (28 loc) · 897 Bytes
/
setup-cmus
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#!/usr/bin/env bash
# House Keeping
_GIT_DIR="${HOME}/data/gits"
mkdir -p "${_GIT_DIR}"
cd "${_GIT_DIR}"
# Initialization
if [[ -d "${_GIT_DIR}/cmus" ]]; then
echo "cmus is already installed!"
echo "Updating cmus..."
cd cmus
git pull
else
echo "Installing cmus..."
git clone --depth 1 https://github.com/cmus/cmus
cd cmus
fi
echo "Installing dependencies..."
sudo apt install -y libroar-dev libsamplerate0-dev libjack-dev libavformat-dev libavcodec-dev libsystemd-dev libopusfile-dev libasound2-dev libncurses5-dev libncursesw5-dev
echo "Running build..."
./configure prefix=${HOME}/.local
make
make install
echo "Setting up cmus binary: cmus, cmus-remote"
sudo ln -nsf ${HOME}/.local/bin/cmus /usr/bin/cmus
sudo ln -nsf ${HOME}/.local/bin/cmus-remote /usr/bin/cmus-remote
echo "Setting up helper scripts..."
sudo ln -nsf `which cmus-toggle` /usr/bin/cmus-toggle
echo "Done!"