Fehérke's GitHub Site == glue between Fehérke's GitHub hosted projects

mpc.sh - simple frontend for the mpc client for mpd

In my subconscious I always tried to achieve something like MPD. And when I discovered it of course I choose MPC as client. I really enjoy to start the music with mpc play, but there are situations when you wish to have a faster way too. Certainly there are adequate clients out there and using different clients in different circumstances would feet the client-server architecture. But I decided to not install, learn, run, maintain another client just for a few occasion. So I wrote this extremely dumb frontend.

Never intended to be a full featured frontend and certainly never will be. But a playlist switcher with similar look & feel may feet the original idea.

Usage

mpc.sh simply gets one key press and executes the mpc client passing the corresponding parameter :

sample output - mpc.sh

[      no play in progress       ]
----------------------------------
|<  || [] >|  »» ¿? () .< ><  :=
z  x  c  v  b   r  s  i  a  f   p 
|--|--|--|--|--|--|--|--O--|--|  i
m  1  2  3  4  5  6- 7 +8  9  0  ?

This is not a big bang, I only decided to post it because the used approach gives me very comfortable frontend. Of course, to be really handy I set the window manager to start it for a specific key combination.

mpc.sh expects no command line parameters from the user. But it uses two special parameters when re-launching itself to display different interfaces :

sample output - mpc.sh playlist

a At Work Channel
b Classical King FM
c Hard Rock Radio
d Italo Disco
e Magic FM
f MelleslegFM
g Rock Radio 1
h Slay Radio
i SwissRadio

a-s                                    
 1   2   3   4   5   6   7   8   9   0 
current playlist : 4 entries
load : a..z replace, A..Z append

sample output - mpc.sh statinfo

mpd version     : 0.16.0
mpc version     : 0.20
mpc.sh version  : 1.6

Artists         : #####
Albums          : #####
Songs           : #####

Play Time       : 0 days, 8:15:11
Uptime          : 12 days, 1:19:21
DB Updated      : Sat Dec 31 19:36:10 2011
DB Play Time    : #####
ok

The keys available in the main dialog :

key command involved mpc command
z Starts playing previous song. prev
x Starts playing. play
c Pauses playing. pause
v Stops playing. stop
b Starts playing next song on playlist. next
r Toggles repeat mode. repeat
s Toggles random mode. random
i Toggles single mode. single
a Jumps back to current song’s beginning. seek
f Toggles crossfade. crossfade
m Sets volume to 0. volume
1..0 Sets volume to number*10%. volume
+ Increases volume with 10%. volume
- Decreases volume with 10%. volume
p Open the playlist window. lsplaylists, clear, load
? Open the status information window. version, help, stats

The keys available in the playlist dialog :

key command
1..0 Changes playlist to page given by number.
+ Changes playlist to next page.
- Changes playlist to previous page.
a..z Clears the current playlist then loads the given playlist.
A..Z Loads the playlist assigned to the given letter.

Configuration

None.

Versions

Plans

Download

You can find the related files on GitHub in my Bash-script repository’s mpc directory :