GNOME thumbnail-limit

How do I set the Thumbnail Preview Limit in GNOME?

Till now I could do it via thumbnail-limit in org/gnome/nautilus/prefernces/.

This is not working anymore for me.

Thumbnail limit is still a thing but it is 50 MB so it should not be an issue for most pictures.

Sometimes thumbnailer just gets stuck, try refreshing the view with F5 to have the thumbnailing rescheduled.

Also, in case you are copying the schema directory, note the typo in prefernces.

Thanks for the answer.

I have pictures (e.g. panoramas) that are bigger than 50 MB!

It seems, that the limit is now changed somewhere else or I do something wrong…

Tried to set it via dconf. But does not work…

  dconf.enable = true;
    "org/gnome/nautilus/preferences" = {
      thumbnail-limit = 100;
    };

wat.

do you mean this? :crazy_face:

  programs.dconf.enable = true;
  programs.dconf.profiles.user.databases = [
    {
      settings."org/gnome/nautilus/preferences" = {
        thumbnail-limit = 100;
      };
    }
  ];

Thank you for the hints.

@frozen.frog23 Does your comment means, that the thumbnail-limit setting is not used at all?

Till now I have not managed to get thumbnails generated form big images. All other tasks are working fine…

{ config, pkgs, ... }:

{
  
  dconf.enable = true;
  dconf.settings = {

    "org/gnome/nautilus/preferences" = {
      thumbnail-limit = 100;
    };

    # Schriftgrösse
    "org/gnome/desktop/interface" = {
      text-scaling-factor = 1.5;
    };
      
    # Taskleiste
    "org/gnome/shell" = {
      favorite-apps = [
        "org.gnome.Evolution.desktop"
        "firefox.desktop"
        "torbrowser.desktop"
        "org.gnome.Nautilus.desktop"
        "org.gnome.Console.desktop"
        "simple-scan.desktop"
      ];
    };
  };
}
1 Like

ohhhh! the thumbnail-limit is in BYTES!

you’re looking for this:

thumbnail-limit = 104857600

which is 100 MB…

i could be wrong though! i was looking at some old gnome and nautilus forums from the early noughties. it’s most likely have been already changed.

(nevermind below)

ohh. you are using HOME-MANAGER! i see…

so,

dconf.settings = { };

is an option for home-manager of type “attribute set of attribute set of (GVariant value)”

and

programs.dconf.profiles = { };

is a vanilla (default) nixOS option of type “attribute set of (absolute path or package or (submodule))”

and as you can see - they are different…

…but there is always a chance that home-manager may not work with everything (maybe because something happened in /etc/dconf/profile/ or something?), so you should try the regular nixOS option:

  programs.dconf.enable = true;
  programs.dconf.profiles = {
    user.databases = [
      { # BOL
        settings = {
          # Nautilus
          "org/gnome/nautilus/preferences" = {
            thumbnail-limit = 100;
            # ...
          };
          # Schriftgrösse
          "org/gnome/desktop/interface" = {
            text-scaling-factor = 1.5;
          };
          # Taskleiste
          "org/gnome/shell" = {
            favorite-apps = [
              "org.gnome.Evolution.desktop"
              "firefox.desktop"
              "torbrowser.desktop"
              "org.gnome.Nautilus.desktop"
              "org.gnome.Console.desktop"
              "simple-scan.desktop"
            ];
          };
          # ...
        };
      } # EOL
    ];
  };

hopefully i am not confused here…

alternatively, you can also edit the nautilus config imperatively…

@frozen.frog23 @jtojnar
Thanks for your answer.

Unfortunately it does not work!

I am not sure weather it is my problem or the setting is not anymore available…

{ config, pkgs, ... }:
{
  programs.dconf.enable = true;
  programs.dconf.profiles.user.databases = [
    {
#      lockAll = true; # prevents overriding
      settings = {
        "org/gnome/nautilus/preferences" = {
#          thumbnail-limit = "100";
#          thumbnail-limit = "104857600";
          thumbnail-limit = "1048576";
        };
      };
    }
  ];

}

Even with a lower value it does not affect anything…

dconf uses GVariant type system and there are multiple different numeric types. You cannot just use Nix string or number or GSettings will see the dconf database contains a wrong type and return a default value.

You can see the current recognized value with gsettings get org.gnome.nautilus.preferences thumbnail-limit.

In fact, due to this ambiguity, NixOS module will fail if you try to use a plain Nix number:

       error: The GVariant type for number “1048576” is unclear.
       Please wrap the value with one of the following, depending on the value type in GSettings schema:

       - `lib.gvariant.mkInt32` for `i`
       - `lib.gvariant.mkUint32` for `u`
       - `lib.gvariant.mkInt64` for `x`
       - `lib.gvariant.mkUint64` for `t`

Unfortunately, in home-manager, you will not get an error. Plain Nix integers will instead be implicitly assumed to be int32, which won’t work in this case.

And strings will not error out in either case, since neither of the dconf modules has access to GSettings schemas to be able to validate the type.


As per the schema, the value type is uint64 (t in GVariant type string).

So you would need to use lib.gvariant.mkUint64 100.

2 Likes

@jtojnar Thank you very much!

It works now!

{ config, pkgs, lib, ... }:

{
  programs.dconf.enable = true;
  programs.dconf.profiles.user.databases = [
    {
#      lockAll = true; # prevents overriding
      settings = {
        "org/gnome/nautilus/preferences" = {
          thumbnail-limit = lib.gvariant.mkUint64 100;
        };
      };
    }
  ];
}
1 Like