2

I am using Plasma-desktop notifications for all kinds of things, often from scripts using kdialog or notify-send. My Plasma desktop uses a dark background with a light foreground (text). Until a few months ago, all was well, but after a system update (in May?) my notifications kept their dark background but started using dark text as well for the notification body. Hence, all I can read is the title.

I looked at my current colour scheme in ~/.local/share/color-schemes/*.colors, setting all text (Foreground*=255,0,0) to red, but the notification fonts did not change. This document provides some specifications and mentions that ForegroundInactive should be used for the body text. However, this may be in a section of the colour scheme that is currently lacking. Also, the document is about three years old.

I'm using KDE Plasma v.5.25.5 on Gentoo Linux.

How can I change the colour of the (body) text in my notifications?

2 Answers 2

1

You should be able to change the body text color of a notification in System Settings -> Appearance -> Colors. Here, click the edit icon of the currently selected theme and then select the "View Text" color. After you save and apply the changes (you might need to log out and log in again), the notification's body text should appear in the color you picked. Be careful here since this will change that color in other places, too. It seems it's a general setting for labels of some sort. Once you apply the change, you should basically see the new color immediately in the system settings window since it uses the same labels as the notifications themselves. It's better to copy the original value somewhere in case this results in too many changes in your system theme.

I'm not sure where you can change the color specifically for the notification body text without it affecting other parts of the system. According to this thread, it seems that the fact that notifications inherit the system colors is intended in the newer KDE Plasma versions. However, you can always try and change the color in the code directly but that seems like an overly invasive solution. Hope this helps!

3
  • Thank you. Unfortunately I already tried changing the colours of all fonts in my colour scheme, including the "View Text" one, and to no avail. I updated the question to clarify that. In the end, your hint on editing the .qml files brought me to the correct directory, and a lot of trial and error and logging out and in gave me the workaround I describe in a separate answer. Commented Nov 11, 2022 at 10:32
  • Not sure if this will have anything to do with it but can you share what system theme are you using? I'm only asking because I realized that you mentioned that you looked in ~/.local/share/color-schemes/ but there are additional color schemes in /usr/share/plasma/desktoptheme/*/colors (usually for the default system themes) and in ~/.local/share/plasma/desktoptheme/*/colors (usually for the downloaded themes) - as mentioned in the docs. Commented Nov 12, 2022 at 20:30
  • I'm using Oxygen. This would then use /usr/share/plasma/desktoptheme/oxygen/colors:, which has the same sections as my custom colour scheme. I notice that the Breeze themes in addition have the sections [Colors:Complementary], [Colors:Header] and [Colors:Header][Inactive], which are lacking in Oxygen. I do not have a ~/.local/share/plasma/desktoptheme directory. Commented Nov 13, 2022 at 9:48
1

Luckas' answer pointed me in the direction of a workaround (rather than a solution):

In /usr/share/plasma/plasmoids/org.kde.plasma.notifications/contents/ui/NotificationItem.qml
@@ -230,7 +230,7 @@ ColumnLayout {
                         // HACK RichText does not allow to specify link color and since LineEdit
                         // does not support StyledText, we have to inject some CSS to force the color,
                         // cf. QTBUG-81463 and to some extent QTBUG-80354
-                        text: "<style>a { color: " + PlasmaCore.Theme.linkColor + "; }</style>" + notificationItem.body
+                        text: "<style>a { color: " + PlasmaCore.Theme.linkColor + "; } p { color: " + PlasmaCore.Theme.textColor + "; }</style><p>" + notificationItem.body + "</p>"
 
                         // Cannot do text !== "" because RichText adds some HTML tags even when empty
                         visible: notificationItem.body !== ""

While this does not solve my issue properly, at least I can read my notifications again. Since it took me several hours to reach such a trivial goal (not helped by the fact I had to log out and into Plasma after every change - you'll have to do the same after this edit), I'm sufficiently happy/annoyed to stop here.

However, this workaround may give some insight into the actual problem - I'm still very interested to hear any further suggestions.

1
  • 1
    How the global theme, the plasma style, the color scheme interact is a mystery to me (it really needs docs). I've got kubuntu global theme, oxygen applicaiton style, oxygen plasma style and oxygen cold color scheme selected. signal notification body on kubuntu 20.04 is legible, but not on 22.04. I'm going to try your hack, thanks Commented Mar 17, 2023 at 17:11

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.