Archives For November 30, 1999

For dark mode fans, you may found the color scheme in Gedit Text Editor is not so good! Focused line is not even readable due to the light text on light line background.

There’s already an upstream fix, though it’s not made into current Ubuntu releases. There are however workarounds and I’m going to show you how!

Option 1.) Use another color scheme:

There are a few other built-in color schemes available in the default Gedit text editor.

Firstly, open the editor and go to ‘Preferences’ in the hamburger menu. While Ubuntu defaults to the ‘Classic’ colors, you can then choose another from Font & Colors tab.

And new colors take places immediately!

Option 2.) Hack the current line background color:

Sticking to the default color scheme? It’s easy to hack the xml config file to change the current line background.

1.) Firstly, open terminal either from system app launcher or by pressing Ctrl+Alt+T on keyboard.

2.) When terminal opens, run command to edit the xml:

sudo gedit /usr/share/gtksourceview-4/styles/classic.xml

Type user password (no visual feedback) when it asks and hit Enter. When file opens, scroll down to find out and change the background value of ‘current-line’ and ‘current-line-number’.

NOTE: If you stick to dark mode, color #181818 is great! However, it’s not good in light mode. So if you switch between light and dark mode regularly, use another color value, such as #99999c.

After saving the changes, the color will take place in new app window.

This simple tutorial shows how to add a system tray menu option to switch between Dark and Light system mode in Ubuntu.

By default, the System Settings -> Appearance page offers options to choose Standard, Light, and Dark window colors. It however only apply the app theme.

For system menu, notifications, date and time menu, etc, you have to install user themes extension, and change the Gnome Shell theme individually via Gnome Tweak Tool.

Here I’m going to introduce a new Gnome Shell Extension called ‘Ubuntu Appearance‘. With it, you can toggle fully dark and light mode easily via a few clicks.

The extension features:

  • Integrate Light, Dark, Standard option into system tray menu.
  • Toggle fully dark / light mode, not only app window colors but also system theme (e.g., system menu, calendar, notifications.).
  • Option name vary according to current system mode.
  • The user themes extension is not required.

Install Ubuntu Appearance extension:

1.) Firstly, open terminal by pressing Ctrl+Alt+T on keyboard. When terminal opens, run command to install required packages:

sudo apt install chrome-gnome-shell gnome-shell-extension-prefs

2.) Secondly, go to the extension web page and click on the slider icon to install it.

Though the extension says for Gnome 40, it works well in my Ubuntu 20.04 and Ubuntu 21.04 machine.

Don’t see the toggle icon? Click the link ‘Click here to install browser extension’ to install browser extension and refresh the web page.

Once you installed the extension, the option should appear in system menu immediately. Log out and back in or restart Gnome Shell if you don’t see the option.