dark mode transition using gsettings
Feature summary
Changing the value of the GSettings key color-scheme
on org.gnome.desktop.interface
should trigger the same screen transition animation that is applied when changing the "Style" in the "Appearance" Settings-panel.
Scripts or other applications changing the color-scheme
preference do not get the nice transition animation.
I'd like to be able to change the color-scheme
based a keyboard button or the current time and actually get a nice transition effect.
How would you like it to work
The shell currently exposes a DBus method ScreenTransition
on org.gnome.Shell
to start the animation which is triggered by the Settings-panel when the "Style" is changed.
I would prefer the shell to trigger the screen transition by itself when the GSettings key color-scheme
is changed.
What irritates me is that the background is changing with a nice transition when the GSettings key changes, while the effect for applications requires a DBus call (which is not available to scripts/applications unless one uses global.context.unsafe_mode = true
). Is there a good reason for that design decision?
Relevant links, screenshots, screencasts etc.
Example command to change the style without a transition:
gsettings set org.gnome.desktop.interface color-scheme 'prefer-dark' # or 'default' when in already on 'prefer-dark'
Settings-panel code which calls ScreenTransition
:
https://gitlab.gnome.org/GNOME/gnome-control-center/-/blob/main/panels/background/cc-background-panel.c#L109-126
Calling screen transition using gdbus:
$ gdbus call --session --dest 'org.gnome.Shell' --object-path '/org/gnome/Shell' --method 'org.gnome.Shell.ScreenTransition'
Error: GDBus.Error:org.freedesktop.DBus.Error.AccessDenied: ScreenTransition is not allowed