How to force light mode

Hey,
there is an annoyance that I can not solve myself. I use Libreoffice on Mac, Windows, Linux. On all systems I use the system’s “dark mode”. So LibreOffice is also using dark mode.
But I just cannot work properly with LO in dark mode. This is really important to me.

I did not find a solution for forcing LO to light mode. Under “colors” I can change a few colors manually. But the main windows, menu’s, etc… stay in dark mode.

I hope you can help me.

Kind regards

Pragomer

1 Like

Revert to an older version or wait a little, see

1 Like

Go to Tools > Options > View > Mode == Light.

I am using the latest version 7.5.5.2, Windows 10 x64) as of writing this comment. So, make you sure you have the latest version. I’ve heard the older versions don’t have this feature.

I’m on Debian / Linux with a LO 7.5.5.2 - setting has no effect as of now there, will retest with 7.6 and might file a bug in Debian. Another debian based user had the issue and I posted how I got to see the light

1 Like

Create an XDG desktop entry override for the LibreOffice components you want to use, for example ~/.local/share/applications/libreoffice7.5-writer.desktop You can copy the installed ones from /usr/share/applications as a starting template.

Override the Exec= line to look similar to this:
Exec=GTK_THEME=Adwaita libreoffice7.5 --writer %U

Then rebuild the menus:
kbuildsycoca5 # for KDE, not sure about other desktop environments

If you use KDE make sure (important!) libobasis-{version}-kde-integration is uninstalled:
apt purge libobasis7.5-kde-integration

Here’s a Python script I wrote called libreoffice-menu-update which will automatically do all of the above after a LibreOffice upgrade (for Debian). Just update the vrs variable at the top with the version you’re updating to:

#!/usr/bin/python3

# Script to create/update LibreOffice XDG menu entry overrides to force the light theme
# This script is for Debian but may work with other Debian-based distros
# Created by Dhya O

from shutil import copy
from pathlib import Path
from string import Template
import subprocess

vrs = "7.5"  # the version of LibreOffice
prepend = "GTK_THEME=Adwaita"  # The theme to be applied
srcdir = "/usr/share/applications/"
dstdir = str( Path.home() ) + "/.local/share/applications/"

# Uninstall libobasis<version>-kde-integration
subprocess.run( ['sudo','apt','remove',f'libobasis{vrs}-kde-integration'],
        stderr=subprocess.DEVNULL )

lapps = [
    "base",
    "calc",
    "draw",
    "impress",
    "math",
    "startcenter",
    "writer"
]

# delete user's existing custom LibreOffice .desktop files
for f in Path( dstdir ).glob( "libreoffice*.desktop" ):
    f.unlink()

# copy system LibreOffice .desktop files to user's XDG .desktop dir
for app in lapps:
    appname = f"libreoffice{vrs}-{app}.desktop"
    src = f"{srcdir}{appname}"
    dst = f"{dstdir}{appname}"
    copy(src, dst)
    with open(dst,'r') as f:
        fs = f.read()
        fs = fs.replace( 'Exec=',f'Exec={prepend} ' )
    with open( dst,'w' ) as f:
        f.write(fs)


# Rebuild KService desktop file system configuration cache
subprocess.run( ['kbuildsycoca5'], stderr=subprocess.DEVNULL )