0

I would like to sync my files with Google docs as described in the answer Is there a Google Drive client available? here.

Which worked, I can see my files.

But I cannot launch them. It seems Nautilus doesn't know which app to associate to the links. I tried associating the files to Chrome but that didn't work.

The links are in this form,

file:///run/user/1000/gvfs/google-drive:host=someplace.com,user=some.place/1994pQkFEF-tcvTMzQWxK4T1ayNEsO22T/5G0KUbR2345ulSg-NOFHQArcPd5KWAe66/4hvj2Wvi9gh1UZFDNQBy8UmbcZB-44LByYVnpQgV6OWM

Files that are non-google-doc type, for example PDFs, do open from Nautilus from my google docs drive account.

2 Answers2

0

Indeed, you cannot launch specific Google doc documents, spreadsheets or presentations. You must open these in Google Docs. In Google Docs, one can convert from the google doc format to LibreOffice or Microsoft formats. In that case, the documents become "regular" files which you will be able to launch in their associated application.

vanadium
  • 88,010
  • Thank you for the explanation. Of the dozen or so posts of adding the Google docs account to Nautilus, it would have been nice if one of them noted that! Would have saved me a day of trying to be hipster cool. – Martin Guthrie Sep 14 '18 at 14:55
  • Any statement that begins with "you cannot" means someone isn't trying hard enough – Evan Langlois May 27 '20 at 03:34
-1

Install this as /usr/share/applications/google-docs.desktop. It's based on guesswork and observations so YMMV ...

[Desktop Entry]
Name=Google Docs
Exec=sh -c "xdg-open https://docs.google.com/document/d/$(basename %f)/edit"
Type=Application
Terminal=false
Categories=Network;WebBrowser;
MimeType=application/vnd.google-apps.document
Evan Langlois
  • 198
  • 1
  • 6
  • Wont work. Please explain basename with google doc. – Ankur Loriya Jun 22 '21 at 07:00
  • I wouldnt have posted it if I wasnt already using it, so "won't work" is obviously false. Basename returns just the filename. This is passed to xdg-open which feeds that name into the URL to open. Google Docs then opens the file. If it isnt working for you, make sure xdg-open is installed. – Evan Langlois Aug 21 '22 at 19:37