I’m theme-ing of a dark Christmas…

It’s a Christmas miracle — you can now use Raspberry Pi OS in dark mode.

It’s now been a little under two months since the release of the Wayland-based Raspberry Pi OS Bookworm. Whenever we do a major version release like this, we invariably spend the next few weeks fixing all the bugs that real users have found but our pre-release testing didn’t, and then make a bug-fix release with them (hopefully) fixed.

This has taken a few weeks longer this time, simply due to the sheer amount that changed under the hood in Bookworm, but the bug-fix release is now ready and can be installed from today via Raspberry Pi Imager, or downloaded from the usual place on our website. Or, to upgrade an existing image, simply use the updater icon on the taskbar, or (if you’re more old-school) open a terminal and do sudo apt update followed by sudo apt full-upgrade.

This update includes improved support for encrypted connections in WayVNC; the latest version of Thonny; Mathematica and Scratch 3 working on Raspberry Pi 5; and a bunch of other small bug fixes and tweaks. But we thought we’d give you a little pre-Christmas bonus in this release too…

A few weeks ago, Eben wandered past my desk, and he remarked, “wouldn’t it would be nice if we had a dark theme?” (He’s not the first person to suggest this, of course, but he is the boss, so I tend to pay more attention when he suggests things!) And as it happened, I wasn’t particularly busy that day.

The lovely and easy on the eye dark mode in use on a desktop

Our PiXflat theme has been around for a few years now — we launched it along with Raspberry Pi OS Buster back in 2019. It started out as a mildly tweaked version of the default GTK theme called Adwaita, but it changed quite a bit over the years, so now doesn’t have all that much in common with Adwaita any more.

A theme is basically a big CSS (cascading style sheet) file, as is used for styling web pages, e-books and the like, which defines the appearance of every widget used to draw applications. (A widget is a user interface element such as a button or a text label.) You can set the colour, the font, the background and numerous other aspects for each widget, and you can set different values depending on whether the widget is active (e.g. a button which is being pressed), whether it is disabled, whether the mouse pointer is over it, and so on. And when I say it is a “big” file — it’s really big: PiXflat is around 4500 lines.

Creating a dark theme can be relatively easy, or really hard, depending on how the colours have been defined in your original theme. If all your colours are defined as variables, it is relatively easy — but if all your colours are hard-coded values, then it is rather more time-consuming. And of course, in PiXflat, as in Adwaita before it, the colours were all hard-coded! So the first job was to go through 4500 lines of CSS and find all the hard-coded colours, replacing them with variables, and then setting those variables to the original hard-coded values so I didn’t break the original light theme.

Then, having done that, it was time to consider how each one of those colours should change to produce a suitable dark appearance. The obvious first step was simply to invert each colour, so that black became white, dark grey became light grey, and so on. The trouble with doing it simplistically like this is that while what you end up with is indeed dark — it is the equivalent of looking at the current desktop as a photographic negative — it doesn’t usually look that good.

So then the hard work began — choosing exactly what contrasting colour was going to be used in the dark theme to replace the light version. This involved setting the values of around 70 colour variables to create a set that worked together; you have to take into consideration having sufficient contrast between elements so that you can still see everything clearly, so that text is still readable against darker backgrounds, so that the colour change when you move the mouse over an element is still obvious, and so on. And it all interacts, so you find that if you tweak one colour, you then need to go in and tweak four or five others to keep all the contrast correct.

From past experience with PiXflat, creating a theme is very much like the proverbial painting of the Forth Bridge; it’s never really finished, because you keep seeing little tweaks you can make. But the theme which I have called PiXnoir — the dark version of PiXflat — is now ready to use; like PiXflat it will doubtless continue to evolve over time, but the first version is included in this release.

We’ve made it easy to switch between the themes. Just open ‘Appearance Settings’ from the ‘Preferences’ section of the main menu, go to the ‘System’ tab, and switch the ‘Theme’ option from ‘Light’ to ‘Dark’. Most applications will load the new theme on the fly, but some applications — particularly Geany and Calculator — use their own internal themes as well, so you’ll need to close those first if they are running in order to get the theme to change.

There are a few applications — Thonny is one — which don’t use a theme, so cannot be given a dark appearance, but pretty much all our other standard applications will theme as intended. So do please have a play and see which you prefer — and may all your Christmasses be dark…

45 comments
Jump to the comment form

Kris avatar

Thonny has dark themes too: Tools –> Options –> Themes & Fonts. The Raspberry Pi Dark theme is really cool ;-)

Reply to Kris

bensimmo avatar

The download links still mentions and points to the previous version.
Readme is correct and I can see the file there in the archive.

Reply to bensimmo

Simon Long avatar

It taks a while for our webservers to sync up changes – it should be up later today. It’s already available in RPi Imager.

Reply to Simon Long

A Stevens avatar

Excellent to see Scratch3 fixed. Weirdly, it still segfaults on my fully-updated (as of 3 days ago) 64-bit install on a Pi 5; but it runs fine on a fresh bookworm 64-bit install on a Pi 4. I need to be really sure it’s fixed, as we use this a lot in our school code club, on Pi 400s. I’ll be testing one tomorrow with the new OS – hopefully, if all is well, I’ll roll it out to all the other machines over Christmas!

Reply to A Stevens

GrahamJ avatar

The new version (3.30.5) of Scratch is showing up in the menu option “Other” rather than “Programming” (Pi 5, Bookworm, fully updated). It’s not available to add to “Programming” from Appearance Settings. Is this correct? Thanks.

Reply to GrahamJ

Simon Long avatar

That’s a bug – we’ll get it fixed!

Reply to Simon Long

bensimmo avatar

I can’t believe I didn’t notice this on my beta test* of this, sorry.

*Although it was a very quick test I did, I did pop through the menu opening things to check they worked.

I was going to test the dark setup through some other monitors and give feedback but been ill, so not had the chance. It’s nice to see the option, hopefully Eben walks through again and thinks it would be nice to have a high-contrast version too. Although it does sound a bit of a nightmare to do these skins.

Reply to bensimmo

Simon Long avatar

Nooooo! I’m only doing one theme a year, max – I currently see CSS in my sleep ;)

Although in all seriousness, having restructured the theme to enable dark mode, adding additional themes should in theory be quite a bit less work now.

Reply to Simon Long

NickMon avatar

When you get bored could you consider a “raspberry” coloured one ?

Simon Long avatar

I sincerely hope to never get that bored… ;)

Anyway, I’m a recovering Goth – I only understand blacks and greys; I don’t do colours!

Aye, it's Pi avatar

No such thing as a recovering Goth…it’s Nephilim or nothing 😎

Anders avatar

I suspected when I saw PixFlat scroll past on the update.
Does anyone have any tips for a bigger taskbar on a 4K monitor? I have 32×32 large set, it’s a bit msmall still.

Reply to Anders

Simon Long avatar

There’s the option for 48×48 (very large), which is what I use on a 4K monitor.

Reply to Simon Long

Anders avatar

Thank you. It was there all the time, I just didn’t see it (because it aligns with the textfield when the drop down is clicked).

I’m using it and it’s much better.

Reply to Anders

Chivar Pilones avatar

this is niiiice maybe you guys can also consider the pling website and ocs-url installer so its easier to add themes ive been using sweet xfce on my bullseye pi’s

Reply to Chivar Pilones

andrum99 avatar

Worth mentioning that the improved encryption support in wayvnc means that you can now connect to a Pi running wayvnc using the RealVNC client. On the previous release of Raspberry Pi OS this was not possible – you had to use TigerVNC to connect to wayvnc.

Reply to andrum99

Ton van Overbeek avatar

I tried with the RealVNC client, it does connect but then only shows ‘Cannot currently show the desktop’.
I still have to select in raspi-config -> Advanced Options – X11 Openbox window manager with X11 backend.
I am running headless (no monitor connected to RPi 5)

Reply to Ton van Overbeek

Ton van Overbeek avatar

Replying to myself.
It does work. When switching to Wayland (in raspi-config) you have to reenable the VNC server which then removes the Realvnc server, enables the wayvnc server and generates the necessary keys.

Reply to Ton van Overbeek

UKScone avatar

smh dark theme is for vampires

Reply to UKScone

Simon Long avatar

Oi! I was wearing all black clothes in the early 80’s before Goth was even a thing… ;)

Reply to Simon Long

Liz Upton avatar

Sisters of Mercy started in 1980, and Echo and the Bunnymen in 1978. IT WAS A THING. :P

Reply to Liz Upton

Simon Long avatar

Ah, but the Sisters of Mercy have always denied being Goth! To quote the rather wonderful Andrew Eldritch, “The media picked up on the fact that we wore black clothes for about three weeks during one of our silly dressing-up phases, and we’ve been stuck with the label ever since…” Any time I’ve seen them live, they’ve mostly been wearing Hawaiian shirts.

To be fair, Goth really started with the likes of Bauhaus in the late 70’s – but then no-one really knew about it, because they weren’t on Top Of The Pops. Goth only really broke out at my school when the likes of The Mission and The Sisters appeared on TV. And I was in black long before then… ;)

Reply to Simon Long

Liz Upton avatar

I feel old now.

UKScone avatar

Bauhaus was on repeat in the WCFE Student Union lounge most days because the SU President was a fan and we were all scared of her so we just hung out in the cafeteria instead

Stu avatar

Last time I saw the Sisters of Mercy they were supporting Depeche Mode at Crystal Palace Sports Ground in 1993 and they were very much, to quote a Mode song, Dressed in Black. I’ve just realised that was 30 years ago now I feel old.

tim Rowledge avatar

Tried a UI update on Pi5 and it failed with a complaint about
“Error instaling packages- The following packages have unmet dependencies: raspi-utils: Breaks: libraspberrypi-bin (<= 1:2+git20231018~131943+3c97f76-1)"

A cli update worked without apparent problems. Of course there is some chance that having done the UI attempt might have affected what the cli update did but I can't think of any way to replicate it now.

Reply to tim Rowledge

Simon Long avatar

OK, so this is a known problem…

We had a bug in the updater plugin, which meant that updates which required the removal of packages failed. The update to raspi-utils required the removal of a package, so that would have failed if attempted via the updater (but would have worked via the CLI), but we had the additional problem that if we pushed out the update to the updater which fixed the bug at the same time as we pushed out the update to raspi-utils, neither update would have been able to load.

So in an attempt to get around this, we pushed the fix for the updater bug a few weeks ago and held off on releasing the raspi-utils update until we’d hoped enough people would have installed the previous update – you were clearly someone who didn’t!

Updating via CLI would always work anyway, but now you have the updated updater, you shouldn’t have any more problems.

Reply to Simon Long

W. H. Heydt avatar

4500 lines? Feh! In one job, I was maintaining a program with 11,000 lines of assembly language. In another job, I wrote a COBOL program with 11,000 lines of procedure code (that is, 11K lines not including the data definitions).

Reply to W. H. Heydt

Karagir avatar

On Zero 2 W, after installation and reboot, I make sure that Hotspot works, USB drive is mounted, Samba share is configured correctly, Bluetooth audio receiver works etc. Then, I reboot again and enable overlay file system and make boot partition read-only. After after reboot, I lose everything: SSH, Hotspot…it leaves me with no option but to go back to Bullseye. The is true with te release version as well as the just updated version of Bookworm x64 Lite OS. Kindly suggest. Thanks in advance!!

Reply to Karagir

raspberry400 avatar

There is a bug where icons on windows are misplaced for example when i oopen configure vpn it shows the mu ide icons. pi 400

Reply to raspberry400

Alex avatar

I think WiringPi isn’t working after this update :/

Reply to Alex

Liz Upton avatar

WiringPi hasn’t been maintained in some years (I’m friends with the creator, and he’s moved on to other things) – it’s never worked under Bookworm. If you really need the library, you might want to stick with older hardware.

Reply to Liz Upton

Alex Way avatar

Yes, I understand. However, is what we are instructed to use in our university course. It was working just fine prior to the update I did last night. If I switch to another like pigpio, then I will have to rewrite all my code and hope the professor will understand LOL

Reply to Alex Way

Burni avatar

Love the dark mode!
Quick question as I’m a Raspberry noob – can anyone tell me how to switch between two language layouts on a keyboard in Raspberry OS? I cannot seem to find a function that can add a second layout and switch between the two.

Reply to Burni

Simon Long avatar

https://github.com/WayfireWM/wayfire/wiki/Configuration#input tells you how to do it by editing config files – use commas to separate the layouts you want, and then define a hot-key to switch between them.

Having a nice GUI way to do this is on the to-do list, but I haven’t got around to it quite yet…

Reply to Simon Long

Donald Hall avatar

What is this obsession with dark mode? My 75 year old eyes need all the light they can get in order to see anything. I need a torch to read a screen in dark mode!

Reply to Donald Hall

Simon Long avatar

It’s not compulsory! Light mode is still in there and it’s not going anywhere…

Reply to Simon Long

Donald Hall avatar

I do realize that. I just don’t understand why dark mode is considered so wonderful!

Reply to Donald Hall

Alex avatar

Can’t wait to try dark mode, it’s the only thing I was waiting for after all my favourite apps work well under Bookworm on Pi 4. Especially Mixxx plays much better. Thanks all!

Reply to Alex

John Guymon avatar

Dark mode was a great idea. However, changes made in Appearance Settings are not being saved…like Picture (wallpaper), Text Colour, etc.

Reply to John Guymon

Simon Long avatar

They are saving fine for me. Something in your configuration files may be corrupted – I suggest you go to the Defaults tab and reset to defaults before trying again.

Reply to Simon Long

EveryPizza avatar

let’s go they saw my feature request

Reply to EveryPizza

Alex avatar

This is great how about a dark splash boot screen too?

Reply to Alex

beta-tester avatar

an ‘inverted’ Raspberry Pi desktop background picture would be nice to complete the dark theme.

Reply to beta-tester

Taz avatar

How come the improved support for encrypted connections in WayVNC which is alleged to get RealVNC back in operation not being officially accepted?
Documentation page denies this.
https://www.raspberrypi.com/documentation/computers/remote-access.html#vnc

Specifically where it talks about TigerVNC vs RealVNC and still give steps for TigerVNC, but not RealVNC.
“NOTE
Previous versions of Raspberry Pi OS supported client connections from RealVNC. In Raspberry Pi OS Bookworm or later, RealVNC is no longer supported. Instead, you can connect using TigerVNC.”

Reply to Taz

Leave a Comment