-
Notifications
You must be signed in to change notification settings - Fork 7
Custom application to open .gdoc extensions
lmmx edited this page Dec 26, 2014
·
33 revisions
-
cut -d\" -f 4is the URL, just pass it togoogle-chrome
* Make it executable: `chmod +x /usr/bin/gdocopen.sh`google-chrome $(cut -d\" -f 4 "$@")
/usr/share/applications/gdocopen.desktop
[Desktop Entry]
Name=gdocopen
Exec=google-chrome $(cut -d\" -f 4 %U)
Terminal=false
Type=Application
MimeType=application/vnd.google-apps.document;
- First check
gdocdoesn't have an associated mime-type:grep 'gdoc' /etc/mime.types - Add it if not:
sudo vim /etc/mime.types(as per this)
* Set the `.desktop` file (and associated script) as default application for the new MimeType: `xdg-mime default gdocopen.desktop "application/vnd.google-apps.document"`application/vnd.google-apps.document gdoc
- Remove the line and from
/etc/mime.typesand do it through XML sudo vim /usr/share/mime/application/vnd.google-apps.document.xml
<?xml version="1.0" encoding="utf-8"?> <mime-type xmlns="http://www.freedesktop.org/standards/shared-mime-info" type="application/vnd.google-apps.document"> <glob pattern="*.gdoc"/> </mime-type>
- Update the system:
sudo update-mime-database /usr/share/mime
👎 👎 👎 👎 👎 👎 👎 👎 👎 👎 👎 doesn't bloody work
-
update-mime-databasedeletes the xml file every time and variations onExec=commands fail -
file --mime-type -b ./GoogleDrive/University/{FILE}.gdocremainstext/plain
sudo ln -s /usr/bin/gdocopen.sh /usr/bin/gdocopen
#!/bin/bash gdocurl=$(cut -d\" -f 4 "$@") google-chrome "$gdocurl"
- This works in the terminal, but fails when selected as default application in Nautilus
- Changing MimeType in the .desktop file associated with the Nautilus application to
text/plainsorts it