Ubuntu – How to decrease the padding of dock icons in ubuntu 20.04

20.04dash-to-dockdockiconsubuntu-dock

I am using ubuntu 20.04 LTS. I don't know how I did this, but I tried to customize my dock settings using dash to dock extension. But then I realized that the space between 2 icons on the dock is too much and I don't like it. I need the default values. There isn't any option in the dconF-editor also. As you can see in these images, there is a huge space between my dock icons. Is there any method to correct this?

This is how my dock appears

This is how my dock appears

This is the default dock

This is the default dock

Best Answer

You can do this following these two steps described below -

  1. Change dashToDock extension setting -

    a. open dconf editor

    b. go to org/gnome/shell/extensions/dash-to-dock/

    c. turn on custom-theme-shrink

  2. Now you have to change theme css file -

    a. now go to /usr/share/themes/Yaru-dark/gnome-shell/

    (I'm assuming that you are using Yaru-dark shell theme)

    b. open gnome-shell.css file in a text editor

    c. search these lines of code -

    #dashtodockContainer.shrink .dash-item-container > StButton, #dashtodockContainer.dashtodock .dash-item-container > StButton {
    padding: 2px 4px !important; }
    

    d. change padding to -

    padding: 0px 0px !important;
    

Now restart your gnome-shell by pressing Alt+f2 and then running r command