GNOME: Difference between revisions

Normalcea (talk | contribs)
m Excluding GNOME Applications: file-roller is optional as Nautilus has support for archived formats.
Normalcea (talk | contribs)
Move dark mode dconf snippet to tips and tricks.
Line 174: Line 174:


{{Note|Since dconf have more data types than Nix language (for example, tuples), in some cases you'll need to convert Nix value to a GVariant value. You can achieve that by using function defined in <code>lib.gvariant</code>, they're documented [https://nixos.org/manual/nixpkgs/stable/#sec-functions-library-gvariant here].}}
{{Note|Since dconf have more data types than Nix language (for example, tuples), in some cases you'll need to convert Nix value to a GVariant value. You can achieve that by using function defined in <code>lib.gvariant</code>, they're documented [https://nixos.org/manual/nixpkgs/stable/#sec-functions-library-gvariant here].}}
=== Dark mode ===
Change default color theme for all GTK4 applications to dark using [[Home Manager]].
{{file|~/.config/home-manager/home.nix|nix|<nowiki>
{
  dconf = {
    enable = true;
    settings."org/gnome/desktop/interface".color-scheme = "prefer-dark";
  };
}
</nowiki>}}


== Tips and tricks ==
== Tips and tricks ==
Line 202: Line 189:
you should enable dconf module:
you should enable dconf module:


<syntaxHighlight lang="nix">
<syntaxhighlight lang="nix">
{
{
   programs.dconf.enable = true;
   programs.dconf.enable = true;
}
}
</syntaxHighlight>If you're using the default theme, GTK-3 applications may not respect the dark theme if they can't find the Adwaita. To fix it, make sure you have the <code>gnome-themes-extra</code> package installed:<syntaxhighlight lang="nix">
</syntaxhighlight>If you're using the default theme, GTK-3 applications may not respect the dark theme if they can't find the Adwaita. To fix it, make sure you have the <code>gnome-themes-extra</code> package installed:<syntaxhighlight lang="nix">
{
{
   environment.systemPackages = [ pkgs.gnome-themes-extra ];
   environment.systemPackages = [ pkgs.gnome-themes-extra ];
Line 216: Line 203:
To get systray icons, install the related GNOME shell extension
To get systray icons, install the related GNOME shell extension


<syntaxHighlight lang="nix">
<syntaxhighlight lang="nix">
{
{
   environment.systemPackages = [ pkgs.gnomeExtensions.appindicator ];
   environment.systemPackages = [ pkgs.gnomeExtensions.appindicator ];
}
}
</syntaxHighlight>
</syntaxhighlight>


And ensure gnome-settings-daemon udev rules are enabled:
And ensure gnome-settings-daemon udev rules are enabled:
Line 234: Line 221:
Some old applications use GConf service to store configuration. This has been deprecated for many years but some applications were abandoned before they managed to upgrade to a newer dconf system. If you are running such application and getting an error like:
Some old applications use GConf service to store configuration. This has been deprecated for many years but some applications were abandoned before they managed to upgrade to a newer dconf system. If you are running such application and getting an error like:


<syntaxHighlight lang="text">
<syntaxhighlight lang="text">
GLib.GException: Failed to contact configuration server; the most common cause is a missing or misconfigured D-Bus session bus daemon. See http://projects.gnome.org/gconf/ for information
GLib.GException: Failed to contact configuration server; the most common cause is a missing or misconfigured D-Bus session bus daemon. See http://projects.gnome.org/gconf/ for information
</syntaxHighlight>
</syntaxhighlight>


you need to add {{ic|gnome2.GConf}} to the list of dbus packages in your {{ic|configuration.nix}}:
you need to add {{ic|gnome2.GConf}} to the list of dbus packages in your {{ic|configuration.nix}}:


<syntaxHighlight lang="nix">
<syntaxhighlight lang="nix">
{
{
   services.dbus.packages = with pkgs; [ gnome2.GConf ];
   services.dbus.packages = with pkgs; [ gnome2.GConf ];
}
}
</syntaxHighlight>
</syntaxhighlight>


After applying the update restart your desktop session to refresh the user-specific dbus session.
After applying the update restart your desktop session to refresh the user-specific dbus session.
Line 252: Line 239:
Install {{ic|sysprof}} as a ''system'' package (it won't work properly if installed against users). Then enable the associated service with  
Install {{ic|sysprof}} as a ''system'' package (it won't work properly if installed against users). Then enable the associated service with  


<syntaxHighlight lang="nix">
<syntaxhighlight lang="nix">
   services.sysprof.enable = true;
   services.sysprof.enable = true;
</syntaxHighlight>
</syntaxhighlight>


=== Automatic screen rotation ===
=== Automatic screen rotation ===


<syntaxHighlight lang="nix">
<syntaxhighlight lang="nix">
   hardware.sensor.iio.enable = true;
   hardware.sensor.iio.enable = true;
</syntaxHighlight>
</syntaxhighlight>
 
=== Dark mode ===
 
Change default color theme for all GTK4 applications to dark using [[Home Manager]].
 
{{file|~/.config/home-manager/home.nix|nix|<nowiki>
{
  dconf = {
    enable = true;
    settings."org/gnome/desktop/interface".color-scheme = "prefer-dark";
  };
}
</nowiki>}}


== Troubleshoots ==
== Troubleshoots ==