How to Change Desktop Icon Size & Spacing in Ubuntu 20.04 [Ubuntu 22.04 Updated]

Too many application shortcuts, files, and folder icons on your desktop, and no more spaces to have more? Well, you can change the icon sizes as well as icon spacing (Horizontal and Vertical) to save your desktop spaces.

For UBUNTU 22.04, please SCROLL DOWN & see the update section!

Change Desktop Icon Size in Ubuntu 20.04

The desktop in Ubuntu 20.04 Gnome is handled via an extension called ‘Desktop Icons‘. It offers options, either via Gnome Tweaks or Extensions tool, to select from Small, Standard, and Large icon sizes.

What if the three icon sizes do not meet your requirement? Let’s hack the extension.

1. Edit the extension file:

Press Ctrl+Alt+T on keyboard to open terminal, then run command to edit the file via Gedit text editor:

sudo -H gedit /usr/share/gnome-shell/extensions/desktop-icons@csoriano/prefs.js

When the file opens, scroll down and find out the lines for ‘ICON_SIZE’, ‘ICON_WIDTH’, and ‘ICON_HEIGHT’. And change the value of which you want.

While changing ‘ICON_SIZE’ impacts on real icon sizes, editing ‘ICON_WIDTH’ and ‘ICON_HEIGHT’ will change the icon selection area width and height, which impact on horizontal and vertical spacing.

2. Restart Gnome Shell:

After made your changes, save the file and press Alt+F2, type r in ‘Run a Command’ box, and hit Enter to restart Gnome Shell to apply changes.

Known Issue:

There’s a known issue that a regular system extension update will override what you did in previous steps.

As a workaround, you may disable system ‘Desktop Icon’ extension and create your own one with following steps:

  1. Open terminal (Ctrl+Alt+T) and run command to disable system desktop icons extension:
    gnome-extensions disable desktop-icons@csoriano
  2. Create the local extensions directory (skip this step if you’ve installed an extension from extensions.gnome.org) via command:
    install -d $HOME/.local/share/gnome-shell/extensions
  3. Copy the system ‘Desktop Icons’ extension to local directory and rename it via command:
    cp -r /usr/share/gnome-shell/extensions/desktop-icons@csoriano $HOME/.local/share/gnome-shell/extensions/desktop-icons@csoriano-local
  4. Edit the metadata.json file, and change the uuid value to match the new name by running command:
    gedit ~/.local/share/gnome-shell/extensions/desktop-icons@csoriano-local/metadata.json

    When the file opens, write the new uuid name so it will look like:

  5. Finally hack this local extension to change the icons size and spacing:
    gedit ~/.local/share/gnome-shell/extensions/desktop-icons@csoriano-local/prefs.js
  6. And enable the local extension via command:
    gnome-extensions enable desktop-icons@csoriano-local
  7. Finally restart Gnome Shell and enjoy!

via:askubuntu

Change Desktop Icon Size in Ubuntu 22.04

Ubuntu 22.04 switches to DING (Desktop Icons NG) extension to handle desktop icons. Normally, you can change the icon size via “Appearance” settings page.

NOTE: for Ubuntu 22.10, the settings now under ‘Ubuntu Desktop‘ tab.

Change Desktop Icon Size the normal way
  1. To set custom icon sizes, press Ctrl+Alt+T on keyboard to open terminal. When it opens, run command to edit the config file:
sudo gedit /usr/share/gnome-shell/extensions/[email protected]/enums.js

For Ubuntu 22.10, replace gedit with nano in command. Then edit the sizes as the picture shows you:

  1. Next, search for and open “Gnome Extensions” app via Activities overview screen.

Run sudo apt install gnome-shell-extension-prefs command to install the app if you don't have it

And, finally turn off “Desktop Icons NG” extension and re-enable it to apply changes.

Now, re-open “Settings > Appearance” page and select a desktop icon size to see the magic!

Hi, I'm Merilyn Ne, a computer geek working on Ubuntu Linux for many years and would like to write useful tips for beginners. Forgive me for language mistakes. I'm not a native speaker of English.