![]() |
[How-To] control MPD (music server) from your desktop
Here's a simple method of controlling your home desktop computer or HTPC from your n900 using the desktop command execution widget. It looks like this:
http://stuff.moritzg.ch/Screenshot-20100426-173040.png For those who don't know what MPD is: It's the most awesome music library player around, believe me. MPD is a backend with billions of frontends for it: General: http://mpd.wikia.com/wiki/Music_Player_Daemon_Wiki List of clients: http://mpd.wikia.com/wiki/Clients And the simplest MPD client is "mpc", a simple command line client. This is what we're gonna use for our remote control widgets. Here's the set of simple scripts used. Mind that you need to change your IP (192.168.1.2) and port (21337) to whatever your mpd server uses. Also, remember that you might have to allow clients from outside into your mpd server by commenting out 'bind_to_address "127.0.0.1"' in your mpd.conf. repeat: Code:
mpc -h 192.168.1.2 -p 21337 repeat | tail -n 1 | sed -e 's/vol.*repeat: //;s/random.*//' Code:
mpc -h 192.168.1.2 -p 21337 random | tail -n 1 | sed -e 's/vol.*random: //;s/single.*// Code:
mpc -h 192.168.1.2 -p 21337 prev > /dev/null 2>&1 Code:
mpc -h 192.168.1.2 -p 21337 toggle | sed -n 's/\\[//;s/\\].*//;2p' Code:
mpc -h 192.168.1.2 -p 21337 next > /dev/null 2>&1 Code:
mpc -h 192.168.1.2 -p 21337 -f "%artist% - %album%: %title%" | head -n 1 Add this to the end of c_titles: Code:
Toggle;Next;Prev;Now playing;Random;Repeat:; Code:
mpc -h 192.168.1.2 -p 21337 toggle | sed -n 's/\\[//\;s/\\].*//\;2p';mpc -q -h 192.168.1.2 -p 21337 next;mpc -q -h 192.168.1.2 -p 21337 prev;mpc -h 192.168.1.2 -p 21337 -f "%artist% - %album%: %title%" | head -n 1;mpc -h 192.168.1.2 -p 21337 random | tail -n 1 | sed -e 's/vol.*random: //\;s/single.*//';mpc -h 192.168.1.2 -p 21337 repeat | tail -n 1 | sed -e 's/vol.*repeat: //\;s/random.*//' |
Re: [How-To] control MPD (music server) from your desktop
You can use "-q" to silent output and then can remove the /dev/null redirection.
|
All times are GMT. The time now is 04:46. |
vBulletin® Version 3.8.8