3 Shell.FM \- Lightweight, console-based player for Last.FM radio streams.
6 [-d] [-i address] [-p port] [-b] [-D device] [-y proxy] [-h] lastfm://...
8 Shell.FM is a lightweight, console-based player for radio streams provided by
13 Fork to background (requires a socket interface to be set up so it can still be
17 Enable the socket interface and bind it to the given host address (should be
18 the host name or IP address of the host shell-fm is running on).
21 Make the socket interface listen for incoming connections on the given port.
25 Enable batch mode (some freaky mode that makes shell-fm easier to handle from
26 inside emacs). This was not my idea.
29 Use the given device file as audio device. This is only used if libao support
30 is disabled. Default is /dev/audio.
33 Make shell-fm use the given host as proxy server for HTTP requests.
36 Print help text and exit.
39 URI of a Last.FM radio stream to play after startup.
40 For example: `shell-fm -d lastfm://artist/The%20Beatles/similarartists'
42 On startup, shell-fm will ask you for your Last.FM login and password
44 provided in your ~/.shell-fm/shell-fm.rc). If you've given a stream URI on the
45 command line or there is a default radio defined in the configuration file,
46 shell-fm will now try to play it. When the startup is done, there are lots of
47 keys to control shell-fm. Here is a alphabetically sorted list.
50 Add the currently played track to your Last.FM playlist.
53 Ban the artist of the currently played track. Whenever a track of that artist
54 is played from now on, it is automatically banned.
57 Ban the currently played track.
60 Enabled/disable discovery mode. I'm not sure if this has any effect, and it
61 looks like even the Last.FM guys don't really know what it does, but I think it
62 is meant to ensure that you get only tracks that you don't know yet.
65 Jump to the fan radio station of the artist of the currently played track.
71 Bookmark the currently played radio station. You'll be asked to hit a digit
72 key. Whenever you hit that key again from now on, shell-fm will jump to that
76 Print some more information about the currently played track.
79 Love the currently played track.
82 Skip the currently played track.
85 Pause. If you pause too long, the stream will break, which has the same effect
86 as stopping the stream (see below).
89 Enable/disable reporting played tracks to your Last.FM profile. Enabled by default.
95 Change radio station. This will prompt you for an Last.FM radio station URI.
96 The tabulator key helps if you don't know what to type. Arrow-Up and Arrow-Down
97 allow you to browse your radio history. Enter these without the
101 For example: `radio url> globaltags/world'
105 Recommend the currently played track/artist/album to another Last.FM user.
111 Jump to the similar artists radio stream of the currently played tracks artist.
114 Tag the currently played track/artist/album. Tabulator key completes known
118 Unlove the currently played track.
121 Print upcoming tracks in playlist.
133 Before you start, you should have created the directories
137 or you will get a lot of warnings, the tab-completion will be extremely
138 slow and you can't make use of some features (auto-ban, history, bookmarks).
139 You might also want to place a configuration file in
141 for a faster startup.
143 This section describes the syntax and options for the shell-fm configuration
144 file. The file should be placed in
145 .B ~/.shell-fm/shell-fm.rc
146 and should consist of simple
149 See (far) below for a sample configuration. These are the available options.
151 .B username = your-login
152 This is your login on Last.FM. If this is provided, shell-fm won't ask you for
153 it on startup anymore.
155 .B password = your-password
156 This is your (clear text) Last.FM password. If this and your login is provided
157 in the configuration, shell-fm won't ask you on startup.
159 .B default-radio = lastfm://...
160 If this is provided (and valid), shell-fm will play this station by default
161 after startup. If there's another station URI given on the command line, it
162 will override this setting.
164 .B np-file = path-to-file
165 If this is defined, shell-fm will print information about the currently played
166 track into the given file, whenever a new track is played.
168 .B np-file-format = format-string
169 This defines how the information written to your now-playing file will look
170 like. There are several format flags available. Have a look at the
172 section for the details.
174 .B preview-format = format-string
175 Format of the track information in the playlist preview (key 'u').
177 .B np-cmd = shell command
178 If this is defined, the given command will be executed whenever a new track
179 starts. The value may contain format flags.
181 .B pp-cmd = shell command
182 If this is defined, the given command will be executed whenever a downloading
183 track ends. The value will have the path to the file appended.
185 .B rate-cmd = shell command
186 If this is defined, the given command will be executed whenever a track is rated.
187 The value may contain format flags, especially %V to get the actual rating.
190 This allows you to color format elements. The
192 may be the letter of any format flag (without percent). The color is just a
193 normal shell color code matching "[01];3[0-7]". Whenever the format element is
194 printed to the console, it will have the given color. Have a look at the
198 .B daemon = something
199 If this is set to something, shell-fm will start in daemon mode by default.
200 Starting with -d as command line option will disable daemon mode.
202 .B key0x?? = shell command
203 This allows you to bind shell commands to free keys (keys that are not used by
206 section above for a list).
208 should be the hex code of the ASCII code of the key. The command you assign
209 will be evaluated (check the
211 section) and executed then. This "feature" allows you to implement own
212 features, like fetching and printing the lyrics of the currently played track,
213 etc. If you have a cool idea or even a working script, I'd be happy if you let
217 This specifies the network interface you want shell-fm to bind to.
219 should be the host name or an IP address of host shell-fm is running on.
220 shell-fm will open a port (see the
222 option below) on the specified interface which you can connect to to control
223 shell-fm remotely (or from local scripts, see
226 .B NETWORK INTERFACE COMMANDS
227 section below for a list of known commands.
229 The network interface has no user authentication, so anyone with access to your
230 network/host can control shell-fm. Use it only if you really need to control
231 shell-fm over a network. Otherwise use the UNIX socket interface (see below).
234 If this is set to a proper path, on that path a UNIX socket will be created for
235 local "remote" control. This socket interface takes the same commands as the
236 TCP socket interface (see above).
238 .B port = port-number
239 With this option you can change the port shell-fm will listen on (if
241 is specified). Default is 54311.
243 .B extern = shell command
244 This allows you to specify an external program or script as player for the
245 streams. If given, shell-fm will run the command and pipe the MP3 stream into
246 it, instead of playing the stream itself. For example,
247 .B extern = madplay -Q -
248 works very fine. This option is meant as a work-around for architectures that
249 shell-fm doesn't work completly profectly on.
251 .B proxy = proxy server
252 This allows you to specify a proxy server for the HTTP requests.
254 .B expiry = some-number
255 This defines the number of seconds until a cached page expires. The default is
256 86400 seconds (24 hours). You shouldn't set a very low value here, since the
257 Last.FM server often are very slow. This mostly affects the prompts (radio
258 prompt, tag prompt, ...), since shell-fm fetches some feeds to get values for
262 Path to the audio device to use (see
264 command line option).
266 .B title-format = format-string
267 This is the format of the track string that is printed to the console for every
268 track played. Default is 'Now playing "%t" by %a.'.
270 .B minimum = percentage
271 With this option you can change the minimum duration a track must have been
272 played to be scrobbled (in percent, but without the % sign). For example, if
273 this option is set to 75, the track will not be scrobbled if it has not been
274 played for at least 75% of its total duration. If you skip or stop the track
275 before it has been played for 75%, it will not be scrobbled. Default is 50%, as
276 specified in the scrobbling protocol version 1.2.
278 .B delay-change = something
279 If this is set to anything, and you change the station with 'r', 's' or 'f',
280 the station-change will be delayed until the currently played track finishes or
281 is skipped. Also they key 'q' will initialize a delayed quit, so after the
282 currently played track shell-fm will exit. 'Q' (uppercase) still quits
285 .B screen-format = format-string
286 If this is set, shell-fm will check if the terminal it's running in is a screen
287 session ($TERM is "screen") and set the screen windows title to the formatted
288 string to be seen on $ESCAPE+w or $ESCAPE+".
290 .B term-format = format-string
291 Works like screen-format, but sets the x-terminals window title.
293 .B download = format-string
294 If this is set to a valid path (may contain format flags), and the played track
295 is free, it is saved at the given place.
298 If this is set to a number, shell-fm will wait that amount of seconds between
301 .B discovery = something
302 Enable discovery mode by default.
304 .B stream-timeout = seconds
305 Users reported that in some regions in the world, Last.FM servers sometimes
306 pretend to stream a track but then don't send anything, which makes shell-fm
307 hang forever waiting for the track data. If you have that problem, use this
308 option to define a stream timeout. When shell-fm is waiting for stream data, it
309 will wait that many seconds and then skip to the next track.
311 .B no-rtp = something
312 Start with RTP disabled.
314 There are several format flags allowed for some options. Here is the list.
326 URL of the album image.
329 Track duration in seconds.
332 Track duration formatted as 'min:sec'.
341 URL of the artists page on Last.FM.
344 URL of the albums page on Last.FM.
347 URL of the tracks page on Last.FM.
350 Remaining seconds of the played track.
353 Remaining time of the played track, formatted as 'min:sec'.
356 Volume level, formatted as 'xx%'.
359 Rating of the current track
360 ('L' loved, 'B' banned, 'S' skipped or empty).
363 Environment variable $HOME.
370 Black (not very useful).
416 .SH NETWORK INTERFACE COMMANDS
417 This section describes the commands shell-fm's network interface knows. To use
418 the interface, you must provide a valid value to the
420 option in your configuration or use the
422 option on the command line. Then you can connect the specified port (54311 by
423 default) and send one command at a time. This is a list of the known commands.
426 Play the given stream.
429 Love the currently played track.
432 Ban the currently played track.
435 Skip the currently played track.
440 .B info some-format-string
441 Evaluate the given format string (check the
443 section) and return the formatted information.
449 Toggle discovery mode on/off.
452 Toggle RTP (scrobbling) on/off. Returns "RTP ON" or "RTP OFF" to indicate status.
454 .B tag-artist some-comma-separated-tags
455 Tag the artist of the currently played track.
457 .B tag-album some-comma-separated-tags
458 Tag the album of the currently played track.
460 .B tag-track some-comma-separated-tags
461 Tag the currently played track.
464 Returns the tags of the currently played tracks artist.
467 Returns the tags of the currently played tracks album.
470 Returns the tags of the currently played track.
476 Increment volume by 1.
479 Decrement volume by 1.
482 Set volume. Volume may be a number between 0 and 64.
485 Set percental volume. %50 is 32, %100 is 64 and so on.
488 Adjust absolute volume. "volume +1" is the same as "volume-up" and "volume -1"
489 is the same as "volume-down".
490 All volumes return the absolute volume (0-64).
493 Detaches from the network interface. Use this to cleanly close your session.
495 This section describes the meanings of the files in $HOME/.shell-fm/. The base
496 directory can be overriden by setting the environment variable $SHELL_FM_HOME
497 to another directory.
500 This file contains the auto-banned artists.
503 This file contains the bookmarked stations in the format "[digit] = [url]".
506 This directory contains cached sites fetched from Last.FM for faster tab-completion etc.
509 If this file exists, it will be used as a template for the output of 'i'. It
510 may contain usual format flags.
513 The radio stations you have listened to. The history is used for the radio prompt.
516 If Shell.FM can't scrobble the data of a track for any reason before you quit,
517 it stores the track data in here and it will try to submit the tracks the next
521 Your configuration file as described above.
524 .B Sample Configuration for shell-fm.rc
528 # shell-fm.rc example
529 username = shellfmlover
530 password = CheckFileIsOnlyReadableByOwner
531 default-radio = lastfm://user/shellfmlover/playlist
532 np-file = /home/shellfmlover/.shell-fm/nowplaying
533 np-file-format = %t:%a:%S:%A
539 .B shell-fm-*.*/scripts/
540 Includes examples of using the network interface plus a color printing script to help with choosing colors.
546 lastfm://user/$USER/personal
547 lastfm://user/$USER/mix
548 lastfm://user/$USER/recommended
549 lastfm://user/$USER/neighbours
550 lastfm://user/$USER/friends
551 lastfm://artist/$ARTIST/similarartists
552 lastfm://artist/$ARTIST/fans
553 lastfm://tag/$TAG1*$TAG2*$TAG3
556 Please send bug reports to <shell-fm@nex.scrapping.cc>.
558 Copyright (C) 2006-2010 by Jonas Kramer.
559 Published under the terms of the GNU General Public License.