Sunday, December 27, 2020

Using Vanilla Gnome on Ubuntu

Ubuntu is perhaps the most popular Linux distro today. It's got a lot of pros if you look at it objectively speaking. The biggest advantage is of course a very strong and active user community. It's also got a good ecosystem for 3rd party apps and an easy application manager (apt) in addition to the default Gnome store. Since it's debian-based its also got a stable release cycle and pretty strong enterprise support. As of today, about half of all websites using Linux run some version of Ubuntu (just under 49% to be precise). CentOS comes a distant second at 18%. 

Personally speaking, I've been using Ubuntu on my machine since quite a number of years. I've experimented with Fedora, Suse, Elementary . . even tried Clear Linux from the Intel stable. But somehow I keep coming back to Ubuntu. However, the one grouse I have against Ubuntu is its stock UI. With Ubuntu 10.10 netbook edition, Mark Shuttleworth launched its new UI shell which replaced Gnome - Unity. Shuttleworth intended the development of Unity to subsume all other device user interfaces. In fact he said as such in an interview that the future of computing is having a unified interface across all devices. In hindsight, that vision was prophetic and right on the money; but messed up in implementation. Unity never really caught on - neither in the desktop/server space or in the mobile phone space. From versions 10.10 through 16.04 (LTS), Canonical gamely battled on and pushed Unity on all releases. They pushed back against criticism through articles, community engagement, interviews and press nuggets. Shuttleworth finally abandoned Unity with Ubuntu 18.04 and reverted to Gnome. However, this transition wasn't smooth either. Lots of users had gotten used to Unity by then (myself amongst them) and a lot of feathers were again ruffled with this news (again, myself included). Grudgingly and reluctantly we prepared ourselves for the transition back to Gnome. However, Canonical has since retained critical elements of the Unity UI as Gnome shell extensions while discarding the actual UI itself. It retained the Unity Dock but abandoned Unity Dash. It switched its window controls to the right but got rid of the maximize and restore buttons by default. I tried it all as god is my witness. I stuck through all the experiments that Canonical did through the Unity phase. But at one point (somewhere around Ubuntu 18.x) I finally had enough. With every Ubuntu installation, I'd install vanilla Gnome on top of it. Inefficient of course, from a resource perspective; but I loved Gnome. It is clean, functional, minimalist and very easy on system resources. Unlike KDE it's got no flashy animations and effects. Unlike Elementary, it doesn't try to ape some other OS UI. It's got its own philosophy and it makes no bones about it - ease and elegance. 

Very recently I really got stuck into Linux as an operating system and amped up my knowledge of the bash shell, the Linux architecture and open source in general with a bunch of online courses and hands-on DIY projects. With this recently acquired knowledge I started to wonder whether I could avoid installation of Gnome separately and try to just switch off Ubuntu-specific UI elements of the OS itself. Turns out its very easy! You don't need to install Gnome on top of Ubuntu to get the vanilla version. The key differences in pure Gnome and "residual" Unity are - 

  • Gnome theme
  • Ubuntu dock
  • Custom scaling (needed on high res systems)
  • Minor tweaks

First off, the default gnome theme is Advaita. This includes the colour palette, the icon-set and the general look/feel. To change this, one has to install the gnome-tweak-tool from the software centre. One can do that with

$ sudo apt install gnome-tweak-tool

Once this is done, just go to launcher using the <super> key and type in  "tweaks". Go to appearance tab and change the default theme to advaita or advaita-dark and you're good to go

The Ubuntu dock is basically a gnome shell extension. You can try to switch if off from the tweaks tool but 9 times out of 10 that doesn't work. The beauty of the Gnome UI is its simplistic default panel. The Ubuntu dock really gets in the way. It doesn't gel well with vlc media player and keeps messing up full-screen mode when watching videos. Next up, we switch off the Ubuntu Dock and revert to basic Gnome panel. To do that, we have to first identify what the dock is called. All extensions are stored as files in usr/share/gnome-shell/extensions folder. Just navigate to this folder in the terminal and list the contents of the folder. Like so - 

In this case (and in most cases), the dock is called ubuntu-dock@ubuntu.com (the syntax is usually <name_of_extension>@<author>). Once you have identified the correct filename, just use the gnome-extensions command to disable it. Like so -

$ gnome-extensions disable ubuntu-dock@ubuntu.com

Voila. The dock is now replaced with the default Gnome panel. 

On high-res systems objects looks really tiny. By default, Ubuntu does not support custom scaling. Ubuntu has two window managers (display server protocols) installed - X11 and Wayland. The command for fractional scaling depends on which one you are using. You can find that out with - 

$ echo $XDG_SESSION_TYPE

Depending on the output, run the following command -

X11/Xorg - $ gsettings set org.gnome.mutter experimental-features "['x11-randr-fractional-scaling']"

OR

Wayland - $ gsettings set org.gnome.mutter experimental-features "['scale-monitor-framebuffer']"

Once that's done, what remains are minor UI tweaks such as restoring the maximize/minimize buttons, adding battery percentage and date to the top bar, switching desktop icons on/off, changing the font to Cantarell and changing the wallpaper (you can download the default Gnome wallpaper from the Gnome repository.

There you have it, once these minor customizations are done; for the most part, you can enjoy the clean, simple and minimalist feel of vanilla gnome. Just as the makers intended.



No comments:

Post a Comment