From 65b7dae997b87cadcb9a4685c9fe6f94a0ca910d Mon Sep 17 00:00:00 2001 From: Siraaj Khandkar Date: Tue, 12 Mar 2019 20:33:47 -0400 Subject: [PATCH 1/1] Add mpd sripts --- bin/mpd_cmd | 3 +++ bin/mpd_current_file | 3 +++ bin/mpd_currentsong | 3 +++ bin/mpd_fav | 3 +++ bin/mpd_status | 3 +++ 5 files changed, 15 insertions(+) create mode 100755 bin/mpd_cmd create mode 100755 bin/mpd_current_file create mode 100755 bin/mpd_currentsong create mode 100755 bin/mpd_fav create mode 100755 bin/mpd_status 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' -- 2.20.1