You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently if drawio is installed via snapstore, I am unable to launch application by double clicking on the *.drawio file in file explorer. By default ubuntu is considering drawio as text file. This seems to be due the fact that application/vnd.jgraph.mxfile is an unknown mime type in ubuntu.
Would make user's life much simpler if the application delivered via snap allows user to do this
Here is how I fixed the issue in my own Ubuntu 16.04 system
Created a file at ~/.local/share/mime/packages/drawio.xml with the following content
This seems to be the way we make a new mime type available to ubuntu
Update ubuntu mime-database by running update-mime-database ~/.local/share/mime
Copy drawio icon to ~/.local/share/icons/application-vnd.jgraph.mxfile.png from /snap/drawio/current/meta/gui/icon.png
i.e I ran cp /snap/drawio/current/meta/gui/icon.png ~/.local/share/icons/application-vnd.jgraph.mxfile.png
(In case of snap, I see the following directory /var/lib/snapd/desktop/icons. Not sure if the icon needs to be copied here as part of snap installation)
Update ubuntu icon cache so file manager knows that icon exists update-icon-caches ~/.local/share/icons/
Now all drawio files show icon & also I'm able to right click & associate *.drawio files with Drawio application without affecting the default application for rest of the text files using Files application
Extra notes:
I ran gvfs-info test.drawio/gio test.drawio & looked at standard::icon row in the output.
The 1st icon name application-vnd.jgraph.mxfile is the name of png file ubuntu looks for. If its not found, it uses application-x-generic.png as the image as fallback. Once I placed under ~/.local/share/icons/application-vnd.jgraph.mxfile.png, all file icons for *.drawio in the file system show drawio icon. The icon preferred for this 128x128 resolution, but even 1024x1024 (default) also seem to work fine
Someone said elsewhere (I have not tried), we can use /usr/share/mime/packages for mime file xml & /usr/share/icons/ for icon update if we want to do it at system level instead of user level
The text was updated successfully, but these errors were encountered:
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. See the FAQ for more information.
Just an update. With Ubuntu 20.04 (I don't know if the version is relevant), I had to copy the file ~/.local/share/mime/packages/drawio.xml also in the path ~/.local/share/mime/application/drawio.xml. I followed all the other steps indicated by @thekalinga, and it worked for me.
Hello, this affects greatly to GNU/Linux users' UX as currently opening the file will launch the default text editor due to its MIME file type has been incorrectly classified as text/plain, please reopen this issue.
Currently if
drawio
is installed via snapstore, I am unable to launch application by double clicking on the*.drawio
file in file explorer. By default ubuntu is considering drawio astext
file. This seems to be due the fact thatapplication/vnd.jgraph.mxfile
is an unknown mime type in ubuntu.Would make user's life much simpler if the application delivered via snap allows user to do this
Here is how I fixed the issue in my own Ubuntu 16.04 system
~/.local/share/mime/packages/drawio.xml
with the following contentThis seems to be the way we make a new mime type available to ubuntu
Update ubuntu mime-database by running
update-mime-database ~/.local/share/mime
Copy drawio icon to
~/.local/share/icons/application-vnd.jgraph.mxfile.png
from/snap/drawio/current/meta/gui/icon.png
i.e I ran
cp /snap/drawio/current/meta/gui/icon.png ~/.local/share/icons/application-vnd.jgraph.mxfile.png
(In case of snap, I see the following directory
/var/lib/snapd/desktop/icons
. Not sure if the icon needs to be copied here as part of snap installation)update-icon-caches ~/.local/share/icons/
Now all drawio files show icon & also I'm able to right click & associate
*.drawio
files withDrawio
application without affecting the default application for rest of the text files usingFiles
applicationExtra notes:
I ran
gvfs-info test.drawio
/gio test.drawio
& looked atstandard::icon
row in the output.The row looked like the following
standard::icon: application-vnd.jgraph.mxfile, application-x-generic
The 1st icon name
application-vnd.jgraph.mxfile
is the name ofpng
file ubuntu looks for. If its not found, it usesapplication-x-generic.png
as the image as fallback. Once I placed under~/.local/share/icons/application-vnd.jgraph.mxfile.png
, all file icons for*.drawio
in the file system show drawio icon. The icon preferred for this 128x128 resolution, but even 1024x1024 (default) also seem to work fineSomeone said elsewhere (I have not tried), we can use
/usr/share/mime/packages
for mime file xml &/usr/share/icons/
for icon update if we want to do it at system level instead of user levelThe text was updated successfully, but these errors were encountered: