Adds a button in your browser's context menu to open either the hovered-over image/link or the current webpage on MPV.
only works on linux currently.
- install mpv.
- clone the repo.
- run
cargo build -rin order to build the handler program. - run
sudo ./target/release/protocol_handler register, this will add the .desktop entry to your/usr/share/applicationsfolder, associating allmpv://urls to the handler. - in order to install the extension from the
./extensionfolder you will need to use either firefox nightly or firefox developer, by zipping the contents of the./extensionfolder, going toabout:addonsand installing the zipped extension from file. otherwise, you can download one of the releases and install that.
- run
sudo .target/release/protocol_handler remove. - remove the extension if you installed it to your browser.
- delete the downloaded files.
# flake.nix
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-25.11";
open_in_mpv.url = "github:Juliapixel/open_in_mpv";
};
outputs = { self, nixpkgs, your-project, ... }: {
nixosConfigurations.my-nixos-system = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
specialArgs = { inherit open_in_mpv; };
modules = [
# ... other modules
./configuration.nix
];
};
};
}# configuration.nix
{ pkgs, open_in_mpv, ... }: {
programs.firefox = {
enable = true;
policies = {
Extensions = {
Install = [
"https://github.com/Juliapixel/open_in_mpv/releases/download/v1.0.3/c70ef7cd6f344053b5b0-1.0.3.xpi"
];
};
};
};
environment.systemPackages = with pkgs; [
# ...
open_in_mpv.packages.${pkgs.system}.default
mpv
# ...
];
}