8

Is there a way to (quickly) turn on a dark mode in Ubuntu with GNOME, e.g. 18.04 and higher? And how is possible to have a dark mode of the different apps?
I agree with this article: Ubuntu Needs to Make it Easier to Enable Dark Mode (OMG! Ubuntu)

There are some answers for Ubuntu with Unity but they are not helpful for Ubuntu with GNOME:
How can you enable GTK3 themes' dark theme mode when using Unity 7? - Ask Ubuntu
Is there any fast switch between light mode and dark mode (light/dark theme) in 16.04? - Ask Ubuntu

2 Answers 2

12

For easy and quick toggling from Dark to Light theme and vice versa install this GNOME extension:

Invert the color of individual windows only (Default shortcut is Super+I): use the Globe Extension Invert Window Color. Thank you Sam!

Ubuntu 20.04: You can now easily choose a dark mode within the Settings: Appearance > Window colors > Dark. There is no possibility to set a time to have an automatic switch based on time, though (without a GNOME extension, see above).

For a Full Dark Mode of the system (incl. System tray menu, top-bar calendar, notification popups, and desktop context menu) you need some more steps:

  1. Install GNOME Tweaks and other tools if you don't have them, then reboot/restart. In a terminal:
    sudo apt install -y chrome-gnome-shell # Works with Firefox*, too.
    sudo apt install -y gnome-shell-extensions 
    sudo apt install -y gnome-tweak-tool 

(*) Firefox add-on for GNOME Shell integration in Firefox.
2. Install user themes GNOME Shell extension:
https://extensions.gnome.org/extension/19/user-themes/
3. Turn on user themes GNOME extension in GNOME Tweaks or in the GNOME extensions app.
4. Log out and back in to your session OR manually restart GNOME Shell (Alt + F2, type r, hit enter) for the theming extension to actually be activated.
5. Launch GNOME Tweaks and navigate to Appearance in the left pane, choose Yaru-dark as the Shell theme! More details and source: [How to Enable Dark Gnome Shell Menus, Calendar in Ubuntu 20.04 | UbuntuHandbook]

GNOME 42 Now Supports 'Dark Wallpaper' Option: When the (new standardised) dark mode setting is enabled a ‘dark’ version of the default wallpaper is applied. When light mode is enabled, a ‘light’ version of the wallpaper is applied.
For more information see OMG! Ubuntu!.

In the future this answer may be shorter, read this GNOME blog article on Dark Style Preference.

But the Dark Theme Toggle does not make some of the apps fully dark and you have to do some further configuration:

LibreOffice: (adapted from Debugpoint.com)

  1. Open LibreOffice. Open any component – Writer, Calc etc.
  2. From menu, click Tools -> Options.
  3. Go to Application Colours, select document background as Black. You can also choose the Application background as Black.
    There may be more custom color settings you like to adapt. For example, Remove the gray background from Table Of Contents: Modify the color setting in Text Document, ☑ Index and table shadings. (Or disable it: ☐ Index and table shadings.)
  4. Some special formatting, e.g. links were not shown well on my computer, I chose a lighter colour for the unvisited and visited links.
  5. If you would like to change to a dark icon theme, change it from "View" options on the left side for better visibility of the toolbar icons, e.g. choose "Breeze (dark) as icon style.

Update 2021/08: With LO 7.2 you get a new LibreOffice dark mode colour scheme. This is designed to compliment the dark theme enabled by your system. To enable it, head to:
Alternative Tools ▸ Options ▸ LibreOffice ▸ Application Colors theme 'LibreOffice Dark' and "apply" it.

There is a also a dark theme to install: RaitaroH/LibreOffice-BreezeDark: Icons, color palette and color scheme for LibreOffice

Firefox:
Enable Dark Mode in Firefox, see HowToGeek for details.

  • Click menu > Add-ons > Themes, choose Dark theme.

To view the webpages in dark colours, use an add-on. Two tested options:

  1. Dark Reader:
  • Handy keyboard short-cut to toggle: Shift-Alt-D
  • It promises that "it does not show ads and doesn't send user's data anywhere. It is fully open-source."
  • It may cause more CPU use, though.
  1. Dark Background and Light Text
    Before you install disable similar extensions.
    Handy keyboard short-cut to toggle: F9
  2. Midnight Lizard Before you install disable similar extensions.
    Handy keyboard shortcuts to toggle extension:
      - on current website: Alt+Shift+L
      - globally: Alt+Shift+M

