Fixing a Broken GTK Theme on Chrome OS

A recent Chrome OS update sent some of my Linux apps back to the late 90s. Here's how to fix that.

Background

A lot of graphical applications for Linux are built using one of several open source GUI frameworks, such as GTK, Qt, or wxWidgets. These are roughly analogous to Cocoa on macOS, or parts of the Windows API (or WinRT) on Windows. Some well known applications developed with these toolkits include VLC Media Player (Qt), GIMP (GTK), or Audacity (wxWidgets).

Since I spend most of my Chrome OS time in either Chrome, or Visual Studio Code (which is HTML 5, CSS, and JavaScript, wrapped with Electron), I didn't notice the change right away. However, both of the affected applications (Inkscape, and GIMP) were GTK-based, so I started there. Traditional Linux desktops (such as KDE, and XFCE; or GNOME systems with GNOME Tweaks installed) have a dedicated section in the settings app for choosing GTK themes.

Chrome OS does not include this in its settings, so I had to dig deeper.

The Quick Fix

Fortunately, a thread on Ask Ubuntu pointed out that GTK settings can be modified in the Terminal app, through the gsettings utility. This was already installed (likely as a GTK dependency), so I was able to check the current theme with the following command:

gsettings get org.gnome.desktop.interface gtk-theme

This revealed that the currently set theme is called CrosAdapta. This is a Google-made fork of the Adapta GTK theme, which mimics the look and feel of Google's Material Design. Somehow, this package had been uninstalled from the system, so GTK presented its default, unstyled look. Fixing this was as simple as reinstalling the package from the terminal:

sudo apt install CrosAdapta