Dark Theme in WSL2
Implement a “dark theme” for GUI apps in Windows Subsystem for Linux (WSL2)
To enact a “dark theme” in Ubuntu 22.04, I installed GNOME Tweaks:
sudo apt install gnome-tweaks
Then I configured the following settings:
gsettings set org.gnome.shell.ubuntu color-scheme prefer-dark
gsettings set org.gnome.desktop.interface gtk-theme Yaru-dark
gsettings set org.gnome.desktop.interface color-scheme prefer-dark
gsettings reset org.gnome.shell.ubuntu color-scheme
Graphical apps such as Nautilus and Firefox were then displayed with a “dark theme”.
Comments
3 responses to “Dark Theme in WSL2”
Got an error in Ubuntu WSL2:
rnd22x@DESKTOP-2KLAXDX:~$ (process:46887): dconf-WARNING **: 18:27:31.451: failed to commit changes to dconf: Could not connect: No such file or directory
I had the same issue with the dconf-WARNING. I found this thread https://github.com/microsoft/WSL/issues/10947, which mentioned adding the line
export $(dbus-launch)
to my .bashrc file.
After doing that, I was able to run the commands without error and get the desired effect.
After:
> gsettings set org.gnome.shell.ubuntu color-scheme prefer-dark
Got an error:
failed to commit changes to dconf: Could not connect: No such file or directory