8

I want to mount/unmount my google drive using google-drive-ocamlfusewith a key binding without having to open a terminal. How can I set this up?

0

2 Answers 2

13

Short answer:

Mounting

/bin/bash -c "google-drive-ocamlfuse ~/path/to/foldershowinggoogledrive"

where path/to/foldershowinggoogledrive is the path relative to your homedir.

e.g. /home/you/googledrive -> ~/googledrive

No need for sudo!

Unmounting

Similarly, to unmount, if you use ~, you should use in a shortcut:

/bin/bash -c "fusermount -u ~/relative/mountpount"

Or if you use absolute path:

fusermount -u /absolute/path/to/mountpoint

Why /bin/bash -c?

You could use

google-drive-ocamlfuse /absolute/path/to/folder

but since you are using ~, you need the expansion handled by bash.

Binding commands has been explained within How to bind custom commands to keyboard shortcuts?: System Settings -> Keyboard -> Custom Shortcuts -> + button


EDIT

Just noticed ODrive which works substantially different. ODrive actually downloads the files and synchronizes with Google Drive, similar to how the Windows version of Google Drive works.

enter image description here

The big advantage -at least to my experience- is the immediate response to editing & saving, while the previously mentioned solutions have a huge delay on the work process during saving.

7
  • imgur.com/Ae2TKZA Feb 11, 2019 at 23:15
  • @EODCraftStaff SOmething must be wrong in your setup or your account. This is the official command. Using it everyday. Feb 11, 2019 at 23:24
  • @EODCraftStaff That' s a bummer. Just tried a second ago to be absolutely sure. It works. Feb 11, 2019 at 23:27
  • @EODCraftStaff 15 GB of google drive should be free, so depending on your needs you may not have to buy anything at all Feb 12, 2019 at 1:30
  • 1
    I think your box is messed up. It's a one-time thing normally @EODCraftStaff Feb 12, 2019 at 10:38
2

Gnome online accounts can do this for you. It may be already installed but if not you can find it in the software center or download it for your Ubuntu version and architecture here. Now you can connect your google account to gnome through Settings->Online Accounts. If Online Accounts isn't present in the list log out and back in again.

Choose Google from the list of Online Accounts and sign in with your credentials.

Gnome will request permissions to Access which you'll have to accept. If you are asked for your keyring password (usually your login password) provide it.

Click on the Google Account.

Flip the files switch on and then close the Window.

Open Nautilus and you should see a networked drive option that matches your google account on the left pane. Click on that and enjoy access to your google drive!

Sources:

https://www.maketecheasier.com/mount-google-drive-ubuntu/

Testing

3
  • Both options are not optimal if it comes to read/write speed. OP's option reads/writes slow, but still substantially faster than this one. Feb 11, 2019 at 23:02
  • "Click on the Google Account Flip the files switch on and close the Window." Consider rewriting this sentence a bit. I found it a little unclear. There's a flip switch ? or is it called Google Account Flip menu ? Otherwise, +1 Feb 12, 2019 at 1:28
  • @SergiyKolodyazhnyy apologies for the run on sentence. Corrected.
    – Elder Geek
    Feb 12, 2019 at 13:06

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .