I want to increase the spacing between the items in the left sidebar of the Nemo file manager. By default the spacing is less so, for me, the items looks cluttered. Is there a way to increase that spacing using CSS? or any other way?

enter image description here


Yes, you can increase that spacing by adding 2 line of code to the gtk.css file. Here is how you can proceed:

1. Copy your current theme to ~/.themes and rename it:

If, for example, you use the Yaru theme, issue the following command in terminal to copy it from /usr/share/themes to ~/.themes and rename the folder to Yaru-2

cp -r /usr/share/themes/Yaru ~/.themes/Yaru-2

(Skip this step if you already put your theme in ~/.themes)

2. Create a nemo.css file:

  • Open your favorite text editor (e.g. gedit) and paste the following contents into it:
.sidebar .cell {
padding: 2px; }
  • Save the file with the name nemo.css

(These 2 lines essentially add more spacing to items in the side bar. 2px seems pretty reasonable according to my experiment, but of course you can increase or decrease it however you want, just don't leave it 0px)

3. Add the nemo.css file to gtk.css file:

  • Go to ~/.themes/Yaru-2/gtk-3.0
  • Create a new folder named apps
  • Put the nemo.css file created earlier into this folder
  • Open the gtk.css file in ~/.themes/Yaru-2/gtk-3.0/ with your text editor
  • Add this line to the end of the file and save it:
@import url("apps/nemo.css");

(If there's a folder named gtk-3.20 in ~/.themes/Yaru-2/ then you also have to repeat this step for that folder)

4. Reset your theme:

gsettings set org.gnome.desktop.interface gtk-theme "Yaru-2"
gsettings set org.gnome.desktop.wm.preferences theme "Yaru-2"

or use gnome-tweak-tool or unity-tweak-tool.

Note: Sometimes the change won't take effect immediately even after you reset the theme. In that case, reset your icon theme (choose a different one and re-choose your favorite icon theme) can fix the problem.

Based on the answers from this post and this post.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.