9

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

PRATAP
  • 21,989
  • 8
  • 59
  • 121
Berlin
  • 91
  • 1
  • 3
  • you can reset easily in dconf-editor... https://i.stack.imgur.com/QHEB7.png – PRATAP Jun 29 '20 at 11:18
  • @PRATAP I did it but nothing happens :( – Berlin Jun 29 '20 at 11:30
  • 1
    seems shell theme is controlling it then.. can you change any shell theme n see.. – PRATAP Jun 29 '20 at 11:33
  • I changed the theme. But the width of the dock doesn't change. It seems like for lower dock icon sizes the width doesnt reduce much. So I am using 22 ptx, and I think its normal for such a size. – Berlin Jun 29 '20 at 11:54

3 Answers3

6

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

Ankit Jain
  • 649
  • 4
  • 5
  • Good answer. Although, answer's a little bit incomplete/pre-assuming. It assumes that the user uses "Yaru-dark" as their shell theme. You should go to "Gnome Tweaks", and see which shell theme you're using, and then go to `/usr/share/theme//`. Also, `#dashtodockContainer` is not the correct selector anymore from what I see. `#dash` is what is used in my css file – Eksapsy Apr 10 '21 at 12:16
1

If you're using a theme go to /home/{user}/.themes/{theme name}/gnome-shell/gnome-shell.css

or for system theme go to /usr/share/gnome-shell/theme

find this line of code

  #dashtodockContainer .show-apps .overview-icon {
  padding: 4px;
  background-size: contain;
}

and change padding to whichever value suits you. Log out and log back in.

0

if you're using dash to dock extension put this at the bottem of gnome-shell/extensions/dash-to-dock/stylesheet.css

#dashtodockContainer .overview-icon {
padding-top:2px;
padding-bottom:2px;
padding-right: 1px;
padding-left: 1px;
}

#dashtodockContainer.icon {
padding-top:1px;
padding-bottom:1px;
padding-right: 1px;
padding-left: 1px;
border-radius: 0px;/*for square border */
}

then reload using alt+f2 and r

source

Also change the outermost border using

#dashtodockContainer.shrink .dash-item-container > StButton,
#dashtodockContainer.dashtodock .dash-item-container > StButton {
padding: 1px 2px; /* padding between icon borders */
}