shell/mpd: run mpc through socket

This commit is contained in:
Henrik Lissner 2016-12-26 00:27:25 -05:00
parent 92252c19ca
commit 22fe7c3165
5 changed files with 6 additions and 7 deletions

View file

@ -9,8 +9,7 @@ state_file "~/.config/mpd/mpdstate"
gapless_mp3_playback "yes" gapless_mp3_playback "yes"
restore_paused "yes" restore_paused "yes"
bind_to_address "127.0.0.1" bind_to_address "~/.config/mpd/mpd.sock"
port "6600"
audio_output { audio_output {
type "alsa" type "alsa"

View file

@ -9,9 +9,7 @@ state_file "~/.config/mpd/mpdstate"
gapless_mp3_playback "yes" gapless_mp3_playback "yes"
restore_paused "yes" restore_paused "yes"
bind_to_address "127.0.0.1" bind_to_address "~/.config/mpd/mpd.sock"
port "6600"
user "hlissner"
audio_output { audio_output {
type "osx" type "osx"

View file

@ -5,7 +5,7 @@ ncmpcpp_directory = ~/.ncmpcpp
lyrics_directory = ~/music/.db/lyrics lyrics_directory = ~/music/.db/lyrics
##### connection settings ##### ##### connection settings #####
#mpd_host = localhost mpd_host = "~/.config/mpd/mpd.sock"
#mpd_port = 6600 #mpd_port = 6600
#mpd_connection_timeout = 5 #mpd_connection_timeout = 5

View file

@ -3,6 +3,8 @@ if [[ $OSTYPE == darwin* ]]; then
alias mpdi='mpd ~/.config/mpd/mpd.conf' alias mpdi='mpd ~/.config/mpd/mpd.conf'
fi fi
alias mpc='mpc -h "$HOME/.config/mpd/mpd.sock"'
mpca() { mpca() {
local files=() local files=()
for file in $@; do for file in $@; do

View file

@ -5,7 +5,7 @@ if ! pgrep mpd >/dev/null; then
exit 1 exit 1
fi fi
info=$(mpc current) info=$(mpc -h "$HOME/.config/mpd/mpd.sock" current)
if [[ -z $info ]]; then if [[ -z $info ]]; then
>&2 echo "nothing is playing." >&2 echo "nothing is playing."
exit exit