Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Script to associate .mpv.edl files with MPV (including by header)
# Sources:
# -
# -
echo "* Adding file-type icons..."
for SIZE in 16 32 64; do
echo "* Adding ${SIZE}px icon"
xdg-icon-resource install --context mimetypes --size "$SIZE" "/usr/share/icons/hicolor/${SIZE}x${SIZE}/apps/mpv.png" application-x-mpv-edl
echo "* Adding file-type definition..."
cat > edl-mime.xml << EOF
<?xml version="1.0" encoding="UTF-8"?>
<mime-info xmlns=''>
<mime-type type="application/x-mpv-edl">
<comment>MPV Edit Decision List</comment>
<magic priority="50">
<match type="string" value="# mpv EDL" offset="0" />
<glob pattern="*.mpv.edl"/>
xdg-mime install edl-mime.xml
rm edl-mime.xml
echo "* Adding mime type association to MPV"
sed 's@\(audio/x-mpegurl;\)@\1application/x-mpv-edl;@' /usr/share/applications/mpv.desktop > ~/.local/share/applications/mpv.desktop
echo "* Updating desktop application database"
update-desktop-database ~/.local/share/applications
echo "* Updating mime type database"
update-mime-database ~/.local/share/mime
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.