Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

System-wide gsettings override do not work in gnome3 #66554

Open
dasj19 opened this issue Aug 13, 2019 · 6 comments
Open

System-wide gsettings override do not work in gnome3 #66554

dasj19 opened this issue Aug 13, 2019 · 6 comments
Labels
0.kind: bug 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md 6.topic: GNOME GNOME desktop environment and its underlying platform

Comments

@dasj19
Copy link
Contributor

dasj19 commented Aug 13, 2019

Describe the bug
I just installed nixos unstable in a virtual machine and I was fiddling with configuration.nix
And whenever I try to set
services.xserver.desktopManager.gnome3.extraGSettingsOverrides values they do not get applied at all

To Reproduce
Steps to reproduce the behavior:
0. Get the value of gsettings get org.gnome.desktop.input-source sources to compare it to the updated one later.

  1. Add the following to configuration.nix
services.xserver.desktopManager.gnome3.extraGSettingsOverrides = ''
  [org.gnome.desktop.input-source]
  sources=[('xkb','es'), ('xkb', 'ro')]
'';
  1. nixos-rebuild switch
  2. Notice that the value of gsettings get org.gnome.desktop.input-source sources is the same as before

Expected behavior
gsettings value to change for the entire system.

Additional context
I am trying to make available multiple keyboard layouts within gnome for the entire system.

Running gsettings set org.gnome.desktop.input-sources sources "[('xkb', 'es'), ('xkb', 'ro')]" manually as the user i logged in in gnome3 works fine.
When running the same command as root user I get the following error:
(process:10981): dconf-WARNING **: 08:46:30.177: failed to commit changes to dconf: Error spawning command line “dbus-launch --autolaunch=a76d5ca823e24f30b8988dd6683568bb --binary-syntax --close-stderr”: Child process exited with code 1
When I run the same command as root user over ssh it succeds.

Metadata

  • system: "x86_64-linux"
  • host os: Linux 4.19.66, NixOS, 19.09pre188498.4557b9f1f50 (Loris)
  • multi-user?: yes
  • sandbox: yes
  • version: nix-env (Nix) 2.2.2
  • nixpkgs: /nix/var/nix/profiles/per-user/root/channels/nixos

Maintainer information:

# a list of nixpkgs attributes affected by the problem
attribute:
# a list of nixos modules affected by the problem
module:
@worldofpeace
Copy link
Contributor

cc @jtojnar

@worldofpeace worldofpeace added the 6.topic: GNOME GNOME desktop environment and its underlying platform label Aug 13, 2019
@jtojnar
Copy link
Contributor

jtojnar commented Aug 13, 2019

extraGSettingsOverrides option relies on GSettings overrides mechanism, therefore only overrides default values. Once a configuration value is set, the value declared in extraGSettingsOverrides no longer applies.

gnome-settings-daemon reads the default value of org.gnome.desktop.input-source.sources listed in the schema and sets the current value to that when no value is set in the configuration database at login.

If you call gsettings reset org.gnome.desktop.input-sources sources and re-login, you will get the correct language settings.

For a proper configuration, we need #54150.

As for the root user, GSettings use dconf backend by default, which needs D-Bus. Though, it probably does not make sense to try to set the setting, as you are not supposed to run graphical environment as root.

@stale
Copy link

stale bot commented Jun 2, 2020

Thank you for your contributions.

This has been automatically marked as stale because it has had no activity for 180 days.

If this is still important to you, we ask that you leave a comment below. Your comment can be as simple as "still important to me". This lets people see that at least one person still cares about this. Someone will have to do this at most twice a year if there is no other activity.

Here are suggestions that might help resolve this more quickly:

  1. Search for maintainers and people that previously touched the related code and @ mention them in a comment.
  2. Ask on the NixOS Discourse.
  3. Ask on the #nixos channel on irc.freenode.net.

@stale stale bot added the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Jun 2, 2020
@variadico
Copy link

I ran into this myself.

And a quick look at Discourse shows others too:
https://discourse.nixos.org/t/gnome3-settings-via-configuration-nix/5121

services.xserver.desktopManager.gnome3.extraGSettingsOverrides = ''
[org.gnome.desktop.background]
picture-uri='file://home/alexey/my-background.jpg'
'';

@stale stale bot removed the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Mar 14, 2021
@jtojnar
Copy link
Contributor

jtojnar commented Mar 14, 2021

Nothing changed from above. Since the option can only change the defaults, you need to clear the current value of the setting from the configuration database using dconf reset /org/gnome/desktop/background/picture-uri for the default to be used.

For a proper configuration, we need #54150.

@stale
Copy link

stale bot commented Sep 10, 2021

I marked this as stale due to inactivity. → More info

@stale stale bot added the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Sep 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0.kind: bug 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md 6.topic: GNOME GNOME desktop environment and its underlying platform
Projects
None yet
Development

No branches or pull requests

4 participants