Google drive in Nautilus

GNOME 3.18 added the ability to access Google Drive directly from Files (Nautilus). To use this feature, all you have to do is add your Google account to GNOME Online Accounts and enable "Files":

Webupd8 had a nice tutorial of which I made a summary for my own use.

Ubuntu 16.04 Xenial Xerus already includes GNOME 3.18 for the most part however, because Unity doesn't use GNOME Control Center (also known as GNOME System Settings or just Settings) and GNOME Online Accounts and instead, it ships with a fork (unity-control-center), it doesn't include this feature by default.

Even so, you can use the GNOME 3.18 Google Drive integration in Unity as well as other desktop environments, as long as you use Ubuntu (and derivatives: Xubuntu, etc.) 16.04 Xenial Xerus. This won't work with Ubuntu versions older than 16.04!

Before proceeding, note that the using this, Google Drive is mounted via GVfs, so so any change you make in the Google Drive folder on your computer is reflected in your Google Drive account (and the other way around), but you won't have access to other features available in the official Google Drive Windows/Mac clients as well as unofficial Linux clients, like sharing files, etc.

For a fully featured unofficial Google Drive client for Linux, see Insync, but that will cost you $25 per googledrive account.

Access Google Drive from Unity

1. Install GNOME Control Center (GNOME System Settings):

sudo apt-get install gnome-control-center

2. Open GNOME System Settings and add your Google account to GNOME Online Accounts.

Search for "Settings" in Dash and click it - this should launch GNOME System Settings.

Important: GNOME System Settings (GNOME Control Center) shows up as "Settings" in Dash. "System Settings" is the Unity System Settings.

You can also launch GNOME System Settings via "Run Command" (ALT+F2) or a terminal, by typing:

gnome-control-center

Or, to directly launch GNOME Online Accounts, you can use:

gnome-control-center online-accounts

Here, add your Google account and make sure "Files" is enabled:

That's it. You should now be able to access your Google Drive files from the Files (Nautilus) app:

Access Google Drive from Xfce and other desktop environments

There are a couple of differences between using the GNOME 3.18 Google Drive integration in Unity and in other desktop environments.

Installing GNOME Control Center in Ubuntu with Unity is not a big issue dependency-wise because Unity is built on top of GNOME 3, so there are just a few extra packages that are installed along with GNOME Control Center.

In other desktop environments however, there are more GNOME Control Center dependencies that aren't installed - and thus they will be installed when installing g-c-c -, and some might not like that. This depends on the desktop environment you're using but even so, the dependencies installed with GNOME Control Center shouldn't pollute your menu with unwanted items (other than GNOME Control Center, obviously), like it's the case when installing multiple desktop environments.

1. Install GNOME Control Center (GNOME System Settings):

sudo apt-get install gnome-control-center

2. Launching GNOME Control Center

There are two ways you can launch GNOME Control Center and get it to display all its panels under non-Unity/GNOME desktop environments:

    • using a simple command to launch GNOME Control Center with GNOME as the XDG_CURRENT_DESKTOP (a);
    • editing the GNOME Control Center .desktop file, which will make it available in your menu (b).

a) Using a command to launch GNOME Control Center

To launch GNOME Control Center with all the available panels in non-GNOME/Unity desktop environments, you can use the following command:

XDG_CURRENT_DESKTOP=GNOME gnome-control-center

b) Editing the GNOME Control Center .desktop file

To get GNOME Control Center to show up in the menu, copy /usr/share/applications/gnome-control-center.desktop to ~/.local/share/applications/ (create this folder if it doesn't exist) and remove "OnlyShowIn=GNOME;Unity;" from the .desktop file.

That's because the line above sets GNOME Control Center to only show in the menu under GNOME and Unity.

To make it easier, you can use the following commands to perform all the actions described above:

mkdir -p ~/.local/share/applications/
cp /usr/share/applications/gnome-control-center.desktop ~/.local/share/applications/
sed -i '/^OnlyShowIn/d' ~/.local/share/applications/gnome-control-center.desktop

GNOME Control Center should now show up in the menu, as "Settings":

Next, we need to get GNOME Control Center to display all the available panels. By default, this is how it looks in non-GNOME/Unity desktop environments:

To get GNOME Control Center to display all the available panels, you need to change the line that starts with "Exec=", and add "env XDG_CURRENT_DESKTOP=GNOME" (without the quotes) between "Exec=" and "gnome-control-center". After changing it, the "Exec" line should look like this:

Exec=env XDG_CURRENT_DESKTOP=GNOME gnome-control-center --overview

You can do this automatically, by using the following command:

sed -i 's/^Exec.*/Exec=env XDG_CURRENT_DESKTOP=GNOME gnome-control-center --overview/' ~/.local/share/applications/gnome-control-center.desktop

All the available GNOME Control Center panels should now be displayed, including Online Accounts:

3. Add your Google Account to GNOME Online Accounts and access Google Drive from your file manager.

All you have to do now is launch GNOME Control Center using one of the two methods I wrote about above, and under "Online Accounts", add your Google account (and make sure "Files" is enabled):

After authorizing Online Accounts to access your Google account, you'll be able to access your Google Drive files via whatever file manager you're using - like Thunar if you use Xfce: