How to Customize the Size of Desktop Icons in Ubuntu 22.04

Want to set a certain size of your desktop icons and/or change the spacing between them? Here’s how to do the job in Ubuntu 22.04.

Ubuntu 22.04 defaults to GNOME desktop 42 and uses an extension called “Desktop Icons NG” (DING in short) to handle shortcut icons on desktop.

It provides 4 icon sizes (“Tiny”, “Small”, “Normal”, and “Large”) in ‘Appearance‘ settings for choose from.

Change icon size via Appearance settings page

If somehow the default icon sizes do not meet you need, then you may edit the source file and customize the 4 sizes manually.

1. Edit the config file

Firstly, press Ctrl+Alt+T on keyboard to open terminal. When it opens, run command to edit the file which is located in ‘/usr/share/gnome-shell/extensions/[email protected]/’ directory:

sudo gedit /usr/share/gnome-shell/extensions/[email protected]/enums.js

sudo is required as it’s a system wide extension and you need to type user password to authenticate when running the command.

When file opens, you’ll see the first line (except the comments) defines the icon sizes in pixels:

var ICON_SIZE = { ‘tiny’: 36, ‘small’: 48, ‘standard’: 64, ‘large’: 96 };

Just change the number 36, 48, 64 and 96 will replace the corresponding ‘tiny’, ‘small’, ‘normal’, and ‘large’ icon sizes.

And, change the numbers in lines of “ICON_WIDTH” and “ICON_HEIGHT” will adjust how large the square area that each icon takes. It’s the orange area when you drag and drop an icon, which can be useful if you want to change the icon spacing.

NOTE: The change will take place for all system users. For single user only, you may copy the extension folder to local directory ‘.local/share/gnome-extensions’. However, the option in “Appearance” won’t work for the local copy.

2. Apply change

After editing and saving the config file, search for and open “Gnome Extensions” app.

App to Manage your extensions

Install the tool via sudo apt install gnome-shell-extension-prefs command if you don’t have it.

When the app opens, turn off “Desktop Icons NG” extension and turn it on again will apply the changes you made in previous step.

Original Article