Adding Music Player Support
From MercuryWiki
[edit]
Mercury 2.0 Unstable
Mercury supports displaying many music players' current track info by default. If your music player is not supported, you can add support for this in Mercury 2.0 Unstable. For this, you will need to add an xml file in the settings directory/AppData/MusicPlayerInfo folder. This xml file can have any name you like as long as it ends with ".xml". You can also have multiple xml files in this directory each supporting different music players.
(The contents of this xml file will have the same layout as program directory/AppData/MusicPlayerInfo/default.xml so you can also use that as a reference.)
- Make sure your new xml file contains at least the following:
<?xml version="1.0" encoding="UTF-8"?> <Mercury> <!-- Add your music player support here --> </Mercury>
- For every music player you wish to add support for in this xml file, you'll need to insert a MusicPlayerInfo section between the <Mercury> and </Mercury> tags as follows:
<MusicPlayerInfo PlayerName='%PLAYER%' Restriction='%OS%'> <CurrentSong> <-- insert command/script here --> </CurrentSong> <IsPlaying> <-- insert command/script here --> </IsPlaying> <CurrentSongFile> <-- insert command/script here --> </CurrentSongFile> <CurrentSongArtwork> <-- insert command/script here --> </CurrentSongArtwork> </MusicPlayerInfo>
- You have to change %PLAYER% to the name of your player. This will be the name used in Mercury for selecting this player, so it doesn't have to be an exact name for your player as long as it's not the same as any existing player's name in Mercury.
- You also have to change %OS% to reflect which OS you want this script to be run on. You can choose one of the following values for this:
- FreeBSD
- Linux
- MacOS
- MacOSX
- Windows
- None of the tags within the <MusicPlayerInfo> tags are mandatory, but if you want your current song to display, you will at least need the <CurrentSong> section. Within each of these tags you can enter a command or script that returns the relevant value from your player for that tag. (You'll need to refer to your music player's documentation for instructions on how to get these values from a command or script)
Note: For players that implement the D-bus MPRIS interface, like Amarok 2, XMMS2 and Audacious, you can check the MPRIS Specification for more information on what can be retrieved
These are the descriptions for the tags currently being used:- CurrentSong: should return the information you wish to display on the currently playing song. Enables displaying the current song in your MSN nickname
- IsPlaying: should return true if the song is currently playing, false otherwise. Enables displaying the current song only when it is actually playing.
- CurrentSongFile: should return a path to the current song (e.g. "/home/user/music/artist/album/songtitle.mp3"). Enables sending the currently playing song over MSN.
- CurrentSongArtwork: should return a path to the current song's cover art. Enables displaying album art of your currently playing song as your display picture automatically.
- Mercury will use the text that these scripts output as the current song information, so your current script should only output the information you wish to display as current song (e.g. with an "echo" command).
- After restarting Mercury you should be able to see your newly added Music Player in the dropdown box for the Music Player in the MSN/Display name menu in your Account preferences.
