mpv-bash-completion

Featureful Bash completion for the mpv video player · Linux/BSD/OSX

View the Project on GitHub

mpv-bash-completion

Latest release: 3.3.15

A script for generating a Bash completion script for the popular mpv video player. It features…

Supported OSs

Source code

The main repository is on Github.

git clone https://github.com/2ion/mpv-bash-completion.git

Tarballs of tagged releases can be downloaded here.

Dependencies

Note on older mpv versions: The mpv command line has changed considerably since version 0.25, making it impossible to support older versions due to the huge number of special cases that would need to be covered. For compatbility with older mpv releases, please use a historic version of mpv-bash-completion.

Optional dependencies

Supporting inputrc configuration

We recommend the following setting for a snappier completion experience: To the file ~/.inputrc, add the line

set show-all-if-ambiguous on

Launch a new shell to use the setting.

Installation

You can just generate the completion script or build a package for one of the supported platforms.

Platform-agnostic method

# You may set the following environment variables beforehand:
# export MPV_BASHCOMPGEN_VERBOSE=1 # verbose debug/progress output
# export MPV_BASHCOMPGEN_MPV_CMD=mpv # path or command to execute mpv, defaults to 'mpv'

./gen.lua > mpv.sh
source ./mpv.sh

Arch Linux

Install mpv-bash-completion-git from the AUR. It will install all necessary dependencies and also ships a pacman hook which automatically rebuilds the completion file whenever you update mpv so it’s not necessary to install the package every time.

Debian

.deb packages can be downloaded directly here.

Stable (Jessie)

Install via BunsenLabs. Set up the bunsenlabs-hydrogen repository as described here, then execute:

sudo apt-get update && sudo apt-get install mpv-bash-completion

Testing & Sid; Ubuntu Xenial

These currently contain mpv 0.14 for which the below package is built.

Install via the BunsenLabs unstable repository. Set up the unstable repository as explained here, then execute:

sudo apt-get update && sudo apt-get install mpv-bash-completion

mpv git builds / custom package build

You can build a package on Debian testing or unstable, or if your mpv’s version is greater than approximately 0.14. Jessie’s version of mpv is too old.

sudo apt-get install debhelper mpv lua5.3 dpkg-dev git
git clone https://github.com/2ion/mpv-bash-completion.git
cd mpv-bash-completion && git checkout debian
dpkg-buildpackage -us -uc -b # Install the resulting package: dpkg -i $package

OSX Homebrew

Note: Since I do not have access to a Mac computer anymore, I cannot maintain this formula any longer. I am leaving it here for the time being hoping it is still working.

You can simply install using the provided formula. You need to reinstall every time you upgrade mpv in order to update the completion function to match the current mpv build.

brew tap 2ion/mpv-bash-completion https://github.com/2ion/mpv-bash-completion.git
brew install --HEAD mpv-bash-completion