Skip to content

Instantly share code, notes, and snippets.

@giner
Last active August 17, 2023 13:50
Show Gist options
  • Star 5 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save giner/0eb272c11085036c4438413f6de0e454 to your computer and use it in GitHub Desktop.
Save giner/0eb272c11085036c4438413f6de0e454 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