20.04 - How to change the size and appearance of desktop icons and the way they are handled?

21,139

Solution 1

Since some previous versions of Ubuntu..

Desktop Icons are handled by desktop-icons gnome-shell extension.

you can achieve the sizes and spacing you mentioned in Question by editing the extensions prefs.js file. Take backup of the file before editing.

the extensions directory is /usr/share/gnome-shell/extensions/desktop-icons@csoriano

Original Content:

const ICON_SIZE = { 'small': 48, 'standard': 64, 'large': 96 };
const ICON_WIDTH = { 'small': 108, 'standard': 116, 'large': 116 };
const ICON_HEIGHT = { 'small': 86, 'standard': 102, 'large': 134 };

Edited Content:

const ICON_SIZE = { 'small': 48, 'standard': 64, 'large': 96 };
const ICON_WIDTH = { 'small': 52, 'standard': 116, 'large': 116 };
const ICON_HEIGHT = { 'small': 60, 'standard': 102, 'large': 134 };

I Have Configured the sizes for 'small', you can achieve with other sizes 'standard' and 'large' also.

enter image description here


Above method requires root privileges.. If you need to make changes locally..

Disable the system extension desktop-icons.

gnome-extensions disable desktop-icons@csoriano

create the local extensions directory.

install -d $HOME/.local/share/gnome-shell/extensions

Copy the system extension desktop-icons to local extensions directory and rename it as desktop-icons@csoriano-local

cp -r /usr/share/gnome-shell/extensions/desktop-icons@csoriano $HOME/.local/share/gnome-shell/extensions/desktop-icons@csoriano-local

Edit the metadata.json file of the local extension like below contents. Observe that "local" is the main change

{ we need to edit the metadata.json file because extensions directory name and the UUID field in the metadata.json file must match }

gedit $HOME/.local/share/gnome-shell/extensions/desktop-icons@csoriano-local/metadata.json

Already Edited Content:

{
    "name": "Desktop Icons-local",
    "description": "Add icons to the desktop",
    "uuid": "desktop-icons@csoriano-local",
    "shell-version": ["3.34.0"]
}

Enable the local extension with below command

gnome-extensions enable desktop-icons@csoriano-local

Refresh the gnome-shell with Alt+F2 'r' Enter method.

enter image description here

Make sure you never turn on both the extensions desktop-icons@csoriano (System Extension) and desktop-icons@csoriano-local (Local Extension)

Solution 2

For Ubuntu 21.04 you can change the size of the desktop icons by simply adjusting it via the desktop settings again.

Right click on the desktop->choose settings You can adjust the Icon size in the Dialog

ubuntu desktop settings dialog

Share:
21,139

Related videos on Youtube

Anvos Gorbs
Author by

Anvos Gorbs

Updated on September 18, 2022

Comments

  • Anvos Gorbs
    Anvos Gorbs over 1 year

    I've just upgraded from Ubuntu 18.04 to its newest LTS version - 20.04. While it comes with some interesting changes, the Desktop icon system was messed up in my opinion. When you hover the mouse cursor over the icons, you see a huge space marked around them that cannot be violated (as you can see in the image below) so that they need to be placed very far apart from each other.

    18.04 allowed you to place icons much closer to each other and didn't have that marked space around them. This new way leaves much less space on the Desktop to organize large amounts of icons - including folders, files and shortcuts. Is there a way I can significantly reduce the size of icons and their "spaces" or go back to the old system of organizing files? On "Settings", there is a tool to change the size of Dock icons, but not of Desktop icons.

    Also, every time I move or delete something, the Desktop "flashes" and the icons seem to rearrange themselves automatically, nothing of which happened in 18.04. I also can't move anything directly to the Desktop; I need to move to the Desktop folder on Nautilus. This makes me start to think about downgrading Ubuntu back to 18.04.

    enter image description here

    • UnKNOWn
      UnKNOWn almost 4 years
      the second paragraph question is somehow possible..
  • Anvos Gorbs
    Anvos Gorbs almost 4 years
    Thanks! That worked for me. Do you know how to reduce the size of the text below the icons too?
  • UnKNOWn
    UnKNOWn almost 4 years
  • vanadium
    vanadium almost 4 years
    Excellent that you also explain how to do this for a single user without needing root permissions.
  • Zatigem
    Zatigem about 3 years
    Note that the "extension’s directory" is not always at /usr/share…. It is the case when installing with apt. But if you install with this link, the root directory of Desktop Icon will be at ~/.local…