Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/hoyon/mpv-mpris
MPRIS plugin for mpv
https://github.com/hoyon/mpv-mpris
linux mpris mpv
Last synced: about 2 months ago
JSON representation
MPRIS plugin for mpv
- Host: GitHub
- URL: https://github.com/hoyon/mpv-mpris
- Owner: hoyon
- License: mit
- Created: 2017-06-07T16:08:29.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2024-07-14T09:10:57.000Z (6 months ago)
- Last Synced: 2024-08-02T15:37:18.717Z (5 months ago)
- Topics: linux, mpris, mpv
- Language: C
- Homepage:
- Size: 71.3 KB
- Stars: 589
- Watchers: 10
- Forks: 35
- Open Issues: 19
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-mpv - mpv-mpris - On Linux allows controlling mpv using standard media keys. (Other)
README
# mpv-mpris
`mpv-mpris` is a plugin for mpv which allows control of the player using
standard media keys.This plugin implements the MPRIS D-Bus interface and can be controlled using
tools such as [playerctl](https://github.com/acrisci/playerctl) or through many
open source desktop environments, such as GNOME and KDE.## Compatibility
This plugin requires mpv to be built with `--enable-cplugins` (default as of mpv 0.26)
and to be built with Lua support (to enable loading scripts).## Loading
mpv will automatically load the plugin from the following directories:
- `/etc/mpv/scripts`: for all users
- `~/.config/mpv/scripts`: for current usermpv can also manually load the plugin from other directories:
```
mpv --script=/path/to/mpris.so video.mp4
```## Install
Packages are available for many [distributions](https://repology.org/project/mpv-mpris/versions).
For 64-bit x86 Linux a pre-built version is [available here](https://github.com/hoyon/mpv-mpris/releases)
and can be copied into one of the mpv scripts directories documented above.A self-built `mpris.so` file can be installed with `make install` and will
be installed to the appropriate mpv scripts directory for your current user
or to the mpv system wide scripts directory for all users when you install as root.## Build
Build requirements:
- C99 compiler (gcc or clang)
- pkg-config
- mpv development files
- glib development files
- gio development files
- libavformat development filesBuilding should be as simple as running `make` in the source code directory.
## Test
Test requirements:
- mpv (for loading the mpv mpris plugin)
- mpv-mpris plugin (installed or self-built)
- playerctl (for sending MPRIS commands via D-Bus)
- dbus-send (from dbus, for sending MPRIS commands via D-Bus)
- sound-theme-freedesktop (for a file to play in mpv)
- bash (for running the test scripts)
- dbus-run-session (from dbus, for simulating a D-Bus session)
- xvfb and xauth (for simulating an X11 session)
- jq (for mpv IPC JSON generation and parsing)
- socat (for passing JSON to/from mpv IPC sockets)
- awk (for redirecting parts of mpv stderr logs)Testing should be as simple as running `make test` in the source code directory.
The stderr of the tests will be empty unless there are mpv/etc issues.
The tests accept these environment variables as parameters:
- `MPV_MPRIS_TEST_PLUGIN`: the mpv mpris plugin file to test, must be
readable and executable, defaults to the self-built one. Set it to an
empty string to only load and test an already installed mpv mpris plugin.
- `MPV_MPRIS_TEST_PLAY`: the file to play during tests, defaults to
`/usr/share/sounds/freedesktop/stereo/alarm-clock-elapsed.oga`.
Use a file at most 10 seconds long or the tests will take a long time.
- `MPV_MPRIS_TEST_MPV_IPC`: dir for mpv IPC, default is test dir.
- `MPV_MPRIS_TEST_DBUS`: dir for D-Bus sockets, default is test dir.
Sets the `XDG_RUNTIME_DIR` env var so D-Bus uses the dir.
- `MPV_MPRIS_TEST_XAUTH`: dir for Xauthority files, default is test dir.
- `MPV_MPRIS_TEST_LOG`: dir for mpv/socat logs, default is test dir.
- `MPV_MPRIS_TEST_TMP`: dir for temp files, default is test dir.
Sets the `TEMPDIR`, `TMPDIR`, `TEMP` and `TMP` env vars.
- `MPV_MPRIS_TEST_NO_STDERR`: disable extra printing of the errors printed
to stderr. This is for when the test scenario already does this.These parameters are useful for running the tests in alternate test scenarios.
## D-Bus interfaces
Implemented:
- `org.mpris.MediaPlayer2`
- `org.mpris.MediaPlayer2.Player`Not implemented:
- `org.mpris.MediaPlayer2.TrackList`
- `org.mpris.MediaPlayer2.Playlists`