Jump to content
Flirc Forums

Support MPRIS 2.2 on Linux


Recommended Posts



on Linux, there is a specification for supporting 'Media Player Remote Interfacing' [http://specifications.freedesktop.org/mpris-spec/latest/]. Very many Linux Media Player really adhere to this specification (e.g. vlc, banshee, rhythmbox). Sometimes, a plugin is needed, for example XMBC needs http://wiki.xbmc.org/index.php?title=Add-on:MPRIS_D-Bus_interface .


It would be very cool if Flirc would support MPRIS 2.2 on Linux. I guess that this would beak down to the following:


  • Provide a special keyboard layout in the Flirc application the could map the MPRIS functionality.
  • Provide a software daemon that translates the Flirc dongle (emulated) key strokes to MPRIS DBus events.

Kind regards,



Link to comment
Share on other sites

  • 2 weeks later...



how many commands need to be assigned?


It should be doable by combining 3 things (I don’t know if this will work or not, but it should):

Doing it the way described below does not leak any key press events to any other application


  1. we could use the remaining free 'usage page 7' HID commands for that purpose, although that can be considered a hack, as those are undefined and may be redefined to whatever later(unlikely).
    Those key values don’t generate any high-level key press event, so we define dead keys that will not interfere with existing applications.
    We will use them later at the RAW device level.
    look here for free values under usage page 7, everything above 0xE7 seems to be free: http://code.metager.de/source/xref/NetBSD/src/lib/libusbhid/usb_hid_usages
  2. use mpris-remote as a MPRIS CLI interface.
    We need to work out a set of commands that do what we want and note them down.
    link: http://incise.org/mpris-remote.html
  3. As a user daemon we can use Touché, that is designed for exactly this purpose, namely binding otherwise dead keys to useful features:

    link: https://github.com/GuLinux/Touche
    We use this program to connect the keys with the mpris-remote commands:
    Bind the keys at the HIDRAW level to those mpris-remote commands (look at the README below)


Touché README (extract, second half is important):

Touché is an application aimed at making "just work" every key on your keyboard.
It's still in heavy development stage, and therefore is missing lots of stuff, but it's already usable.
The current "reference" keyboard is mine, a "Microsoft Wireless Keyboard 3000".
The "standard" special keys, like "Media Play", or "Volume Up" do work out of the box on every GNU/Linux distribution,
but other keys, like "ZoomIn/Out", and the "1-2-3-4-5-*" keys in the upper part don't. Instead they send an event to /dev/usb/hiddev0.
Touché does detect these events, and allows you to transform them to known X key symbols, or to execute arbitrary commands.
Support for new keyboards should be easly added, the application does print the events when they're sent, so they can be added in a ney "keyboard database" entry.

Touché is released under GPLv3 license (included in the COPYING file)


command line tool for interacting with music players that support the mpris spec


The software is there (except for the Flirc GUI profile, but we can use the CLI to program the Flirc hardware using flirc_util record_api command)

We just need to cleverly combine what is available

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...