Dark theme not respected on Linux
-
Hey, so more and more sites and extension decide whether to display light or dark mode based on the browser's theme.
This doesn't work on Vivaldi on Linux. Even though I literally selected the theme called "Dark" and all the sites still display in light mode.
It works on Firefox on Linux. And recently I had to install Windows for some school stuff and found out, that on Windows, this feature works well in Vivaldi and the sites and extensions display in Dark mode (one example is the Bitwarden extension). -
@geeshta Known issue with Linux dark themes (KDE, GTK). No fix yet.
-
-
@DoctorG said in Dark theme not respected on Linux:
@geeshta Known issue with Linux dark themes (KDE, GTK). No fix yet.
The code for theming Vivaldi and sites is independent of the desktop environments ability to be themed.
-
@geeshta said in Dark theme not respected on Linux:
Even though I literally selected the theme called "Dark" and all the sites still display in light mode.
The site style does not follow the used Vivaldi dark theme, such feature is not implemented.
-
Oh ok I thought prefers-color-scheme checks the browser theme. Now I know it checks the OS settings. Still a missing feature for Linux though. Works on Firefox.
-
@geeshta I tested now: dark browser theme switching website rendering to dark is only valid for MS Edge and Firefox.
In Vivaldi this is missing or a bug, i do not know which.
Found in internal tracker, could be related to this bug:
VB-84145 "Setting dark mode in vivaldi has no effect on webpages that are following system theme." - Confirmed. -
There is a workaround. You can set a startup flag to force dark mode ⇒
--force-dark-mode
. Edit your according.desktop
file and add this flag, then all pages and extensions will display in dark mode, should they support it. I’m using this flag for over a year now. -
@luetage said in Dark theme not respected on Linux:
There is a workaround. You can set a startup flag to force dark mode ⇒
--force-dark-mode
. Edit your according.desktop
file and add this flag, then all pages and extensions will display in dark mode, should they support it. I’m using this flag for over a year now.Can you explain how to set this flag? I begin on Linux and I don't know to do settings like that, it would be very useful.
I'm running on Linux Mint 21 Cinnamon.
-
@Had179 Check whether you can find a
vivaldi-stable.desktop
file in/usr/share/applications
. If so, open it in a text editor and look for a line starting withExec=
. Add the--force-dark-mode
flag to the executable. But depending on desktop environment you can also create a shortcut starting Vivaldi with the flag, or you can start it from the terminal with the flag. -
@luetage Thank you. It works, but I can't modify the
.desktop
file because I have not permission (the owner of the file isroot
) and I must create a shortcut or start from the terminal to execute the flag. -
@Had179 You can change the file with sudo. In the long run you would have to create a batch script to automatically make the change in the desktop file after every update, e.g.
#!/bin/bash sudo sed -i "s,Exec=.*,THE_LINE_AS_IT_IS_NOW_+_THE_FLAG," /usr/share/applications/vivaldi-stable.desktop
-
@luetage I'm sorry, but the command doesn't work. The
Exec=
part at the begin of the line disapear and the file become unusable. -
@Had179 No need to apologize, I know it’s not the most user friendly thing out there. If you want to use it, you will have to read up on batch scripting and sed and try it out until you have something that works for you.