This is a simple Lua script for mpv
that sends notifications about the playing media.
It uses notify-send(1)
and should therefore work
with any libnotify-compatible notifications daemon.
It reports title, album and year if available,
and shows a cover image if present
in the same directory as the media file
(embedded images aren’t currently supported).
Either copy/link notify-send.lua
into $XDG_CONFIG_HOME/mpv/scripts
,
or set script=/path/to/notify-send.lua
in mpv.conf
or on the command line.
If you use Nix(OS) then you can install default.nix
directly
or use the included overlay.nix
in your configuration.nix
:
{ pkgs, ... }:
{
nixpkgs.overlays = [
# ...
(import /path/to/mpv-notify-send/overlay.nix)
];
# ...
environment.systemPackages = with pkgs; [
# ...
mpv
mpv-notify-send
];
environment.pathsToLink = ["/share/mpv"];
}
You can then link <nix profile>/share/mpv/scripts/notify-send.lua
(e.g. /run/current-system/sw/share/...
on NixOS,
$HOME/.nix-profile/share/...
when using nix-env
)
into $XDG_CONFIG_HOME/mpv/scripts
.
mpv-notify-send is licensed under the WTFPL.