Add mpd sripts
authorSiraaj Khandkar <siraaj@khandkar.net>
Wed, 13 Mar 2019 00:33:47 +0000 (20:33 -0400)
committerSiraaj Khandkar <siraaj@khandkar.net>
Wed, 13 Mar 2019 00:33:47 +0000 (20:33 -0400)
bin/mpd_cmd [new file with mode: 0755]
bin/mpd_current_file [new file with mode: 0755]
bin/mpd_currentsong [new file with mode: 0755]
bin/mpd_fav [new file with mode: 0755]
bin/mpd_status [new file with mode: 0755]

diff --git a/bin/mpd_cmd b/bin/mpd_cmd
new file mode 100755 (executable)
index 0000000..2cc24e4
--- /dev/null
@@ -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 (executable)
index 0000000..63634b0
--- /dev/null
@@ -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 (executable)
index 0000000..c1be6e3
--- /dev/null
@@ -0,0 +1,3 @@
+#! /bin/sh
+
+mpd_cmd 'currentsong'
diff --git a/bin/mpd_fav b/bin/mpd_fav
new file mode 100755 (executable)
index 0000000..f91983d
--- /dev/null
@@ -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 (executable)
index 0000000..f016e36
--- /dev/null
@@ -0,0 +1,3 @@
+#! /bin/sh
+
+mpd_cmd 'status'
This page took 0.031397 seconds and 4 git commands to generate.