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 :
[ 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 :
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
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
- 1.0 - May 2008
- Initial release.
- 1.1 - September 2008
- Volume adjusting :
- mute ( key m )
- set volume percentage ( key 1..9 = number*10% )
- set volume to maximum ( key 0 )
- Volume adjusting :
- 1.2 - September 2008
- Title display.
- 1.4 - July 2010
- Progress display.
- 1.5 - November 2010
- Notice instead of progress for content through http:// .
- Play single entry ( key i ).
- Toggle 2 second crossfade ( key f ).
- Playlist loading :
- display playlist list ( key p )
- load playlist exclusively ( key a..z )
- append playlist ( key A..Z )
- 1.6 - May 2011
- Play current again ( key a ).
- Status information ( key ? ).
- Playlist pager :
- switch to given page ( key 1..0 )
- switch to next page ( key + )
- switch to previous page ( key - )
Plans
- A few minor configuration pieces for the terminal would be nice.
- Remove the playlist limitation, if I will have a good idea for it.
- Implement some simple sticker operations.
Download
You can find the related files on GitHub in my Bash-script repository’s mpc directory :
- mpc.sh - script
- mpc.sh.1 - man page
- mpc.sh.pod - man page source