From: Siraaj Khandkar Date: Wed, 13 Mar 2019 00:33:47 +0000 (-0400) Subject: Add mpd sripts X-Git-Url: https://git.xandkar.net/?a=commitdiff_plain;h=65b7dae997b87cadcb9a4685c9fe6f94a0ca910d;p=khome.git Add mpd sripts --- diff --git a/bin/mpd_cmd b/bin/mpd_cmd new file mode 100755 index 0000000..2cc24e4 --- /dev/null +++ b/bin/mpd_cmd @@ -0,0 +1,3 @@ +#! /bin/sh + +echo "$1\nclose" | nc 127.0.0.1 6600 diff --git a/bin/mpd_current_file b/bin/mpd_current_file new file mode 100755 index 0000000..63634b0 --- /dev/null +++ b/bin/mpd_current_file @@ -0,0 +1,3 @@ +#! /bin/sh + +mpd_currentsong | awk '/^file: / {sub("^file: *", "", $0); print $0}' diff --git a/bin/mpd_currentsong b/bin/mpd_currentsong new file mode 100755 index 0000000..c1be6e3 --- /dev/null +++ b/bin/mpd_currentsong @@ -0,0 +1,3 @@ +#! /bin/sh + +mpd_cmd 'currentsong' diff --git a/bin/mpd_fav b/bin/mpd_fav new file mode 100755 index 0000000..f91983d --- /dev/null +++ b/bin/mpd_fav @@ -0,0 +1,3 @@ +#! /bin/sh + +mpd_current_file >> "$HOME"/mpd_favs diff --git a/bin/mpd_status b/bin/mpd_status new file mode 100755 index 0000000..f016e36 --- /dev/null +++ b/bin/mpd_status @@ -0,0 +1,3 @@ +#! /bin/sh + +mpd_cmd 'status'