Configuration

From the Man Page for Shell-fm:

SETUP
Before you start, you should have created the directories ~/.shell-fm and ~/.shell-fm/cache or you will get a lot of warnings, the tab-completion
will be extremely slow and you can’t make use of some features (auto-ban, history, bookmarks). You might also want to place a configuration file
in ~/.shell-fm for a faster startup.

CONFIGURATION
This section describes the syntax and options for the shell-fm configuration file. The file should be placed in ~/.shell-fm/shell-fm.rc and should
consist of simple key = value assignments. See (far) below for a sample configuration. These are the available options.

username = your-login
This is your login on Last.FM. If this is provided, shell-fm won’t ask you for it on startup anymore.

password = your-password
This is your (clear text) Last.FM password. If this and your login is provided in the configuration, shell-fm won’t ask you on startup.

default-radio = lastfm://…
If this is provided (and valid), shell-fm will play this station by default after startup. If there’s another station URI given on the com‐
mand line, it will override this setting.

np-file = path-to-file
If this is defined, shell-fm will print information about the currently played track into the given file, whenever a new track is played.

np-file-format = format-string
This defines how the information written to your now-playing file will look like. There are several format flags available. Have a look at
the FORMAT FLAGS section for the details.

np-cmd = shell command
If this is defined, the given command will be execute whenever a new track starts. The value may contain format flags.

?-color = color
This allows you to color format elements. The ? may be the letter of any format flag (without percent). The color is just a normal shell
color code matching "[01];3[0-7]". Whenever the format element is printed to the console, it will have the given color. Have a look at the
COLORS section for a list.

key0x?? = shell command
This allows you to bind shell commands to free keys (keys that are not used by shell-fm, check the USAGE section above for a list). ??
should be the hex code of the ASCII code of the key. The command you assign will be evaluated (check the FORMAT FLAGS section) and executed
then. This "feature" allows you to implement own features, like fetching and printing the lyrics of the currently played track, etc. If you
have a cool idea or even a working script, I’d be happy if you let me know.

bind = host
This specifies the network interface you want shell-fm to bind to. host should be the host name or an IP address of host shell-fm is run‐
ning on. shell-fm will open a port (see the port option below) on the specified interface which you can connect to to control shell-fm
remotely (or from local scripts, see key0x?? above). Check the NETWORK INTERFACE COMMANDS section below for a list of known commands.

port = port-number
With this option you can change the port shell-fm will listen on (if bind is specified). Default is 54311.

extern = shell command
This allows you to specify an external program or script as player for the streams. If given, shell-fm will run the command and pipe the
MP3 stream into it, instead of playing the stream itself. For example, extern = madplay -Q - works very fine. This option is meant as a
work-around for architectures that shell-fm doesn’t work completly profectly on.

proxy = proxy server
This allows you to specify a proxy server for the HTTP requests.

expiry = some-number
This defines the number of seconds until a cached page expires. The default is 86400 seconds (24 hours). You shouldn’t set a very low value
here, since the Last.FM server often are very slow. This mostly affects the prompts (radio prompt, tag prompt, …), since shell-fm fetches
some feeds to get values for the tab-completion.

device = path
Path to the audio device to use (see -D command line option).

title-format = format-string
This is the format of the track string that is printed to the console for every track played. Default is ’Now playing "%t" by %a.’.

minimum = percentage
With this option you can change the minimum duration a track must have been played to be scrobbled (in percent, but without the % sign).
For example, if this option is set to 75, the track will not be scrobbled if it has not been played for at least 75% of its total duration.
If you skip or stop the track before it has been played for 75%, it will not be scrobbled. Default is 50%, as specified in the scrobbling
protocol version 1.2.

delay-change = something
If this is set to anything, and you change the station with ’r’, ’s’ or ’f’, the station-change will be delayed until the currently played
track finishes or is skipped.

FORMAT FLAGS
There are several format flags allowed for some options. Here is the list.

%a Artist name.

%t Track title.

%l Album name.

%d Track duration in seconds.

%s Station name.

%S Station URL.

%A URL of the artists page on Last.FM.

%L URL of the albums page on Last.FM.

%T URL of the tracks page on Last.FM.

%R Remaining seconds of the played track.

COLORS
0;30 Black (not very useful).

1;30 Dark gray.

0;31 Red.

1;31 Light red.

0;32 Green.

1;32 Light green.

0;33 Dark yellow/brown.

1;33 Yellow.

0;34 Blue.

1;34 Light blue.

0;35 Violet.

1;35 Pink.

0;36 Turquoise.

1;36 Cyan.

0;37 Gray.

1;37 White.

  • Here is a way to set up shell-fm as a UNIX Daemon
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-NonCommercial 3.0 License