Skip to content

Instantly share code, notes, and snippets.

@Typiqally
Forked from giner/drawio_mime_type.sh
Created November 23, 2021 21:24
Show Gist options
  • Save Typiqally/1ae03f073a2e25ba022bcb55b1fb64a2 to your computer and use it in GitHub Desktop.
Save Typiqally/1ae03f073a2e25ba022bcb55b1fb64a2 to your computer and use it in GitHub Desktop.
Give *.drawio files MIME type to make application association work
#!/bin/sh
# drawio.xml is taken from Draw.io debian package
cat > ~/.local/share/mime/packages/drawio.xml << 'EOF'
<?xml version="1.0" encoding="utf-8"?>
<mime-info xmlns="http://www.freedesktop.org/standards/shared-mime-info">
<mime-type type="application/vnd.jgraph.mxfile">
<glob pattern="*.drawio"/>
<comment>draw.io Diagram</comment>
<icon name="x-office-document" />
</mime-type>
<mime-type type="application/vnd.visio">
<glob pattern="*.vsdx"/>
<comment>VSDX Document</comment>
<icon name="x-office-document" />
</mime-type>
</mime-info>
EOF
update-mime-database ~/.local/share/mime
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment