I know #Kodi ! I love #VLC ! But since i learned to know #MPV is LIVE it! Looks like nothing, but is everything one could ever want. However the default configuration really needs some personal touch to make it work for me.
Today i fixed my urge to have a media player function that just trashes/moves the media file that is playing back with a simple key stroke. (somewhat similar to kodi, but way easier to achieve!)
To use my solution just download the following shell script and execute it. It will automatically deploy a small helper shellscript to your personal home directory (~/bin/) for MPV to use and adds a new key binding to your personal mpv input configuration ( ${HOME}/.config/mpv/input.conf ) with pretty much no effort.
The next time you playback a bunch of media files and find a piece of “trash” all you need to do is press the key combo that we bind to that helper script (ctrl+t by default). It will move the recent media file to a trash folder, will skip playback to the next item in playlist and will display a (OSD) message to give you feedback that mpv “took care” about the file. This should make “sorting your shit out” real easy!
Have fun! — Axel Werner 2026-01-25 13:18
#!/usr/bin/env bash # mpv-install-trashIt-key.sh set -euo pipefail # ---------- Configuration ---------- MPV_CONF_DIR="${HOME}/.config/mpv" INPUT_CONF="${MPV_CONF_DIR}/input.conf" BIN_DIR="${HOME}/bin" HELPER_SCRIPT="${BIN_DIR}/mpv-trash-and-next.sh" # BINDING_LINE with a OSD Message: # - Large font (\fs50) (font size) # - Red color (\1c&H0000FF&) (rgb) # - ms duration (2000ms) BINDING_LINE='Ctrl+t run /bin/bash '"${HELPER_SCRIPT}"' ${path}; playlist-next; show-text "{\\fs50}{\\1c&H0000FF&}File blacklisted!" 2000' # ---------- Setup ---------- mkdir -p "${BIN_DIR}" mkdir -p "${MPV_CONF_DIR}" # ---------- Install Helper Script to Users home bin/ ---------- cat > "${HELPER_SCRIPT}" <<'EOF' #!/usr/bin/env bash # # MPV NOTE: # MPV will call this script with an single # argument , the full qualified path to # the media file that is been played # at the moment. # MEDIA_FILE=$1 MEDIA_DIR=$(dirname "$MEDIA_FILE") BLACKLIST_DIR="$MEDIA_DIR/../blacklist" [[ -z "$MEDIA_FILE" ]] && exit 1 # NOTE: NO NEED to mkdir -p "$BLACKLIST_DIR" ! mv -t "$BLACKLIST_DIR/" "$MEDIA_FILE" EOF chmod +x "${HELPER_SCRIPT}" # ---------- Install MPV key binding ---------- touch "${INPUT_CONF}" if ! grep -Fq "${HELPER_SCRIPT}" "${INPUT_CONF}"; then echo "${BINDING_LINE}" >> "${INPUT_CONF}" echo "Added key binding to ${INPUT_CONF}" fi echo "Installation complete!"