Skip to content

Custom application to open .gdoc extensions

lmmx edited this page Dec 26, 2014 · 33 revisions

Make a parsing script: /usr/bin/gdocopen.sh

  • cut -d\" -f 4 is the URL, just pass it to google-chrome
google-chrome $(cut -d\" -f 4 "$@")

Make an application to call it: /usr/share/applications/gdocopen.desktop

[Desktop Entry]
Name=gdocopen
Exec=/usr/bin/gdocopen.sh %U
Terminal=false
Type=Application
MimeType=application/vnd.google-apps.document;

Set as default

  • First check gdoc doesn't have an associated mime-type: grep 'gdoc' /etc/mime.types
  • Add it if not: sudo vim /etc/mime.types (as per this)
application/vnd.google-apps.document				gdoc
* Set the `.desktop` file (and associated script) as default application for the new MimeType: `xdg-mime default gdocopen.desktop "application/vnd.google-apps.document"`

Clone this wiki locally