Use GNOME 3.18 Google Drive Integration Feature In Unity, Xfce And Other Desktop Environments [Ubuntu 16.04]

GNOME 3.18 online accounts
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!

For a fully featured unofficial Google Drive client for Linux, see Insync.

 

Access Google Drive from Unity

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

sudo apt-get install gnome-control-center
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:

GNOME 3.18 online accounts Ubuntu
Google Drive Nautilus
Google Drive Nemo

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.

Here are a couple examples:

  • extra packages that are installed along with gnome-control-center in Xubuntu 16.04 (Xfce)
  • extra packages installed with gnome-control-center in Ubuntu MATE 16.04 (MATE desktop)

And the second difference is that GNOME Control Center doesn’t show up in the menu in non-GNOME/Unity desktop environments AND it requires setting XDG_CURRENT_DESKTOP=GNOME to display all its panels. But we’ll get to that below, in the instructions.

That being said, let’s proceed.

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

sudo apt-get install gnome-control-center

2. Launching GNOME Control Center

  • 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

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.

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”:

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

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.