PDF viewer (e.g. Evince document viewer): See Is there any pdf viewer with dark mode? - Ask Ubuntu
Go to the options on the top right corner (Sandwich menu). Then select Night Mode or Inverted colours.

Wire messenger (How to install Wire messenger on Ubuntu):
Go to preferences, then Options, choose dark theme.

Thunderbird
With TB 78+ you can choose a dark theme (open add-on page and choose themes on the left side).
In Settings>General>Fonts&Colors>Colors>Text and Background: You can choose the colour of text and background (possibly uncheck "Use system colors").
Apart from that there are some dark theme add-ons with more tweaks (with TB 91+ some themes won't work anymore).

Audacity:
The theme to use can be selected at Edit > Preferences > Interface
You can also change the colour of the waves without selecting a theme.
And more sophisticated (source: OMG!Ubuntu):

  1. Download the Audacity Clean Dark Theme pack
  2. Extract the .zip
  3. Copy ImageCache.png from the named colour folder you want
  4. Paste file into ~.audacity-data/Theme (if the directory doesn’t exist, create it)
  5. Open Audacity > Preferences > Interface
  6. Select ‘Custom’ theme option

Calibre: See How do I get a dark theme/night mode in Calibre? - Ask Ubuntu

Qt Apps: Make them follow System Light/Dark Style in Ubuntu 22.04

sudo add-apt-repository ppa:ubuntuhandbook1/qgnomeplatform
sudo apt install qgnomeplatform-qt5

NOTE: Ubuntu 23.04 and Ubuntu 23.10 users can directly run the last apt install command without adding PPA. (For details see Ubuntu Handbook)

5
  • 1
    Is there a way to install the user themes extension with apt? Apr 24, 2020 at 14:35
  • @AaronFranke Thank you for your edit! Good question, I did not find a package for user themes with Synaptic Packages.
    – Filbuntu
    Apr 24, 2020 at 15:47
  • 1
    Once you install Gnome Tweaks, you can also install the Invert Window Color extension, to invert colors of individual windows. extensions.gnome.org/extension/1041/invert-window-color
    – Sam
    Feb 23, 2021 at 10:18
  • I want this dark mode feature everywhere but firefox. How can I achieve this? May 10, 2021 at 7:17
  • @ajinzrathod Not sure which part of Firefox you don't want to be dark. I am not sure how to exclude a dark Firefox window decoration if you enable the Ubuntu system dark mode/theme. But maybe Sam's comment regarding the invert window color extension can help you. If you don't want the pages or tabs dark, you don't install a "dark theme" add-on and don't turn on the dark theme of Firefox.
    – Filbuntu
    May 10, 2021 at 14:01
7

If you are a terminal user, adding those lines to ~/.bashrc or ~/.zshrc might come in handy, since you can change the theme with a single command (for Ubuntu 20.04):

function dark {
    gsettings set org.gnome.desktop.interface gtk-theme 'Yaru-dark'
}

function light {
    gsettings set org.gnome.desktop.interface gtk-theme 'Yaru'
}

Now just type "light" or "dark" on your command line.

For the Cinnamon-Desktop (used by Linux Mint), the settings look a bit different:

function dark {
    gsettings set org.cinnamon.desktop.wm.preferences theme 'Mint-Y-Dark'
    gsettings set org.cinnamon.desktop.interface gtk-theme 'Mint-Y-Dark'
    gsettings set org.cinnamon.desktop.interface icon-theme 'Mint-Y-Dark'
    gsettings set org.cinnamon.theme name 'Mint-Y-Dark'
}

function light {
    gsettings set org.cinnamon.desktop.wm.preferences theme 'Mint-Y'
    gsettings set org.cinnamon.desktop.interface gtk-theme 'Mint-Y'
    gsettings set org.cinnamon.desktop.interface icon-theme 'Mint-Y'
    gsettings set org.cinnamon.theme name 'Mint-Y'
}
1
  • The function does not work for me... Mar 13 at 11:04

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .