Console player: shell-fm

Table of Contents

Playlist script

Playlist script

by ross at 03:53:27 on October 19, 2012

I wrote a simple script which adds playlist functionality to shell-fm: switch-station.

Save it as /root/bin/switch-station. Modify host variable in it to match the address on which shell-fm is listening for commands.

# chmod a+x /root/bin/switch-station

Create the playlist (/root/.shell-fm/playlist):


Replace xzzs with your login.

My shell-fm daemon is running as root, so I decided to use root's home for storing status files of the script. Because of that the script must be run via sudo (setup sudoers to run it without password for your user).

Here's how it works (bind the commands to hotkeys):

  • sudo /root/bin/switch-station current
    Starts playing the current item of the playlist
  • sudo /root/bin/switch-station next
    Switches to the next item
  • sudo /root/bin/switch-station prev
    Switches to the previous item

Other hotkeys (replace localhost with the address of shell-fm daemon):

  • echo 'stop' | nc localhost 54311
    Stops playing
  • echo 'love' | nc localhost 54311
    Add currently playing song to favourites (managed by
  • echo 'skip' | nc localhost 54311
    Skips the song
  • echo 'ban' | nc localhost 54311
    This song will never be played again

The script can use Festival to say the current station name. Install the talking-script part of the link above to enable this.