GNOME: Difference between revisions

m (Triple-buffering patch for GNOME 46)
Line 3: Line 3:


[https://gnome.org/ {{PAGENAME}}] is available as a [[module]] and can be enabled with <code>services.xserver.desktopManager</code>.
[https://gnome.org/ {{PAGENAME}}] is available as a [[module]] and can be enabled with <code>services.xserver.desktopManager</code>.
== Installation ==
== Installation ==


Line 47: Line 45:
</syntaxhighlight>
</syntaxhighlight>


To declaratively enable and configure, use of modules like home-manager is required to configure dconf settings.
To declaratively enable and configure, use of modules like home-manager you are required to configure dconf settings.


<syntaxhighlight lang="nixos">
<syntaxhighlight lang="nixos">
  dconf = {
dconf = {
    enable = true;
        enable = true;
    settings = {
        settings = {
      "org/gnome/shell" = {
                "org/gnome/shell" = {
        disabled-user-extensions = false; # enables user extensions (disabled by default)
                        disabled-user-extensions = false; # enables user extensions (disabled by default)
        enabled-extensions = [
                        enabled-extensions = [
          "blur-my-shell@aunetx"
                                "blur-my-shell@aunetx"
          # ****
                                # ****
        ];
                        ];
      };
                };


      # Configure individual extensions
                # Configure individual extensions
      "org/gnome/shell/extensions/blur-my-shell" = {
                "org/gnome/shell/extensions/blur-my-shell" = {
        brightness = 0.75;
                        brightness = 0.75;
        noise-amount = 0;
                        noise-amount = 0;
      };
                };
    };
        };
  };
};
</syntaxhighlight>
</syntaxhighlight>


Line 77: Line 75:
Change default color theme for all GTK4 applications to dark using [[Home Manager]]. Change <code>myuser</code> to the user you want to apply the configuration to.
Change default color theme for all GTK4 applications to dark using [[Home Manager]]. Change <code>myuser</code> to the user you want to apply the configuration to.


<syntaxHighlight lang=nix>
<syntaxhighlight lang="nix">
home-manager.users.myuser = {
home-manager.users.myuser = {
  dconf = {
        dconf = {
    enable = true;
                enable = true;
    settings."org/gnome/desktop/interface".color-scheme = "prefer-dark";
                settings."org/gnome/desktop/interface".color-scheme = "prefer-dark";
  };
        };
};
};
</syntaxHighlight>
</syntaxhighlight>


== Tips and tricks ==
== Tips and tricks ==
Line 94: Line 92:
For instance, if you see the following error:
For instance, if you see the following error:


<syntaxHighlight lang=text>
<syntaxhighlight lang="text">
dconf-WARNING **: failed to commit changes to dconf: GDBus.Error:org.freedesktop.DBus.Error.ServiceUnknown: The name ca.desrt.dconf was not provided by any .service files
dconf-WARNING **: failed to commit changes to dconf: GDBus.Error:org.freedesktop.DBus.Error.ServiceUnknown: The name ca.desrt.dconf was not provided by any .service files
</syntaxHighlight>
</syntaxhighlight>


you should enable dconf module:
you should enable dconf module:
Line 144: Line 142:
Big [https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1441 merge request] against Mutter improves the performance of the window manager by a lot (and is already used by Ubuntu). Not merged into nixpkgs due to [https://github.com/NixOS/nixpkgs/issues/197181 philosophy of nixpkgs], but users are free to add this overlay to get it too.
Big [https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1441 merge request] against Mutter improves the performance of the window manager by a lot (and is already used by Ubuntu). Not merged into nixpkgs due to [https://github.com/NixOS/nixpkgs/issues/197181 philosophy of nixpkgs], but users are free to add this overlay to get it too.


Currently it's adapted for Gnome 45.
For NixOS 23.11 (gnome 45), add the following:


<syntaxHighlight lang=nix>
<syntaxhighlight lang="nix">
nixpkgs.overlays = [
        (final: prev: {
                gnome = prev.gnome.overrideScope (gnomeFinal: gnomePrev: {
                        mutter = gnomePrev.mutter.overrideAttrs ( old: {
                                src = pkgs.fetchgit {
                                        url = "https://gitlab.gnome.org/vanvugt/mutter.git";
                                        rev = "0b896518b2028d9c4d6ea44806d093fd33793689";
                                        sha256 = "sha256-mzNy5GPlB2qkI2KEAErJQzO//uo8yO0kPQUwvGDwR4w=";
                                };
                        });
                });
        })
];
</syntaxhighlight>
 
For NixOS 24.05 (gnome 46), add the following:
 
<syntaxhighlight lang="nix">
nixpkgs.overlays = [
nixpkgs.overlays = [
  # GNOME 46: triple-buffering-v4-46
        (final: prev: {
  (final: prev: {
                gnome = prev.gnome.overrideScope (gnomeFinal: gnomePrev: {
    gnome = prev.gnome.overrideScope (gnomeFinal: gnomePrev: {
                        mutter = gnomePrev.mutter.overrideAttrs ( old: {
      mutter = gnomePrev.mutter.overrideAttrs ( old: {
                                src = pkgs.fetchgit {
        src = pkgs.fetchgit {
                                        url = "https://gitlab.gnome.org/vanvugt/mutter.git";
          url = "https://gitlab.gnome.org/vanvugt/mutter.git";
                                        rev = "663f19bc02c1b4e3d1a67b4ad72d644f9b9d6970";
      rev = "663f19bc02c1b4e3d1a67b4ad72d644f9b9d6970";
                                        sha256 = "sha256-I1s4yz5JEWJY65g+dgprchwZuPGP9djgYXrMMxDQGrs=";
          sha256 = "sha256-I1s4yz5JEWJY65g+dgprchwZuPGP9djgYXrMMxDQGrs=";        
                                };
        };
                        });
      } );
                });
    });
        })
  })
];
];
</syntaxHighlight>
 
</syntaxhighlight>


You might need to disable aliases to make it work:
You might need to disable aliases to make it work:
Line 186: Line 202:


=== Change user's profile picture ===
=== Change user's profile picture ===
Currently there is no way to change the user's profile picture using Gnome Control Center [https://github.com/NixOS/nixpkgs/issues/10025 (see this issue)] and currently there is no plan to support it officially in NixOS.
Currently there is no way to change the user's profile picture using Gnome Control Center [https://github.com/NixOS/nixpkgs/issues/10025 (see this issue)] and currently there is no plan to support it officially in NixOS. However, you can modify it by copying the profile picture that you want to the path '''/home/$USER/.face''' as a workaround, i.e.
However, you can modify it by copying the profile picture that you want to the path '''/home/$USER/.face''' as a workaround, i.e.


<syntaxHighlight lang=console>
<syntaxHighlight lang=console>