In Ubuntu 17.10, how to rearrange icons in dock

Drag & drop! See the animated image below.

enter image description here


The solution above may be outdated or non-working. To rearrange the icons of the applications "pinned" (i.e. added to favourites) to the dock in the Terminal way, do this:

First open Terminal and run

gsettings get org.gnome.shell favorite-apps

You should get the list of .desktop files associated to the applications pinned to the dock in order, something like the following:

['appname-1.desktop', 'appname-2.desktop', 'appname-3.desktop', 'appname-4.desktop', 'appname-5.desktop']

Suppose you want to move the icon of the application associated to appname-3.desktop to the first position. In that case, run

gsettings set org.gnome.shell favorite-apps "['appname-3.desktop', 'appname-1.desktop', 'appname-2.desktop', 'appname-4.desktop', 'appname-5.desktop']"

and so on.