I’ve tried creating a patch, but right now it seems to fail . It basically consists of applying a shader effect somewhere in the compositor:
layer.enabled: nighlightConfig.enabled
layer.effect: ShaderEffect {
property real r: nightlightConfig.gammaR
property real g: nightlightConfig.gammaG
property real b: nightlightConfig.gammaB
fragmentShader: "
varying highp vec2 qt_TexCoord0;
uniform sampler2D source;
uniform lowp float qt_Opacity;
uniform lowp float r;
uniform lowp float g;
uniform lowp float b;
void main() {
lowp vec4 tex = texture2D(source, qt_TexCoord0);
gl_FragColor = vec4(vec3(pow(tex.r, 1.0/r), pow(tex.g, 1.0/g), pow(tex.b, 1.0/b)), tex.a) * qt_Opacity;
}"
}
And a configuration group somewhere:
ConfigurationGroup {
id: nightlightConfig
path: "/desktop/lipstick-jolla-home/patches/nightlight"
property bool enabled: false
property real gammaR: 1.0
property real gammaG: 1.0
property real gammaB: 1.0
}
I’ve tried applying them on server items, like the Compositor
in compositer.qml
(file names are relative to /usr/share/lipstick-jolla-home-qt5/
, but that doesn’t work since Compositor is a C++ type which doesn’t inherit from QQuickItem. It doesn’t work in the LayersParent
(first child of Compositor
that inherits Item
) either, for a reason unknown to me.
If someone wants to hack further on it, you can grab a copy of what I was working on here
(I don’t want to put this piece of non-working “art” on my public GitHub profile and I don’t want to give people the impression that I’m planning on maintaining it, so please copy it to your own repository and enjoy the beautiful wonders of maintaining a software project yourself
).
I’ve attached some instructions on how to restore your phone if you break your homescreen. Trust me, you will eventually.