From 22fe7c316540243292f3b71ecd921efcae18bcb7 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Mon, 26 Dec 2016 00:27:25 -0500 Subject: [PATCH] shell/mpd: run mpc through socket --- shell/mpd/.config/mpd/mpd-linux.conf | 3 +-- shell/mpd/.config/mpd/mpd-osx.conf | 4 +--- shell/mpd/.ncmpcpp/config | 2 +- shell/mpd/aliases.zsh | 2 ++ shell/mpd/bin/notify-song | 2 +- 5 files changed, 6 insertions(+), 7 deletions(-) diff --git a/shell/mpd/.config/mpd/mpd-linux.conf b/shell/mpd/.config/mpd/mpd-linux.conf index b2c42562..ad8fdfb4 100644 --- a/shell/mpd/.config/mpd/mpd-linux.conf +++ b/shell/mpd/.config/mpd/mpd-linux.conf @@ -9,8 +9,7 @@ state_file "~/.config/mpd/mpdstate" gapless_mp3_playback "yes" restore_paused "yes" -bind_to_address "127.0.0.1" -port "6600" +bind_to_address "~/.config/mpd/mpd.sock" audio_output { type "alsa" diff --git a/shell/mpd/.config/mpd/mpd-osx.conf b/shell/mpd/.config/mpd/mpd-osx.conf index 17eb2ca2..478abefc 100644 --- a/shell/mpd/.config/mpd/mpd-osx.conf +++ b/shell/mpd/.config/mpd/mpd-osx.conf @@ -9,9 +9,7 @@ state_file "~/.config/mpd/mpdstate" gapless_mp3_playback "yes" restore_paused "yes" -bind_to_address "127.0.0.1" -port "6600" -user "hlissner" +bind_to_address "~/.config/mpd/mpd.sock" audio_output { type "osx" diff --git a/shell/mpd/.ncmpcpp/config b/shell/mpd/.ncmpcpp/config index e6c5c86e..ba9e1d2c 100644 --- a/shell/mpd/.ncmpcpp/config +++ b/shell/mpd/.ncmpcpp/config @@ -5,7 +5,7 @@ ncmpcpp_directory = ~/.ncmpcpp lyrics_directory = ~/music/.db/lyrics ##### connection settings ##### -#mpd_host = localhost +mpd_host = "~/.config/mpd/mpd.sock" #mpd_port = 6600 #mpd_connection_timeout = 5 diff --git a/shell/mpd/aliases.zsh b/shell/mpd/aliases.zsh index 24e01109..d0c8589c 100644 --- a/shell/mpd/aliases.zsh +++ b/shell/mpd/aliases.zsh @@ -3,6 +3,8 @@ if [[ $OSTYPE == darwin* ]]; then alias mpdi='mpd ~/.config/mpd/mpd.conf' fi +alias mpc='mpc -h "$HOME/.config/mpd/mpd.sock"' + mpca() { local files=() for file in $@; do diff --git a/shell/mpd/bin/notify-song b/shell/mpd/bin/notify-song index 2d28f485..457dbfee 100755 --- a/shell/mpd/bin/notify-song +++ b/shell/mpd/bin/notify-song @@ -5,7 +5,7 @@ if ! pgrep mpd >/dev/null; then exit 1 fi -info=$(mpc current) +info=$(mpc -h "$HOME/.config/mpd/mpd.sock" current) if [[ -z $info ]]; then >&2 echo "nothing is playing." exit