20

Back on 21.10, just picking whichever theme, dark or not, in GNOME Tweaks, set the desktop to that theme.

Now on 22.04, due to the switch of some apps to libadwaita I assume, you need to set Dark/Light mode in the Appearance section of the system Settings for it to register (whether for GTK3 or GTK4 apps). The problem is, the Appearance section isn't available when using the GNOME session, that is to say not the default Ubuntu one but the "base" GNOME session without Ubuntu modifications. Probably because the system ships with version 41.4 of the control center and not version 42.

I can set it using this command:

gsettings set org.gnome.desktop.interface color-scheme prefer-dark

But surely there has to be a way to do so in UI? If not, that's a really poor user experience to have in a LTS release...

Philippe Lepaffe
  • 492
  • 1
  • 5
  • 13
  • many of the issues in the user experience will be addressed by the time the first point release of 22.04 LTS is released. You just need to make sure that you file appropriate bug reports to aid the process. – graham May 01 '22 at 15:42
  • I filed a report for it, hopefully that will amount to something! – Philippe Lepaffe May 01 '22 at 21:38
  • Why are you using the GNOME login vs the Ubuntu login (where all of this would work)? – heynnema May 01 '22 at 22:40
  • I will admit that's definitely an option, albeit an imperfect one still: On the Ubuntu session, switching between dark and light in the control center also switches to the Yaru theme associated with it and the icon theme to Yaru, but the fact is if you don't want to use Yaru or its icon theme (which is my case) you then have to go back in Tweaks to re-set things up. And the vanilla Shell theme (which fits Adwaita) isn't an option at all.

    But more importantly, no matter what one's reason for using it is, Ubuntu does have a GNOME login, and therefore it should be feature complete.

    – Philippe Lepaffe May 02 '22 at 11:51

2 Answers2

21

I have created two command aliases for switching themes, one for light, and one for dark. It switches everything.

//dark
alias dark='gsettings set org.gnome.desktop.interface gtk-theme Adwaita-dark \
&& gsettings set org.gnome.desktop.interface color-scheme prefer-dark'
//light
alias light='gsettings set org.gnome.desktop.interface gtk-theme Adwaita \
&& gsettings set org.gnome.desktop.interface color-scheme prefer-light'

Ivan V.
  • 391
  • 2
  • 7
11

You can use GNOME Shell extensions:

  • The awesome Night Theme Switcher GNOME Shell extension provides many options to automatically or manually set the theme you prefer. It also provides a handy panel button to easily switch between themes.

    Night Theme Switcher configuration

    If you decide to use it, make sure to also go to the Themes tab and enable the Switch GTK theme and Switch Shell theme options.

    Night Theme Switcher Themes tab

    This solves the issue of some applications not changing theme due to Ubuntu 22.04 having a mismatch of GNOME versions (some apps use GNOME 42 while others use GNOME 41).

  • Another nice and simple extension that you can use is Light/Dark Theme Switcher. It just sets a panel button that allows switching between your light and dark theme.


Regarding your comment:

But surely there has to be a way to do so in UI? If not that's a really poor user experience to have in a LTS release...

The default session that Ubuntu ships is the Ubuntu session. Installing gnome-session leads to a GNOME session, which provides an experience closer to the default GNOME experience, so Ubuntu cannot really be blamed for issues like the one you're facing.

  • I don't really agree they can't be blamed for it at all when it wouldn't be an issue if they shipped gnome-control-center in version 42. If that was the default GNOME 42 experience yes, but the fact is GNOME 42 ships with that options in the settings. Ubuntu backported that feature for the Ubuntu session the the 41 version of the control center, but that makes the GNOME session lack what should be there.

    I'll check the extensions you mentioned, thanks.

    – Philippe Lepaffe May 01 '22 at 16:54
  • @PhilippeLepaffe Hey! You know what, you're right! They don't ship the latest control center version! I'm taking back that statement. In previous versions gnome-session was bringing a vanilla GNOME session. It seems that this is not the case anymore. – BeastOfCaerbannog May 01 '22 at 17:01
  • 1
    @BeastOfCaerbannog it always has been "vanilla" with the Ubuntu twist: whatever default versions of the Ubuntu desktop uses also appears in the Gnome session. – vanadium May 02 '22 at 07:15
  • @vanadium Makes sense. – BeastOfCaerbannog May 02 '22 at 07:35
  • 1
    To add, in 22.04 they opted to keep the core apps that GNOME had migrated to GTK4 for GNOME 42 (like gnome-control-center) in their GNOME 41 version because they didn't want core apps to ship with libadwaita (as that's not the same design language as Yaru, and they can't just theme those). – Philippe Lepaffe May 02 '22 at 11:40
  • Night Theme Switcher did not work properly for me, but Light/Dark Theme Switcher works perfectly, thanks. – tobias_k May 17 '23 at 09:49